List of usage examples for com.google.common.collect ImmutableSet copyOf
public static <E> ImmutableSet<E> copyOf(Iterator<? extends E> elements)
From source file:com.spotify.heroic.common.Groups.java
public Groups or(String... defaultGroups) { if (defaultGroups.length == 0) { throw new IllegalArgumentException("Set of default groups must not be empty"); }// ww w . ja v a2 s . co m if (!groups.isEmpty()) { return this; } return new Groups(ImmutableSet.copyOf(defaultGroups)); }
From source file:org.apache.provisionr.api.network.Network.java
Network(String type, Set<Rule> ingress, Map<String, String> options) { super(options); this.type = checkNotNull(type, "type is null"); this.ingress = ImmutableSet.copyOf(ingress); }
From source file:com.spotify.heroic.metric.ResultLimits.java
public ResultLimits join(final ResultLimits other) { return new ResultLimits(ImmutableSet.copyOf(Iterables.concat(limits, other.limits))); }
From source file:org.raml.jaxrs.parser.analyzers.JerseyAnalyzer.java
static JerseyAnalyzer create(Iterable<Class<?>> classes, JerseyBridge jerseyBridge, SourceParser sourceParser, Set<JaxRsSupportedAnnotation> supportedAnnotations) { checkNotNull(classes);//from www . j ava2 s.co m checkNotNull(jerseyBridge); checkNotNull(sourceParser); return new JerseyAnalyzer(ImmutableSet.copyOf(classes), jerseyBridge, sourceParser, supportedAnnotations); }
From source file:com.github.nyrkovalex.deploy.me.descriptor.Script.java
public Script(String source, Iterable<String> targets) { this.source = source; this.targets = ImmutableSet.copyOf(targets); }
From source file:org.eclipse.sirius.ext.base.relations.TransitiveClosure.java
@Override public Set<T> apply(T from) { Preconditions.checkNotNull(from);/*from w ww . j a v a 2s . c om*/ Set<T> result = Sets.newHashSet(relation.apply(from)); Set<T> startingPoints = ImmutableSet.copyOf(result); while (!startingPoints.isEmpty()) { Set<T> newDependencies = Sets.newHashSet(); for (T startPoint : startingPoints) { newDependencies.addAll(relation.apply(startPoint)); } newDependencies.removeAll(result); result.addAll(newDependencies); startingPoints = newDependencies; } return Collections.unmodifiableSet(result); }
From source file:com.cognifide.aet.communication.api.metadata.ValidatorException.java
public Set<ConstraintViolation> getIssues() { return ImmutableSet.copyOf(issues); }
From source file:com.facebook.presto.TaskSource.java
@JsonCreator public TaskSource(@JsonProperty("planNodeId") PlanNodeId planNodeId, @JsonProperty("splits") Set<ScheduledSplit> splits, @JsonProperty("noMoreSplits") boolean noMoreSplits) { this.planNodeId = requireNonNull(planNodeId, "planNodeId is null"); this.splits = ImmutableSet.copyOf(requireNonNull(splits, "splits is null")); this.noMoreSplits = noMoreSplits; }
From source file:com.vsct.dt.hesperides.templating.modules.ModuleCreatedEvent.java
@JsonCreator public ModuleCreatedEvent(@JsonProperty("moduleCreated") final Module moduleCreated, @JsonProperty("templates") final Set<Template> templates) { this.moduleCreated = moduleCreated; this.templates = ImmutableSet.copyOf(templates); }
From source file:org.apache.aurora.scheduler.storage.mem.MemLockStore.java
@Override public Set<ILock> fetchLocks() { return ImmutableSet.copyOf(locks.values()); }