Example usage for com.google.common.collect Sets immutableEnumSet

List of usage examples for com.google.common.collect Sets immutableEnumSet

Introduction

In this page you can find the example usage for com.google.common.collect Sets immutableEnumSet.

Prototype


@GwtCompatible(serializable = true)
public static <E extends Enum<E>> ImmutableSet<E> immutableEnumSet(Iterable<E> elements) 

Source Link

Document

Returns an immutable set instance containing the given enum elements.

Usage

From source file:com.android.build.gradle.internal.transforms.MultiStreamJarTransform.java

@NonNull
@Override
public Set<ScopedContent.ContentType> getInputTypes() {
    return Sets.immutableEnumSet(ScopedContent.ContentType.CLASSES);
}

From source file:edu.mit.streamjit.util.bytecode.Field.java

public Field(java.lang.reflect.Field f, Klass parent, Module module) {
    super(module.types().getFieldType(f), f.getName());
    //parent is set by our parent adding us to its list prior to making it
    //unmodifiable.  (We can't add ourselves and have the list wrapped
    //unmodifiable later because it's stored in a final field.)
    this.modifiers = Sets.immutableEnumSet(Modifier.fromFieldBits(Shorts.checkedCast(f.getModifiers())));
}

From source file:org.obm.sync.calendar.RecurrenceDays.java

public RecurrenceDays(RecurrenceDay... recurrenceDays) {
    if (recurrenceDays == null) {
        value = ImmutableSet.of();/* www.  j  a  va2 s .  c  o  m*/
    } else {
        value = Sets.immutableEnumSet(Arrays.asList(recurrenceDays));
    }
}

From source file:com.android.build.gradle.internal.transforms.MultiStreamJarTransform.java

@NonNull
@Override
public Set<ScopedContent.Scope> getScopes() {
    return Sets.immutableEnumSet(ScopedContent.Scope.PROJECT_LOCAL_DEPS);
}

From source file:org.caleydo.view.tourguide.internal.adapter.StratificationDataMode.java

protected ADataDomainQuery createFor(IDataDomain dd) {
    if (!DataSupportDefinitions.homogenousTables.apply(dd))
        return new InhomogenousDataDomainQuery((ATableBasedDataDomain) dd,
                Sets.immutableEnumSet(EDataClass.CATEGORICAL));
    if (DataSupportDefinitions.categoricalTables.apply(dd))
        return new CategoricalDataDomainQuery((ATableBasedDataDomain) dd, EDimension.DIMENSION);
    return new StratificationDataDomainQuery((ATableBasedDataDomain) dd, EDimension.RECORD);
}

From source file:com.linecorp.armeria.server.http.dynamic.DynamicHttpServiceBuilder.java

/**
 * Adds a new dynamic-mapped method, invoked with given {@link HttpMethod}s and (dynamically-bound) path,
 * runs synchronously.//w w w  .ja  v  a2 s. c om
 */
public DynamicHttpServiceBuilder addMapping(Iterable<HttpMethod> methods, String path,
        DynamicHttpFunction function) {
    DynamicHttpFunction f = DynamicHttpFunctions.of(function, converters);
    DynamicHttpFunctionEntry entry = new DynamicHttpFunctionEntry(Sets.immutableEnumSet(methods),
            DynamicPath.of(path), f);
    validate(entry);
    entries.add(entry);
    return this;
}

From source file:org.trnltk.morphology.contextless.rootfinder.ProperNounFromApostropheRootFinder.java

