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.google.api.auth.UserInfo.java
/** * Constructor./*from w w w.j av a 2 s . c om*/ * @param audiences the available audiences * @param email the user's email address * @param id the user's' id * @param issuer the issuer */ public UserInfo(Collection<String> audiences, String email, String id, String issuer) { Preconditions.checkNotNull(audiences); Preconditions.checkNotNull(email); Preconditions.checkNotNull(id); Preconditions.checkNotNull(issuer); this.audiences = ImmutableSet.copyOf(audiences); this.email = email; this.id = id; this.issuer = issuer; }
From source file:org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact.ArtifactBackedResolvedVariant.java
private ArtifactBackedResolvedVariant(AttributeContainerInternal attributes, Collection<? extends ResolvedArtifact> artifacts) { this.attributes = attributes; this.artifacts = ImmutableSet.copyOf(artifacts); }
From source file:co.cask.cdap.cli.command.metadata.AddMetadataTagsCommand.java
@Override public void perform(Arguments arguments, PrintStream output) throws Exception { EntityId entity = EntityId.fromString(arguments.get(ArgumentName.ENTITY.toString())); Set<String> tags = ImmutableSet.copyOf(parseList(arguments.get("tags"))); client.addTags(entity.toId(), tags); output.println("Successfully added metadata tags"); }
From source file:com.github.nyrkovalex.deploy.me.scp.ScpTemplate.java
public ScpTemplate(String server, String user, Iterable<ScpFile> scripts) { this.server = server; this.user = user; this.scripts = ImmutableSet.copyOf(scripts); }
From source file:org.trustedanalytics.cloud.cc.api.customizations.FeignErrorDecoderHandler.java
public FeignErrorDecoderHandler(String... fieldPaths) { this.fieldPaths = ImmutableSet.copyOf(fieldPaths); }
From source file:com.gradleware.tooling.testing.ReleasedGradleVersions.java
/** * Creates a new instances from a properties file called <i>all-released-versions.properties</i> that is expected to be on the classpath. The properties file must have the * comma-separated version strings listed under the property key named <i>versions</i>. * * @return the new instance/*from ww w . j ava 2s . c o m*/ */ public static ReleasedGradleVersions create() { Properties properties = loadFromPropertiesFile(RELEASED_GRADLE_VERSIONS_PROPERTIES_FILENAME); String[] versionStrings = getProperty(properties).split("\\s+"); return createFrom(ImmutableSet.copyOf(versionStrings)); }
From source file:com.wrmsr.wava.java.lang.tree.declaration.JMethod.java
public JMethod(Set<JAccess> access, JTypeSpecifier type, JName name, List<JArg> args, Optional<JBlock> body) { this.access = ImmutableSet.copyOf(access); this.type = requireNonNull(type); this.name = requireNonNull(name); this.args = ImmutableList.copyOf(args); this.body = requireNonNull(body); }
From source file:com.facebook.buck.core.rules.common.RecordArtifactVerifier.java
public RecordArtifactVerifier(Collection<Path> allowedPaths, BuildableContext context) { this.allowedPaths = ImmutableSet.copyOf(allowedPaths); allowedPaths.forEach(context::recordArtifact); }
From source file:org.ow2.proactive.scheduler.common.job.factories.spi.model.validator.ListValidator.java
public ListValidator(ImmutableList<String> items) { if (ImmutableSet.copyOf(items).size() < items.size()) { throw new IllegalArgumentException("Duplicate value in list : " + items); }/*from ww w . java 2s .c om*/ this.listItems = items; }
From source file:ru.rulex.conclusion.AbstractIterablePhrases.java
public void setWithout(ImmutableSet<T> excepts) { this.excepts = ImmutableSet.copyOf(excepts); }