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.facebook.buck.cli.CommandHelper.java
public static void printJSON(CommandRunnerParams params, Set<QueryTarget> targets) throws IOException { Set<String> targetsNames = ImmutableSet .copyOf(Collections2.transform(targets, input -> Preconditions.checkNotNull(input.toString()))); params.getObjectMapper().writeValue(params.getConsole().getStdOut(), targetsNames); }
From source file:com.axemblr.service.cm.models.hosts.HostList.java
@JsonCreator public HostList(@JsonProperty("items") Set<Host> items) { this.items = (items == null) ? ImmutableSet.<Host>of() : ImmutableSet.copyOf(items); }
From source file:de.metas.ui.web.dashboard.json.JsonKPI.java
public static final JsonKPI of(final KPI kpi, final JSONOptions jsonOpts) { return JsonKPI.builder().kpiId(kpi.getId()).caption(kpi.getCaption(jsonOpts.getAD_Language())) .chartType(kpi.getChartType()).widgetTypes(ImmutableSet.copyOf(kpi.getSupportedWidgetTypes())) .build();//from w ww .jav a2s .c om }
From source file:com.google.auto.factory.processor.Elements2.java
static ImmutableSet<ExecutableElement> getConstructors(TypeElement type) { checkNotNull(type);/*from w w w . jav a2 s.c om*/ checkArgument(type.getKind() == CLASS); return ImmutableSet.copyOf(ElementFilter.constructorsIn(type.getEnclosedElements())); }
From source file:ninja.leaping.permissionsex.util.Combinations.java
public static <T> Combinations<T> of(Set<T> items) { return new Combinations<>(ImmutableSet.copyOf(items)); }
From source file:org.apache.james.mpt.api.ImapFeatures.java
public static ImapFeatures of(Feature... features) { return new ImapFeatures(ImmutableSet.copyOf(features)); }
From source file:com.opower.rest.client.generator.plugins.providers.Builtin.java
public static Collection<Object> providerInstances() { if (PROVIDERS == null) { synchronized (Builtin.class) { if (PROVIDERS == null) { PROVIDERS = init();/* w ww.ja va 2 s . c om*/ } } } return ImmutableSet.copyOf(PROVIDERS.values()); }
From source file:org.jclouds.packet.domain.OperatingSystem.java
@SerializedNames({ "id", "slug", "name", "distro", "version", "provisionable_on" }) public static OperatingSystem create(String id, String slug, String name, String distribution, String version, Set<String> provisionableOn) { return new AutoValue_OperatingSystem(id, slug, name, distribution, version, provisionableOn == null ? ImmutableSet.<String>of() : ImmutableSet.copyOf(provisionableOn)); }
From source file:org.apollo.game.command.CreditsCommandListener.java
/** * Creates the CreditsCommandListener./*from ww w . j a va2 s . com*/ * * @param authors The {@link Set} of authors. */ public CreditsCommandListener(Set<String> authors) { this.authors = ImmutableSet.copyOf(authors); }
From source file:com.pingcap.tikv.TiConfiguration.java
public static TiConfiguration createDefault(List<String> pdAddrs) { TiConfiguration conf = new TiConfiguration(); conf.pdAddrs = ImmutableList.copyOf(Iterables.transform(ImmutableSet.copyOf(pdAddrs).asList(), addStr -> HostAndPort.fromString(addStr))); return conf;// w w w . j av a2 s. c o m }