Example usage for java.util Collections unmodifiableSet

List of usage examples for java.util Collections unmodifiableSet

Introduction

In this page you can find the example usage for java.util Collections unmodifiableSet.

Prototype

public static <T> Set<T> unmodifiableSet(Set<? extends T> s) 

Source Link

Document

Returns an unmodifiable view of the specified set.

Usage

From source file:io.seldon.clustering.recommender.ClientClusterTypeServiceImpl.java

public void addTypes(String client, Set<Integer> types) {
    validClusters.put(client, Collections.unmodifiableSet(types));
}

From source file:org.springframework.security.jackson2.UserDeserializerTests.java

protected ObjectMapper buildObjectMapper() {
    return super.buildObjectMapper().addMixIn(SimpleGrantedAuthority.class, SimpleGrantedAuthorityMixin.class)
            .addMixIn(Collections.unmodifiableSet(Collections.EMPTY_SET).getClass(), UnmodifiableSetMixin.class)
            .addMixIn(User.class, UserMixin.class);
}

From source file:ezbake.data.elastic.test.PlaceOfInterest.java

public void setTags(Set<String> tags) {
    this.tags = Collections.unmodifiableSet(Sets.newHashSet(tags));
}

From source file:descriptordump.dumpexecutor.AbstractExecutor.java

protected AbstractExecutor(TABLE_ID tid, TABLE_ID... tids) {
    List<TABLE_ID> t = new ArrayList<>();
    if (tid != null) {
        t.add(tid);/*from w  w w.j  av  a  2  s.c o  m*/
    } else {
        throw new NullPointerException("ID??????");
    }
    if (tids != null) {
        t.addAll(Arrays.asList(tids));
    }
    Set<TABLE_ID> temp = Collections.synchronizedSet(new HashSet<>());
    temp.addAll(t);
    this.tids = Collections.unmodifiableSet(temp);

}

From source file:Main.java

/**
 * Wrap a {@link java.util.Collection} in an unmodifiable {@link java.util.Set}.
 * If the collection is already a {@link java.util.Set} then it is cast, otherwise
 * its elements are copied into a new {@link java.util.Set}.
 *
 * @param collection  The collection to wrap.
 *
 * @param <E>  The collection element type.
 *//*w w w .ja v a 2  s  .c  o m*/
public static <E> Set<E> unmodifiableSet(Collection<E> collection) {
    return collection instanceof Set ? Collections.unmodifiableSet((Set<E>) collection)
            : Collections.unmodifiableSet(new HashSet<E>(collection));
}

From source file:com.kixeye.chassis.transport.websocket.WebSocketMessageRegistry.java

/**
 * Gets all the type IDs.
 * 
 * @return
 */
public Set<String> getTypeIds() {
    return Collections.unmodifiableSet(typeIdToClass.keySet());
}

From source file:edu.stanford.junction.props2.sample.SetProp.java

public Collection<JSONObject> items() {
    return Collections.unmodifiableSet((Set) items);
}

From source file:com.vmware.identity.openidconnect.server.SessionEntry.java

public Set<OIDCClientInformation> getClients() {
    return Collections.unmodifiableSet(this.clients);
}

From source file:com.yahoo.bard.webservice.druid.model.aggregation.CardinalityAggregation.java

/**
 * Constructor.//ww  w .j a va 2s .com
 *
 * @param name  Name of the field
 * @param dimensions  The dimensions whose cardinality you want to capture
 * @param byRow  Whether to use Row or Value cardinality
 */
public CardinalityAggregation(String name, Set<Dimension> dimensions, boolean byRow) {
    super(name, "");
    this.dimensions = Collections.unmodifiableSet(new LinkedHashSet<>(dimensions));
    this.byRow = byRow;
}

From source file:com.arpnetworking.clusteraggregator.models.ShardAllocation.java

@JsonSerialize(using = CountingSetSerializer.class)
public Set<String> getCurrentShards() {
    return Collections.unmodifiableSet(_currentShards);
}