@Override
public List<? extends Root> findRootsForPartialInput(TurkishSequence partialInput, TurkishSequence input) {
    final TurkishSequence properNounCandidate = partialInput.subsequence(0, partialInput.length() - 1);

    final String properNounCandidateUnderlyingString = properNounCandidate.getUnderlyingString();

    if (StringUtils.isAllUpperCase(properNounCandidateUnderlyingString)) {
        final Lexeme lexeme = new ImmutableLexeme(properNounCandidateUnderlyingString,
                properNounCandidateUnderlyingString, PrimaryPos.Noun, SecondaryPos.Abbreviation, null);

        if (!properNounCandidate.getLastChar().getLetter().isVowel()) {
            // if last letter is not vowel (such as PTT, THY), then add char 'E' to the end and then calculate the phonetics
            final ImmutableSet<PhoneticAttribute> phoneticAttributes = Sets.immutableEnumSet(phoneticsAnalyzer
                    .calculatePhoneticAttributes(properNounCandidate.append(TURKISH_CHAR_E_UPPERCASE), null));
            return Arrays.asList(new ImmutableRoot(properNounCandidate, lexeme, phoneticAttributes, null));

        } else {/*from   w w w .  ja v a2s.  c o  m*/
            final ImmutableSet<PhoneticAttribute> phoneticAttributes = Sets
                    .immutableEnumSet(phoneticsAnalyzer.calculatePhoneticAttributes(properNounCandidate, null));
            return Arrays.asList(new ImmutableRoot(properNounCandidate, lexeme, phoneticAttributes, null));
        }
    } else {
        final Lexeme lexeme = new ImmutableLexeme(properNounCandidateUnderlyingString,
                properNounCandidateUnderlyingString, PrimaryPos.Noun, SecondaryPos.ProperNoun, null);

        final ImmutableSet<PhoneticAttribute> phoneticAttributes = Sets
                .immutableEnumSet(phoneticsAnalyzer.calculatePhoneticAttributes(properNounCandidate, null));
        return Arrays.asList(new ImmutableRoot(properNounCandidate, lexeme, phoneticAttributes, null));
    }
}

From source file:org.obm.sync.calendar.RecurrenceDays.java

public RecurrenceDays(Collection<RecurrenceDay> recurrenceDays) {
    if (recurrenceDays == null) {
        value = ImmutableSet.of();//from w  w  w.j  a  va2 s .  c om
    } else {
        value = Sets.immutableEnumSet(recurrenceDays);
    }
}

From source file:org.trnltk.morphology.morphotactics.PrecachingSuffixFormSequenceApplier.java

private void initialize() {
    final Collection<Suffix> allSuffixes = suffixGraph.getAllSuffixes();
    final Set<Set<PhoneticAttribute>> modifierAttributesPowerSet = Sets.powerSet(MODIFIER_ATTRIBUTES);

    int expectedRowCount = allSuffixes.size();
    int expectedColumnCount = modifierAttributesPowerSet.size();
    this.suffixFormSequenceTable = HashBasedTable.create(expectedRowCount, expectedColumnCount);

    for (Suffix suffix : allSuffixes) {
        final Set<SuffixForm> suffixForms = suffix.getSuffixForms();
        for (SuffixForm suffixForm : suffixForms) {
            final SuffixFormSequence suffixFormSequence = suffixForm.getForm();
            for (Set<PhoneticAttribute> phoneticAttributes : modifierAttributesPowerSet) {
                final ImmutableSet<PhoneticAttribute> phoneticAttributeImmutableSet = Sets
                        .immutableEnumSet(phoneticAttributes);
                final String appliedSuffixFormStr = this.delegate.apply(suffixFormSequence,
                        phoneticAttributeImmutableSet);
                this.suffixFormSequenceTable.put(suffixFormSequence, phoneticAttributeImmutableSet,
                        appliedSuffixFormStr);
            }/* ww  w  . j  a v a  2s  . c  o m*/
        }
    }

}

From source file:com.android.build.gradle.internal.transforms.ProguardConfigurable.java

@NonNull
@Override//ww w.java2s  .c  o  m
public Set<Scope> getReferencedScopes() {
    Set<Scope> set = Sets.newHashSetWithExpectedSize(5);
    if (variantType == VariantType.LIBRARY) {
        set.add(Scope.SUB_PROJECTS);
        set.add(Scope.SUB_PROJECTS_LOCAL_DEPS);
        set.add(Scope.EXTERNAL_LIBRARIES);
    }

    if (variantType.isForTesting()) {
        set.add(Scope.TESTED_CODE);
    }

    set.add(Scope.PROVIDED_ONLY);

    return Sets.immutableEnumSet(set);
}