com.google.common.collect.ImmutableSet.copyOf()

Here are the examples of the java api com.google.common.collect.ImmutableSet.copyOf() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

977 Examples 7

19 Source : DexBuilder.java
with GNU General Public License v3.0
from yuanxzhang

@Nonnull
Set<? extends BuilderAnnotationElement> internAnnotationElements(@Nonnull Set<? extends AnnotationElement> elements) {
    return ImmutableSet.copyOf(Iterators.transform(elements.iterator(), new Function<AnnotationElement, BuilderAnnotationElement>() {

        @Nullable
        @Override
        public BuilderAnnotationElement apply(AnnotationElement input) {
            return internAnnotationElement(input);
        }
    }));
}

19 Source : BaseEntity.java
with MIT License
from voxelwind

@Override
public Set<Clreplaced<? extends Component>> providedComponents() {
    // By default, enreplacedies don't provide any components.
    return ImmutableSet.copyOf(componentMap.keySet());
}

19 Source : MsSqlQueryBuilderTest.java
with Apache License 2.0
from VenuMeda

TableMetadataProvider.TableMetadata tableMetadata(Map<String, Schema> schemas, String... keyColumns) {
    TableMetadataProvider.TableMetadata tableMetadata = mock(TableMetadataProvider.TableMetadata.clreplaced);
    when(tableMetadata.keyColumns()).thenReturn(ImmutableSet.copyOf(keyColumns));
    when(tableMetadata.tableName()).thenReturn("users");
    when(tableMetadata.schemaName()).thenReturn("dbo");
    when(tableMetadata.databaseName()).thenReturn("testing");
    when(tableMetadata.columnSchemas()).thenReturn(schemas);
    return tableMetadata;
}

19 Source : BasicQuestionAnswerPair.java
with Apache License 2.0
from uwnlp

// TODO: store the immutable sets as fields
public ImmutableSet<ResolvedDependency> getQuestionDependencies() {
    return ImmutableSet.copyOf(questionDeps);
}

19 Source : BasicQuestionAnswerPair.java
with Apache License 2.0
from uwnlp

public ImmutableSet<ResolvedDependency> getAnswerDependencies() {
    return ImmutableSet.copyOf(answerDeps);
}

19 Source : RLTunedKNNSetup.java
with GNU General Public License v3.0
from uea-machine-learning

public Set<EnhancedAbstractClreplacedifier> getImproveableBenchmarks() {
    return ImmutableSet.copyOf(improveableBenchmarks);
}

19 Source : RLTunedKNNSetup.java
with GNU General Public License v3.0
from uea-machine-learning

public Set<EnhancedAbstractClreplacedifier> getUnimproveableBenchmarks() {
    return ImmutableSet.copyOf(unimproveableBenchmarks);
}

19 Source : RLTunedKNNSetup.java
with GNU General Public License v3.0
from uea-machine-learning

public Set<EnhancedAbstractClreplacedifier> getNextImproveableBenchmarks() {
    return ImmutableSet.copyOf(nextImproveableBenchmarks);
}

19 Source : ThriftIndexedTpchService.java
with Apache License 2.0
from trinodb

@Override
protected ConnectorPageSource createLookupPageSource(SplitInfo splitInfo, List<String> outputColumnNames) {
    IndexedTable indexedTable = indexedData.getIndexedTable(splitInfo.getTableName(), schemaNameToScaleFactor(splitInfo.getSchemaName()), ImmutableSet.copyOf(splitInfo.getLookupColumnNames())).orElseThrow(() -> new IllegalArgumentException(format("No such index: %s%s", splitInfo.getTableName(), splitInfo.getLookupColumnNames())));
    List<Type> lookupColumnTypes = types(splitInfo.getTableName(), splitInfo.getLookupColumnNames());
    RecordSet keyRecordSet = new ListBasedRecordSet(splitInfo.getKeys(), lookupColumnTypes);
    RecordSet outputRecordSet = lookupIndexKeys(keyRecordSet, indexedTable, outputColumnNames, splitInfo.getLookupColumnNames());
    return new RecordPageSource(outputRecordSet);
}

19 Source : FeatureUnitNormalizer.java
with Apache License 2.0
from trinodb

@Override
public void train(Dataset dataset) {
    for (FeatureVector vector : dataset.getDatapoints()) {
        for (Map.Entry<Integer, Double> feature : vector.getFeatures().entrySet()) {
            int key = feature.getKey();
            double value = feature.getValue();
            if (value < mins.get(key)) {
                mins.put(key, value);
            }
            if (value > maxs.get(key)) {
                maxs.put(key, value);
            }
        }
    }
    for (int key : ImmutableSet.copyOf(mins.keySet())) {
        // Remove any features that had a constant value
        if (mins.get(key) == maxs.get(key)) {
            mins.remove(key);
            maxs.remove(key);
        }
    }
}

19 Source : InMemoryThriftMetastore.java
with Apache License 2.0
from trinodb

