List of usage examples for com.google.common.collect ImmutableSet copyOf
public static <E> ImmutableSet<E> copyOf(Iterator<? extends E> elements)
From source file:org.obiba.opal.web.magma.view.ViewDtos.java
@Autowired public void setExtensions(Collection<ViewDtoExtension> extensions) { this.extensions = ImmutableSet.copyOf(extensions); }
From source file:adept.common.DocumentMentalState.java
protected DocumentMentalState(ImmutableSet<T> provenances, ImmutableSet<DocumentMentalStateArgument> arguments, float confidence, MentalStateType type) { this.provenances = ImmutableSet.copyOf(provenances); this.arguments = ImmutableSet.copyOf(arguments); this.type = type; // no null check because it's optional this.confidence = confidence; }
From source file:com.proofpoint.jaxrs.TheServletParametersProvider.java
@Inject(optional = true) public void setResourceFilterFactories(Set<ResourceFilterFactory> resourceFilterFactorySet) { this.resourceFilterFactorySet = ImmutableSet.copyOf(resourceFilterFactorySet); }
From source file:com.android.build.gradle.internal.pipeline.QualifiedContentImpl.java
protected QualifiedContentImpl(@NonNull String name, @NonNull File file, @NonNull Set<ContentType> contentTypes, @NonNull Set<Scope> scopes) { this.name = name; this.file = file; this.contentTypes = ImmutableSet.copyOf(contentTypes); this.scopes = ImmutableSet.copyOf(scopes); }
From source file:org.onosproject.cluster.DefaultPartition.java
/** * Constructs a partition.//from w w w . j ava2 s . c o m * * @param id partition identifier * @param members partition member nodes */ public DefaultPartition(PartitionId id, Collection<NodeId> members) { this.id = checkNotNull(id); this.members = ImmutableSet.copyOf(members); }
From source file:net.derquinse.common.collect.RegularImmutableHierarchy.java
RegularImmutableHierarchy(ImmutableHierarchy.Builder<E> builder) { this.elements = ImmutableSet.copyOf(builder.getElements()); this.firstLevel = ImmutableList.copyOf(builder.getFirstLevel()); this.parents = ImmutableMap.copyOf(builder.getParents()); this.children = ImmutableListMultimap.copyOf(builder.getChildren()); // Incomplete integrity check checkArgument(elements.size() == firstLevel.size() + children.size(), "Inconsistent hierarchy."); }
From source file:org.gradle.cache.internal.btree.CachingBlockStore.java
public CachingBlockStore(BlockStore store, Collection<Class<? extends BlockPayload>> cacheableBlockTypes) { this.store = store; this.cacheableBlockTypes = ImmutableSet.copyOf(cacheableBlockTypes); }
From source file:org.sonar.server.computation.measure.api.MeasureComputerDefinitionImpl.java
private MeasureComputerDefinitionImpl(BuilderImpl builder) { this.inputMetricKeys = ImmutableSet.copyOf(builder.inputMetricKeys); this.outputMetrics = ImmutableSet.copyOf(builder.outputMetrics); }
From source file:org.onlab.stc.Group.java
/** * Returns the set of child steps and groups contained within this group. * * @return set of children/*from ww w .j a v a2s. c o m*/ */ public Set<Step> children() { return ImmutableSet.copyOf(children); }
From source file:io.wcm.config.spi.helpers.AbstractParameterProvider.java
/** * Get all parameters defined as public static fields in the given type. * @param type Type//from w ww .ja v a 2 s.co m * @return Set of parameters */ private static Set<Parameter<?>> getParametersFromPublicFields(Class<?> type) { Set<Parameter<?>> params = new HashSet<>(); try { Field[] fields = type.getFields(); for (Field field : fields) { if (field.getType().isAssignableFrom(Parameter.class)) { params.add((Parameter<?>) field.get(null)); } } } catch (IllegalArgumentException | IllegalAccessException ex) { throw new RuntimeException("Unable to access fields of " + type.getName(), ex); } return ImmutableSet.copyOf(params); }