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.onosproject.net.mcast.McastRouteInfo.java
public static McastRouteInfo mcastRouteInfo(McastRoute route, Set<ConnectPoint> sinks, ConnectPoint source) { return new McastRouteInfo(route, null, source, ImmutableSet.copyOf(sinks)); }
From source file:io.prestosql.metadata.AllNodes.java
public AllNodes(Set<Node> activeNodes, Set<Node> inactiveNodes, Set<Node> shuttingDownNodes, Set<Node> activeCoordinators) { this.activeNodes = ImmutableSet.copyOf(requireNonNull(activeNodes, "activeNodes is null")); this.inactiveNodes = ImmutableSet.copyOf(requireNonNull(inactiveNodes, "inactiveNodes is null")); this.shuttingDownNodes = ImmutableSet .copyOf(requireNonNull(shuttingDownNodes, "shuttingDownNodes is null")); this.activeCoordinators = ImmutableSet .copyOf(requireNonNull(activeCoordinators, "activeCoordinators is null")); }
From source file:edu.oregonstate.eecs.mcplan.ActionSet.java
public static <S, A> ActionSet<S, A> constant(final Iterable<A> as) { return new UnionActionSet<>(ImmutableSet.copyOf(as)); }
From source file:com.github.jcustenborder.kafka.connect.utils.config.validators.ValidCharset.java
public ValidCharset() { this(ImmutableSet.copyOf(Charset.availableCharsets().keySet())); }
From source file:net.derquinse.common.collect.FlatImmutableHierarchy.java
FlatImmutableHierarchy(Iterable<? extends E> elements) { set = ImmutableSet.copyOf(elements); }
From source file:org.trancecode.xml.saxon.SaxonAxis.java
public static XdmNode childElement(final XdmNode node, final QName... elementNames) { return childElement(node, ImmutableSet.copyOf(elementNames)); }
From source file:me.emily.irc.event.events.QuitEvent.java
public QuitEvent(ServerConnection connection, User user, String message) { super();// www. j a v a 2s . c om this.connection = connection; this.channels = ImmutableSet.copyOf(user.getChannels()); this.user = user; this.message = message; }
From source file:co.cask.cdap.etl.spec.StageConnections.java
public StageConnections(ETLStage stage, Collection<String> inputs, Collection<String> outputs) { this.stage = stage; this.inputs = ImmutableSet.copyOf(inputs); this.outputs = ImmutableSet.copyOf(outputs); }
From source file:org.eclipse.xtext.xtext.ParameterConfigHelper.java
public static int getParameterConfig(Set<Parameter> params, ParserRule context) { if (params.isEmpty()) { return 0; }//from ww w . j a v a 2 s . co m Set<Parameter> allParameters = ImmutableSet.copyOf(context.getParameters()); int result = 0; for (Set<Parameter> candidate : Sets.powerSet(allParameters)) { if (params.equals(candidate)) { return result; } result++; } throw new IllegalStateException(); }
From source file:org.jclouds.openstack.nova.v1_1.util.NovaUtils.java
/** * @see #toOldSchool/*from w ww. java2 s . c o m*/ */ @Deprecated public static <K, V> ImmutableMultimap<K, V> fromOldSchool(Map<K, Set<V>> in) { Builder<K, V> out = ImmutableMultimap.<K, V>builder(); for (K type : in.keySet()) out.putAll(type, ImmutableSet.copyOf(in.get(type))); return out.build(); }