Example usage for com.google.common.collect ImmutableSet copyOf

List of usage examples for com.google.common.collect ImmutableSet copyOf

Introduction

In this page you can find the example usage for com.google.common.collect ImmutableSet copyOf.

Prototype

public static <E> ImmutableSet<E> copyOf(Iterator<? extends E> elements) 

Source Link

Usage

From source file:com.facebook.presto.sql.tree.SimpleGroupBy.java

@Override
public Set<Set<Expression>> enumerateGroupingSets() {
    return ImmutableSet.of(ImmutableSet.copyOf(columns));
}

From source file:de.uniulm.omi.cloudiator.sword.domain.SecurityGroupImpl.java

@Override
public Set<SecurityGroupRule> rules() {
    return ImmutableSet.copyOf(securityGroupRules);
}

From source file:com.torodb.torod.core.language.querycriteria.ContainsAttributesQueryCriteria.java

public ContainsAttributesQueryCriteria(AttributeReference attributeReference, Iterable<String> attributes,
        boolean exclusive) {
    super(attributeReference);
    this.attributes = ImmutableSet.copyOf(attributes);
    this.exclusive = exclusive;
}

From source file:com.ibm.og.object.AbstractObjectNameConsumer.java

/**
 * Constructs an instance/*from   w  ww  .  j a va  2s  .  c  o  m*/
 * 
 * @param objectManager the object manager for this instance to work with
 * @param operation the operation type this instance should work with
 * @param statusCodes the status codes this instance should work with
 * @throws IllegalArgumentException if any status code in status codes is invalid
 */
public AbstractObjectNameConsumer(final ObjectManager objectManager, final Operation operation,
        final Set<Integer> statusCodes) {
    this.objectManager = checkNotNull(objectManager);
    this.operation = checkNotNull(operation);
    this.statusCodes = ImmutableSet.copyOf(statusCodes);
    checkArgument(!this.statusCodes.isEmpty(), "statusCodes must not be empty");
    for (final int statusCode : this.statusCodes) {
        checkArgument(HttpUtil.VALID_STATUS_CODES.contains(statusCode),
                "all statusCodes in list must be valid status codes [%s]", statusCode);
    }
}

From source file:org.jclouds.openstack.nova.ec2.xml.NovaDescribeImagesResponseHandler.java

public Set<Image> getResult() {
    return ImmutableSet.copyOf(Iterables.filter(contents, new Predicate<Image>() {
        @Override/* w w w . java2 s .c om*/
        public boolean apply(Image image) {
            return image.getImageType() == ImageType.MACHINE;
        }
    }));
}

From source file:google.registry.tools.server.ListRegistrarsAction.java

@Override
public ImmutableSet<Registrar> loadObjects() {
    return ImmutableSet.copyOf(Registrar.loadAll());
}

From source file:adept.common.ScriptVariable.java

private ScriptVariable(Iterable<? extends IType> types) {
    this.types = ImmutableSet.copyOf(types);
}

From source file:com.google.api.codegen.gapic.StaticResourcesGenerator.java

public StaticResourcesGenerator(Map<String, String> staticFiles, Set<String> executableFilenames) {
    if (!staticFiles.values().containsAll(executableFilenames)) {
        throw new IllegalArgumentException("executableFilenames contains a filename not found in staticFiles");
    }//from  w  w  w .j av a 2s .c o  m
    this.resourcesExtractor = new StaticResourcesHandler(staticFiles);
    this.executableFilenames = ImmutableSet.copyOf(executableFilenames);
}

From source file:com.tngtech.archunit.core.importer.resolvers.SelectedClassResolverFromClasspath.java

@PublicAPI(usage = ACCESS)
public SelectedClassResolverFromClasspath(List<String> packageRoots) {
    this.packageRoots = ImmutableSet.copyOf(packageRoots);
}

From source file:com.google.gxp.compiler.schema.AttributeElement.java

AttributeElement(String name, String contentType, Pattern pattern, Set<AttributeValidator.Flag> flags,
        Set<AttributeHook> hooks, String defaultValue, Set<String> elementNames,
        Set<String> exceptElementNames) {
    this.attrValidator = new AttributeValidator(name, contentType, pattern, flags, hooks, defaultValue);
    this.contentType = contentType;
    this.elementNames = ImmutableSet.copyOf(elementNames);
    this.exceptElementNames = ImmutableSet.copyOf(exceptElementNames);
}