List of usage examples for java.util Collections unmodifiableSet
public static <T> Set<T> unmodifiableSet(Set<? extends T> s)
From source file:com.github.mrstampy.gameboot.metrics.GameBootMetricsHelper.java
@Override public Set<Entry<String, Counter>> getCounters() { return Collections.unmodifiableSet(counters.entrySet()); }
From source file:org.geoserver.wps.sextante.SextanteProcessFactory.java
/** * Constructs a process factory based on the full SEXTANTE algorithms set *//*from ww w .j a v a2 s . c o m*/ public SextanteProcessFactory() { Sextante.initialize(); Set<Name> result = new HashSet<Name>(); for (String name : (Set<String>) Sextante.getAlgorithms().keySet()) { result.add(new NameImpl(SEXTANTE_NAMESPACE, name)); } names = Collections.unmodifiableSet(result); }
From source file:libepg.ts.packet.PROGRAM_ID.java
private PROGRAM_ID(String pidName, Integer pid, Integer... pids) { this.pidName = pidName; if ((this.pidName == null) || ("".equals(this.pidName))) { throw new IllegalArgumentException("???????????"); }//from w ww . j av a 2 s .c om List<Integer> t = new ArrayList<>(); if (pid != null) { t.add(pid); } else { throw new NullPointerException("PID??????"); } if (pids != null) { t.addAll(Arrays.asList(pids)); } Range<Integer> r = Range.between(0x0000, 0x1FFF); for (Integer i : t) { if (!r.contains(i)) { MessageFormat msg = new MessageFormat("PID????PID={0}"); Object[] parameters = { Integer.toHexString(i) }; throw new IllegalArgumentException(msg.format(parameters)); } } Set<Integer> temp = Collections.synchronizedSet(new HashSet<Integer>()); temp.addAll(t); this.pids = Collections.unmodifiableSet(temp); }
From source file:com.thruzero.common.core.config.JFigConfig.java
@Override public Set<String> getSectionNames() { @SuppressWarnings("unchecked") Set<String> result = Collections .unmodifiableSet(jFig.getConfigDictionary().getDictionaryOfSectionDictionaries().keySet()); return result; }
From source file:com.kixeye.chassis.transport.websocket.WebSocketMessageMappingRegistry.java
/** * Gets all the actions. * * @return */ public Set<String> getActions() { return Collections.unmodifiableSet(actions.keySet()); }
From source file:com.sysunite.nifi.StringSplit.java
@Override public void onPropertyModified(PropertyDescriptor descriptor, String oldValue, String newValue) { //position 2//from ww w. ja v a 2s.c o m if (descriptor.isDynamic()) { //------------first we make dynamic properties //System.out.println("@onPropertyModified:: dynamic prop"); final Set<String> newDynamicPropertyNames = new HashSet<>(dynamicPropertyNames); if (oldValue == null) { // new property //System.out.println("@onPropertyModified::oldValue=NULL"); //newDynamicPropertyNames.addAll(this.dynamicPropertyNames); newDynamicPropertyNames.add(descriptor.getName()); //dynamicPropertyValues.put(descriptor, newValue); } //TODO: what are we going to do with changed values from dynamic attributes? this.dynamicPropertyNames = Collections.unmodifiableSet(newDynamicPropertyNames); //------------then we make relationships with the dynamic property names final Set<String> allDynamicProps = this.dynamicPropertyNames; final Set<Relationship> newRelationships = new HashSet<>(); for (final String propName : allDynamicProps) { newRelationships.add(new Relationship.Builder().name(propName).build()); } newRelationships.add(ORIGINAL); //dont forget the original this.relationships.set(newRelationships); } }
From source file:com.apigee.sdk.apm.http.client.cache.HttpCacheEntry.java
public Set<String> getVariantURIs() { return Collections.unmodifiableSet(this.variantURIs); }
From source file:gaffer.graph.hook.OperationAuthoriser.java
public Set<String> getAllOpAuths() { return Collections.unmodifiableSet(allOpAuths); }
From source file:org.apache.nifi.processors.att.m2x.AbstractM2XProcessor.java
@Override protected void init(final ProcessorInitializationContext context) { final List<PropertyDescriptor> descriptors = new ArrayList<PropertyDescriptor>(); descriptors.add(M2X_STREAM_TYPE);/*from w w w. ja v a 2 s . c o m*/ descriptors.add(M2X_API_KEY); descriptors.add(M2X_API_URL); this.descriptors = Collections.unmodifiableList(descriptors); final Set<Relationship> relationships = new HashSet<Relationship>(); relationships.add(REL_SUCCESS); this.relationships = Collections.unmodifiableSet(relationships); }
From source file:org.apache.nifi.processors.att.m2x.PutM2XStream.java
@Override protected void init(final ProcessorInitializationContext context) { super.init(context); final List<PropertyDescriptor> descriptors = new ArrayList<PropertyDescriptor>(); descriptors.add(M2X_DEVICE_ID);//from w w w . j a va 2 s . c om descriptors.add(M2X_STREAM_NAME); descriptors.addAll(super.getSupportedPropertyDescriptors()); this.descriptors = Collections.unmodifiableList(descriptors); final Set<Relationship> relationships = new HashSet<Relationship>(); relationships.add(REL_FAILURE); relationships.addAll(super.getRelationships()); this.relationships = Collections.unmodifiableSet(relationships); }