<commit_before>/*
 * Copyright 2015-2016 Hewlett-Packard Development Company, L.P.
 * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
 */

package com.hp.autonomy.hod.client.api.resource;

import lombok.Data;

import java.io.Serializable;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

@Data
public class ResourceFlavour implements Serializable {

    private static final long serialVersionUID = -1478092510670076594L;

    /**
     * The flavour of a standard text index
     */
    public static final ResourceFlavour STANDARD = new ResourceFlavour("standard");

    /**
     * The flavour of an explorer text index
     */
    public static final ResourceFlavour EXPLORER = new ResourceFlavour("explorer");

    /**
     * The flavour of a categorization text index
     */
    public static final ResourceFlavour CATEGORIZATION = new ResourceFlavour("categorization");

    /**
     * The flavour of a custom fields text index
     */
    public static final ResourceFlavour CUSTOM_FIELDS = new ResourceFlavour("custom_fields");

    /**
     * The flavour of a query manipulation text index
     */
    public static final ResourceFlavour QUERY_MANIPULATION = new ResourceFlavour("querymanipulation");

    /**
     * The flavour of a web cloud connector
     */
    public static final ResourceFlavour WEB_CLOUD = new ResourceFlavour("web_cloud");

    /**
     * The flavour of an on site filesystem connector
     */
    public static final ResourceFlavour FILESYSTEM_ONSITE = new ResourceFlavour("filesystem_onsite");

    public static final ResourceFlavour JUMBO = new ResourceFlavour("jumbo");

    private final String name;

    /**
     * Creates a new ResourceFlavour with the given name
     * @param name The name of the ResourceFlavour
     */
    public ResourceFlavour(final String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return name;
    }

    /**
     * @return A set containing all the ResourceFlavour instances declared in static fields
     */
    public static Set<ResourceFlavour> allOf() {
        return new HashSet<>(Arrays.asList(
            STANDARD,
            EXPLORER,
            CATEGORIZATION,
            CUSTOM_FIELDS,
            QUERY_MANIPULATION,
            WEB_CLOUD,
            FILESYSTEM_ONSITE
        ));
    }

    /**
     * Returns a set containing all the known resource flavours, except those is the given set<commit_msg>[CCUK-3764] Add Jumbo to set of all flavours<commit_after>/*
 * Copyright 2015-2016 Hewlett-Packard Development Company, L.P.
 * Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
 */

package com.hp.autonomy.hod.client.api.resource;

import lombok.Data;

import java.io.Serializable;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

@Data
public class ResourceFlavour implements Serializable {

    private static final long serialVersionUID = -1478092510670076594L;

    /**
     * The flavour of a standard text index
     */
    public static final ResourceFlavour STANDARD = new ResourceFlavour("standard");

    /**
     * The flavour of an explorer text index
     */
    public static final ResourceFlavour EXPLORER = new ResourceFlavour("explorer");

    /**
     * The flavour of a categorization text index
     */
    public static final ResourceFlavour CATEGORIZATION = new ResourceFlavour("categorization");

    /**
     * The flavour of a custom fields text index
     */
    public static final ResourceFlavour CUSTOM_FIELDS = new ResourceFlavour("custom_fields");

    /**
     * The flavour of a query manipulation text index
     */
    public static final ResourceFlavour QUERY_MANIPULATION = new ResourceFlavour("querymanipulation");

    /**
     * The flavour of a web cloud connector
     */
    public static final ResourceFlavour WEB_CLOUD = new ResourceFlavour("web_cloud");

    /**
     * The flavour of an on site filesystem connector
     */
    public static final ResourceFlavour FILESYSTEM_ONSITE = new ResourceFlavour("filesystem_onsite");

    public static final ResourceFlavour JUMBO = new ResourceFlavour("jumbo");

    private final String name;

    /**
     * Creates a new ResourceFlavour with the given name
     * @param name The name of the ResourceFlavour
     */
    public ResourceFlavour(final String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return name;
    }

    /**
     * @return A set containing all the ResourceFlavour instances declared in static fields
     */
    public static Set<ResourceFlavour> allOf() {
        return new HashSet<>(Arrays.asList(
            STANDARD,
            EXPLORER,
            CATEGORIZATION,
            CUSTOM_FIELDS,
            QUERY_MANIPULATION,
            JUMBO,
            WEB_CLOUD,
            FILESYSTEM_ONSITE
        ));
    }

    /**
     * Returns a set containing all the known resource flavours, except those is the given set
{'fraction_non_alphanumeric': 0.07520564042303172, 'fraction_numerical': 0.01135918527222875, 'mean_word_length': 2.7551470588235296, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '681356', 'n_tokens_mistral': 1505, 'n_tokens_neox': 1374, 'n_words': 467}