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:org.jclouds.openstack.poppy.v1.domain.Flavor.java

@SerializedNames({ "id", "providers", "links" })
private static Flavor create(String id, List<Provider> providers, Set<Link> links) {
    return new AutoValue_Flavor(id, ImmutableList.copyOf(providers), ImmutableSet.copyOf(links));
}

From source file:dagger.internal.codegen.BindingNode.java

static BindingNode create(ComponentPath component, Binding delegate,
        Iterable<BindingDeclaration> associatedDeclarations, Supplier<String> toStringFunction) {
    BindingNode node = new AutoValue_BindingNode(component, delegate,
            ImmutableSet.copyOf(associatedDeclarations));
    node.toStringFunction = checkNotNull(toStringFunction);
    return node;/*from w w w .j a  v a2s.c  o  m*/
}

From source file:com.github.richardballard.arbeeutils.id.ByIdSpecifiers.java

/**
 * @return an instance that excludes only the specified ids
 *//*  w  w  w  . j  ava 2 s  .  c o m*/
public static @NotNull <T> ByIdSpecifier<T> excludeOnly(final @NotNull Iterable<? extends T> exclusions) {

    return new AllBasedByIdSpecifier<>(ImmutableSet.copyOf(exclusions));
}

From source file:at.yawk.felix.module.AnnotatedPropertyDiscoveryStrategy.java

private static ModuleProperties toProperties(AnnotatedModule annotation) {
    return ModuleProperties.create(ImmutableSet.copyOf(annotation.dependencies()),
            ImmutableSet.copyOf(annotation.excludedFromRegistration()),
            ImmutableSet.copyOf(annotation.softDependencies()));
}

From source file:ezbake.amino.cli.commands.CreateGroup.java

public static Set<TGroupMember> parseGroupMembers(Collection<String> groupMembers) {
    return ImmutableSet.copyOf(Collections2.transform(groupMembers, new Function<String, TGroupMember>() {
        @Override//www.j  av  a 2 s.  c om
        public TGroupMember apply(String member) {
            String[] memberAndRole = member.split(":");
            String name = memberAndRole[0];

            Set<TGroupRole> roles = ImmutableSet.copyOf(Iterables
                    .transform(Splitter.on(',').split(memberAndRole[1]), new Function<String, TGroupRole>() {
                        @Override
                        public TGroupRole apply(String name) {
                            return TGroupRole.valueOf(name);
                        }
                    }));
            return new TGroupMember(name, roles);
        }
    }));
}

From source file:com.axemblr.service.cm.models.cm.RoleNameList.java

@JsonCreator
public RoleNameList(@JsonProperty("items") Set<String> items) {
    this.items = (items == null) ? ImmutableSet.<String>of() : ImmutableSet.copyOf(items);
}

From source file:org.eclipse.xtext.conversion.impl.IDValueConverter.java

@Override
protected Set<String> computeValuesToEscape(Grammar grammar) {
    return ImmutableSet.copyOf(GrammarUtil.getAllKeywords(grammar));
}

From source file:com.facebook.presto.metadata.AllNodes.java

public AllNodes(Set<Node> activeNodes, Set<Node> inactiveNodes) {
    this.activeNodes = ImmutableSet.copyOf(requireNonNull(activeNodes, "activeNodes is null"));
    this.inactiveNodes = ImmutableSet.copyOf(requireNonNull(inactiveNodes, "inactiveNodes is null"));
}

From source file:org.raml.jaxrs.parser.model.JerseyJaxRsApplication.java

private static JerseyJaxRsApplication create(Iterable<JaxRsResource> resources,
        Set<JaxRsSupportedAnnotation> supportedAnnotations) {
    checkNotNull(resources);//from   ww w . java 2s.  c o  m

    return new JerseyJaxRsApplication(ImmutableSet.copyOf(resources), supportedAnnotations);
}

From source file:org.opendaylight.controller.cluster.datastore.config.ShardConfig.java

public ShardConfig(@Nonnull final String name, @Nonnull final Collection<MemberName> replicas) {
    this.name = Preconditions.checkNotNull(name);
    this.replicas = ImmutableSet.copyOf(Preconditions.checkNotNull(replicas));
}