List of usage examples for java.util Collections unmodifiableSet
public static <T> Set<T> unmodifiableSet(Set<? extends T> s)
From source file:nu.yona.server.goals.service.ActivityCategoryDto.java
@JsonView({ AdminView.class, AppView.class }) public Set<String> getApplications() { return Collections.unmodifiableSet(applications); }
From source file:com.dataflowdeveloper.processors.process.NLPProcessor.java
@Override protected void init(final ProcessorInitializationContext context) { final List<PropertyDescriptor> descriptors = new ArrayList<PropertyDescriptor>(); descriptors.add(MY_PROPERTY);// w ww . j a v a 2 s . c o m descriptors.add(EXTRA_RESOURCE); this.descriptors = Collections.unmodifiableList(descriptors); final Set<Relationship> relationships = new HashSet<Relationship>(); relationships.add(REL_SUCCESS); relationships.add(REL_FAILURE); this.relationships = Collections.unmodifiableSet(relationships); }
From source file:de.uniba.wiai.kinf.pw.projects.lillytab.reasoner.tbox.TBox.java
/** * @return The set of non-unfoldable descriptions. *///from w ww. j ava 2 s .c o m @Override public Set<IDLClassExpression<I, L, K, R>> getGlobalDescriptions() { recalculateIfNeeded(); return Collections.unmodifiableSet(_globalDescriptionSet); }
From source file:com.myee.tarot.core.web.form.entity.FieldGroup.java
public Set<Field> getFields() { List<Field> myFields = new ArrayList<Field>(); myFields.addAll(fields);/*from w w w . j a va 2s . c o m*/ Collections.sort(myFields, new Comparator<Field>() { @Override public int compare(Field o1, Field o2) { return new CompareToBuilder().append(o1.getOrder(), o2.getOrder()) .append(o1.getFriendlyName(), o2.getFriendlyName()).append(o1.getName(), o2.getName()) .toComparison(); } }); if (!alternateOrderedFields.isEmpty()) { List<Field> mapFieldsList = new ArrayList<Field>(alternateOrderedFields); Collections.sort(mapFieldsList, new Comparator<Field>() { @Override public int compare(Field o1, Field o2) { return new CompareToBuilder().append(o1.getOrder(), o2.getOrder()) .append(o1.getFriendlyName(), o2.getFriendlyName()).append(o1.getName(), o2.getName()) .toComparison(); } }); /* alternate ordered fields whose order is less or equal to zero appear first and are prepended to the response list in order */ List<Field> smallOrderFields = new ArrayList<Field>(); for (Field mapField : mapFieldsList) { if (mapField.getOrder() <= 0) { smallOrderFields.add(mapField); } } myFields.addAll(0, smallOrderFields); /* Alternate ordered fields (specifically custom fields) have a different ordering rule than regular fields. For example, if a user enters 3 for the field order value for a custom field, that custom field should be the third on the form. Regular BLC AdminPresentation fields tends to have orders like 1000, 2000, etc..., so this distinction is necessary. */ for (Field mapField : mapFieldsList) { if (mapField.getOrder() <= 0) { continue; } if (mapField.getOrder() < myFields.size() + 1) { myFields.add(mapField.getOrder() - 1, mapField); continue; } myFields.add(mapField); } } //don't allow any modification of the fields return Collections.unmodifiableSet(new LinkedHashSet<Field>(myFields)); }
From source file:net.big_oh.common.testing.functional.FunctionalTestDataDependency.java
public Set<FunctionalTestDataDependency> getParentDependencies() { return Collections.unmodifiableSet(parentDependencies); }
From source file:com.wms.studio.cache.lock.SyncLockMapCache.java
@Override public Set<K> keys() { try {/*from ww w . j a v a 2 s . c o m*/ HashMap<K, V> attributes = memcachedClient.get(name); if (attributes != null) { Set<K> keys = attributes.keySet(); if (!keys.isEmpty()) return Collections.unmodifiableSet(keys); } } catch (Exception e) { log.fatal("?MemCache,.", e); } return Collections.emptySet(); }
From source file:com.openshift.internal.restclient.model.Pod.java
@Override public Set<IPort> getContainerPorts() { Set<IPort> ports = new HashSet<IPort>(); ModelNode node = get(POD_CONTAINERS); if (node.getType() == ModelType.LIST) { for (ModelNode container : node.asList()) { ModelNode containerPorts = container.get(getPath(PORTS)); if (containerPorts.getType() == ModelType.LIST) { for (ModelNode portNode : containerPorts.asList()) { ports.add(new Port(portNode)); }// w w w . ja v a 2 s. c om } } } return Collections.unmodifiableSet(ports); }
From source file:io.seldon.api.state.ClientAlgorithmStore.java
@Autowired public ClientAlgorithmStore(ClientConfigHandler configHandler, GlobalConfigHandler globalConfigHandler, CurrentItemFilter currentItemFilter, IgnoredRecsFilter ignoredRecsFilter, RecentImpressionsFilter recentImpressionsFilter) { this.configHandler = configHandler; this.globalConfigHandler = globalConfigHandler; Set<ItemFilter> set = new HashSet<>(); set.add(currentItemFilter);//from w ww . j a v a 2 s . c om set.add(ignoredRecsFilter); set.add(recentImpressionsFilter); alwaysOnFilters = Collections.unmodifiableSet(set); }
From source file:com.opengamma.engine.view.compilation.CompiledViewDefinitionImpl.java
@Override public Set<ComputationTargetSpecification> getComputationTargets() { Set<ComputationTargetSpecification> allTargets = new HashSet<ComputationTargetSpecification>(); for (CompiledViewCalculationConfiguration compiledCalcConfig : getCompiledCalculationConfigurations()) { allTargets.addAll(compiledCalcConfig.getComputationTargets()); }/*from w w w .j a v a2 s . c om*/ return Collections.unmodifiableSet(allTargets); }
From source file:com.act.biointerpretation.networkanalysis.NetworkEdge.java
public Set<Integer> getReactionIds() { return Collections.unmodifiableSet(reactionIds); }