Example usage for com.google.common.collect Sets newHashSet

List of usage examples for com.google.common.collect Sets newHashSet

Introduction

In this page you can find the example usage for com.google.common.collect Sets newHashSet.

Prototype

public static <E> HashSet<E> newHashSet() 

Source Link

Document

Creates a mutable, initially empty HashSet instance.

Usage

From source file:org.apache.pulsar.common.policies.data.TenantInfo.java

public TenantInfo() {
    adminRoles = Sets.newHashSet();
    allowedClusters = Sets.newHashSet();
}

From source file:org.cleansvg.NamedNodeMapAdapter.java

private Set<Map.Entry<String, String>> createEntrySet() {
    final Set<Map.Entry<String, String>> results = Sets.newHashSet();
    for (final Attr attr : new AttrIterable(parent.getAttributes())) {
        results.add(new Entry(attr.getName(), attr.getValue()));
    }//from www .j  a va 2s . c  o m
    return results;
}

From source file:org.atlasapi.genres.GenreMap.java

public Set<String> map(Set<String> sourceGenres) {

    Set<String> mappedGenres = Sets.newHashSet();

    if (sourceGenres == null) {
        return mappedGenres;
    }// w w  w .  j  av  a2 s .c om

    for (String sourceGenre : sourceGenres) {
        AtlasGenre mappedGenre = genres.get(sourceGenre.toLowerCase());
        if (mappedGenre != null) {
            mappedGenres.add(mappedGenre.getUri());
        }
    }

    mappedGenres.addAll(sourceGenres);

    return mappedGenres;
}

From source file:de.xaniox.heavyspleef.core.event.GlobalEventBus.java

public GlobalEventBus(Logger logger) {
    super(logger);

    this.logger = logger;
    this.singleInstanceBusMap = Sets.newHashSet();
    this.globalListeners = Sets.newHashSet();
}

From source file:ai.grakn.graql.internal.gremlin.spanningtree.graph.SparseWeightedGraph.java

public static <T> SparseWeightedGraph<T> from(Iterable<Weighted<DirectedEdge<T>>> edges) {
    final Set<T> nodes = Sets.newHashSet();
    for (Weighted<DirectedEdge<T>> edge : edges) {
        nodes.add(edge.val.source);
        nodes.add(edge.val.destination);
    }//w w  w .  j a  v  a  2s  . c  om
    return SparseWeightedGraph.from(nodes, edges);
}

From source file:eu.europa.ec.fisheries.uvms.spatial.service.mapper.UserAreaMapper.java

public static Set<UserScopeEntity> fromScopeArrayToEntity(List<String> scopeSelection) {
    Set<UserScopeEntity> userScopeEntities = Sets.newHashSet();

    if (scopeSelection != null) {
        for (String scope : scopeSelection) {
            UserScopeEntity userScopeEntity = new UserScopeEntity();
            userScopeEntity.setName(scope);
            userScopeEntities.add(userScopeEntity);
        }/*  ww  w.  j a v  a  2 s .  c o  m*/
    }

    return userScopeEntities;
}

From source file:cc.recommenders.mining.calls.NoCallRecommender.java

@Override
public Set<Tuple<ICoReMethodName, Double>> queryPattern(String patternName) {
    return Sets.newHashSet();
}

From source file:com.huawei.streaming.cql.executor.mergeuserdefinds.RenameRule.java

/**
 * <>/*from   w  ww . j a v a2 s .co m*/
 */
public RenameRule() {
    renameFiles = Sets.newHashSet();
    renameFiles.add("LICENSE");
    renameFiles.add("NOTICE");
    renameFiles.add("DEPENDENCIES");
}

From source file:org.eclipse.xtext.parsetree.reconstr.impl.NodeIterator.java

public NodeIterator(INode node) {
    prunedComposites = Sets.newHashSet();
    current = node;
    next = findNext(node);
    previous = findPrevious(node);
}

From source file:org.gradle.internal.resource.transport.file.FileConnectorFactory.java

@Override
public Set<Class<? extends Authentication>> getSupportedAuthentication() {
    return Sets.newHashSet();
}