private static <K, V> void rewriteKeys(Map<K, V> map, Function<K, K> keyRewriter) {
    for (K key : ImmutableSet.copyOf(map.keySet())) {
        K newKey = keyRewriter.apply(key);
        if (!newKey.equals(key)) {
            map.put(newKey, map.remove(key));
        }
    }
}

19 Source : BigQueryMetadata.java
with Apache License 2.0
from trinodb

private static boolean containSameElements(Iterable<? extends ColumnHandle> first, Iterable<? extends ColumnHandle> second) {
    return ImmutableSet.copyOf(first).equals(ImmutableSet.copyOf(second));
}

19 Source : TestEqualityInference.java
with Apache License 2.0
from trinodb

private static <E> Set<E> setCopy(Iterable<E> elements) {
    return ImmutableSet.copyOf(elements);
}

19 Source : StrictSymbolsMatcher.java
with Apache License 2.0
from trinodb

public static Function<PlanNode, Set<Symbol>> actualOutputs() {
    return node -> ImmutableSet.copyOf(node.getOutputSymbols());
}

19 Source : TestApproximateCountDistinctBoolean.java
with Apache License 2.0
from trinodb

private long distinctCount(List<Boolean> inputSequence) {
    return ImmutableSet.copyOf(inputSequence).size();
}

19 Source : SymbolsExtractor.java
with Apache License 2.0
from trinodb

public static Set<Symbol> extractUnique(WindowNode.Function function) {
    return ImmutableSet.copyOf(extractAll(function));
}

19 Source : ValidateDependenciesChecker.java
with Apache License 2.0
from trinodb

private static void checkDependencies(Collection<Symbol> inputs, Collection<Symbol> required, String message, Object... parameters) {
    checkArgument(ImmutableSet.copyOf(inputs).containsAll(required), message, parameters);
}

19 Source : RelationType.java
with Apache License 2.0
from trinodb

/**
 * Gets all fields including hidden fields.
 * No replacedumptions should be made about the order of the fields returned from this method.
 * To obtain the index of a field, call indexOf.
 */
public Collection<Field> getAllFields() {
    return ImmutableSet.copyOf(allFields);
}

19 Source : QueryStateMachine.java
with Apache License 2.0
from trinodb

public void setInputs(List<Input> inputs) {
    requireNonNull(inputs, "inputs is null");
    this.inputs.set(ImmutableSet.copyOf(inputs));
}

19 Source : CraftScoreboard.java
with GNU General Public License v3.0
from tr7zw

public ImmutableSet getTeams() {
    return ImmutableSet.copyOf(Iterables.transform(this.board.getTeams(), new CraftScoreboard$2(this)));
}

19 Source : CraftScoreboard.java
with GNU General Public License v3.0
from tr7zw

public ImmutableSet getObjectives() {
    return ImmutableSet.copyOf(Iterables.transform(this.board.getObjectives(), new CraftScoreboard$1(this)));
}

19 Source : JavaTypesAssertion.java
with Apache License 2.0
from TNG

public void matchInAnyOrder(Clreplaced<?>... clreplacedes) {
    matchInAnyOrder(ImmutableSet.copyOf(clreplacedes));
}

19 Source : JavaTypesAssertion.java
with Apache License 2.0
from TNG

public JavaTypesreplacedertion contain(Clreplaced<?>... clreplacedes) {
    contain(ImmutableSet.copyOf(clreplacedes));
    return this;
}

19 Source : ConditionEventsAssertion.java
with Apache License 2.0
from TNG

public ConditionEventsreplacedertion haveOneViolationMessageContaining(String... messageParts) {
    return haveOneViolationMessageContaining(ImmutableSet.copyOf(messageParts));
}

19 Source : GivenMembersTest.java
with Apache License 2.0
from TNG

static Set<String> allCodeUnitsExcept(String... codeUnitDescriptions) {
    return Sets.difference(ALL_CODE_UNIT_DESCRIPTIONS, ImmutableSet.copyOf(codeUnitDescriptions));
}

19 Source : GivenMembersTest.java
with Apache License 2.0
from TNG

static Set<String> allMembersExcept(String... memberDescriptions) {
    return Sets.difference(ALL_MEMBER_DESCRIPTIONS, ImmutableSet.copyOf(memberDescriptions));
}

19 Source : GivenFieldsTest.java
with Apache License 2.0
from TNG

private static Set<String> allFieldsExcept(String... fieldNames) {
    return difference(ALL_FIELD_DESCRIPTIONS, ImmutableSet.copyOf(fieldNames));
}

19 Source : GivenCodeUnitsTest.java
with Apache License 2.0
from TNG

private static Set<String> allMethodsExcept(String... methodDescriptions) {
    return difference(ALL_METHOD_DESCRIPTIONS, ImmutableSet.copyOf(methodDescriptions));
}

19 Source : GivenCodeUnitsTest.java
with Apache License 2.0
from TNG

private static Set<String> allConstructorsExcept(String... constructorDescriptions) {
    return difference(ALL_CONSTRUCTOR_DESCRIPTIONS, ImmutableSet.copyOf(constructorDescriptions));
}

19 Source : GivenCodeUnitsTest.java
with Apache License 2.0
from TNG

