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:io.airlift.discovery.Services.java

public Services(String environment, Set<Service> services) {
    Preconditions.checkNotNull(environment, "environment is null");
    Preconditions.checkNotNull(services, "services is null");

    this.environment = environment;
    this.services = ImmutableSet.copyOf(services);
}

From source file:org.nlplab.brat.configuration.BratAttributeType.java

public BratAttributeType(String name, String... values) {
    super(name);
    this.values = ImmutableSet.copyOf(values);
}

From source file:com.persinity.common.db.metainfo.constraint.Constraint.java

protected Constraint(final String name, final String table, final Set<Col> columns) {
    notEmpty(name);//from  w ww  . j  a va 2s  . c  o  m
    notEmpty(table);
    notEmpty(columns);

    this.name = name;
    this.table = table;
    this.columns = ImmutableSet.copyOf(columns); // will keep the order of insert
}

From source file:org.graylog2.shared.inputs.InputRegistry.java

public Set<IOState<MessageInput>> getInputStates() {
    return ImmutableSet.copyOf(this);
}

From source file:google.registry.model.ofy.SessionKeyExposingObjectify.java

/** Expose the protected method that provides the keys read, saved or deleted in a session. */
ImmutableSet<Key<?>> getSessionKeys() {
    return ImmutableSet.copyOf(getSession().keys());
}

From source file:br.com.blackhubos.eventozero.hook.Hooks.java

/**
 * @return Uma {@ ImmutableSet} contendo todos os hooks carregados.
 *///from   w  ww. jav  a2  s  .c  o  m
public static ImmutableSet<Hook> getHooks() {
    return ImmutableSet.copyOf(hooks.values());
}

From source file:com.tngtech.archunit.library.plantuml.PlantUmlDiagram.java

Set<PlantUmlComponent> getAllComponents() {
    return ImmutableSet.copyOf(plantUmlComponents.getAllComponents());
}

From source file:org.voltcore.agreement.matcher.SiteFailureMatchers.java

static public final Matcher<SiteFailureMessage> siteFailureIs(final Donor<List<Pair<Long, Long>>> safeTxns,
        final long... survivors) {

    final Map<Long, Long> safeTxnIds = Maps.newHashMap();
    for (Pair<Long, Long> sp : safeTxns.value()) {
        safeTxnIds.put(sp.getFirst(), sp.getSecond());
    }/*  ww  w  . ja  v  a2  s .  c o  m*/
    final Set<Long> survivorSet = ImmutableSet.copyOf(Longs.asList(survivors));

    return new TypeSafeMatcher<SiteFailureMessage>() {

        @Override
        public void describeTo(Description d) {
            d.appendText("SiteFailureMessage [").appendText("survivors: ")
                    .appendValueList("", ", ", "", Longs.asList(survivors)).appendText("safeTxnIds: ")
                    .appendValue(safeTxnIds).appendText("]");
        }

        @Override
        protected boolean matchesSafely(SiteFailureMessage m) {
            return equalTo(survivorSet).matches(m.m_survivors) && equalTo(safeTxnIds).matches(m.m_safeTxnIds);
        }
    };
}

From source file:io.wcm.dam.assetservice.impl.DamPathHandler.java

private static Set<String> validateDamPaths(String[] damPaths) {
    Set<String> paths = new HashSet<>();
    if (damPaths != null) {
        for (String path : damPaths) {
            if (StringUtils.isNotBlank(path)) {
                paths.add(path);/*  w  w  w  . j ava2  s  . c o  m*/
            }
        }
    }
    if (paths.isEmpty()) {
        paths.add(DEFAULT_DAM_PATH);
    }
    return ImmutableSet.copyOf(paths);
}

From source file:org.eclipse.che.api.project.server.impl.ProjectConfigRegistry.java

public Set<RegisteredProject> getAll() {
    return ImmutableSet.copyOf(projects.values());
}