private static Set<String> allCodeUnitsExcept(String... codeUnitDescriptions) {
    return difference(union(ALL_CONSTRUCTOR_DESCRIPTIONS, ALL_METHOD_DESCRIPTIONS), ImmutableSet.copyOf(codeUnitDescriptions));
}

19 Source : CodeUnitsShouldTest.java
with Apache License 2.0
from TNG

private static Set<String> allMethodsExcept(String... methods) {
    return Sets.difference(ALL_METHOD_DESCRIPTIONS, ImmutableSet.copyOf(methods));
}

19 Source : CodeUnitsShouldTest.java
with Apache License 2.0
from TNG

private static Set<String> allConstructorsExcept(String... constructors) {
    return Sets.difference(ALL_CONSTRUCTOR_DESCRIPTIONS, ImmutableSet.copyOf(constructors));
}

19 Source : ClassesShouldEvaluator.java
with Apache License 2.0
from TNG

private JavaClreplacedes importClreplacedes(Clreplaced<?>... clreplacedes) {
    try {
        ArchConfiguration.get().setResolveMissingDependenciesFromClreplacedPath(true);
        return new ClreplacedFileImporter().importClreplacedes(ImmutableSet.copyOf(clreplacedes));
    } finally {
        ArchConfiguration.get().reset();
    }
}

19 Source : PlantUmlDiagram.java
with Apache License 2.0
from TNG

Set<PlantUmlComponent> getAllComponents() {
    return ImmutableSet.copyOf(plantUmlComponents.getAllComponents());
}

19 Source : PlantUmlDiagram.java
with Apache License 2.0
from TNG

Set<PlantUmlComponent> getComponentsWithAlias() {
    return ImmutableSet.copyOf(plantUmlComponents.getComponentsWithAlias());
}

19 Source : Path.java
with Apache License 2.0
from TNG

Set<Edge<T, ATTACHMENT>> getSetOfEdges() {
    return ImmutableSet.copyOf(edges);
}

19 Source : ClassFileImportRecord.java
with Apache License 2.0
from TNG

Set<String> getAllSuperinterfaceNames() {
    return ImmutableSet.copyOf(interfaceNamesByOwner.values());
}

19 Source : ClassFileImportRecord.java
with Apache License 2.0
from TNG

Set<RawAccessRecord> getRawConstructorCallRecords() {
    return ImmutableSet.copyOf(rawConstructorCallRecords);
}

19 Source : ClassFileImportRecord.java
with Apache License 2.0
from TNG

Set<RawAccessRecord> getRawMethodCallRecords() {
    return ImmutableSet.copyOf(rawMethodCallRecords);
}

19 Source : ClassFileImportRecord.java
with Apache License 2.0
from TNG

Set<RawAccessRecord.ForField> getRawFieldAccessRecords() {
    return ImmutableSet.copyOf(rawFieldAccessRecords);
}

19 Source : ModEntities.java
with GNU Lesser General Public License v3.0
from TeamLapen

public static Set<EnreplacedyType<?>> getAllEnreplacedies() {
    return ImmutableSet.copyOf(ALL_ENreplacedIES);
}

19 Source : ModBlocks.java
with GNU Lesser General Public License v3.0
from TeamLapen

public static Set<Block> getAllBlocks() {
    return ImmutableSet.copyOf(ALL_BLOCKS);
}

19 Source : LocationApi.java
with MIT License
from team-catgirl

/**
 * @return your private waypoints
 */
public Set<Waypoint> privateWaypoints() {
    return ImmutableSet.copyOf(privateWaypoints.values());
}

19 Source : ClassBuilder.java
with Apache License 2.0
from t28hub

@Nonnull
protected Set<Modifier> buildModifiers() {
    return ImmutableSet.copyOf(modifiers);
}

19 Source : Message.java
with GNU General Public License v3.0
from snikket-im

public Set<ReadByMarker> getReadByMarkers() {
    return ImmutableSet.copyOf(this.readByMarkers);
}

19 Source : TokenHexUpgrade.java
with GNU General Public License v2.0
from Rails-18xx

@Override
public Set<HexUpgrade.Invalids> getInvalids() {
    return ImmutableSet.copyOf(invalids);
}

19 Source : SetState.java
with GNU General Public License v2.0
from Rails-18xx

/**
 * @return immutable view of getSet()
 */
public ImmutableSet<E> view() {
    return ImmutableSet.copyOf(getSet());
}

19 Source : SetState.java
with GNU General Public License v2.0
from Rails-18xx

/**
 * removes all elements
 */
public void clear() {
    for (E element : ImmutableSet.copyOf(getSet())) {
        remove(element);
    }
}

19 Source : PortfolioSet.java
with GNU General Public License v2.0
from Rails-18xx

public Iterator<T> iterator() {
    return ImmutableSet.copyOf(portfolio).iterator();
}

19 Source : PortfolioMap.java
with GNU General Public License v2.0
from Rails-18xx

public Iterator<T> iterator() {
    return ImmutableSet.copyOf(portfolio.values()).iterator();
}

See More Examples