List of usage examples for java.util Collections unmodifiableSet
public static <T> Set<T> unmodifiableSet(Set<? extends T> s)
From source file:org.socraticgrid.hl7.ucs.nifi.processor.SendVOIPMessage.java
@Override protected void init(final ProcessorInitializationContext context) { final List<PropertyDescriptor> properties = new ArrayList<>(); properties.add(VOIP_MSG_TEXT);//w w w. java 2s .c o m properties.add(VOIP_MSG_NUMBER); properties.add(VOIP_SERVER_URL); properties.add(VOIP_SERVER_TOKEN); properties.add(SERVICE_STATUS_CONTROLLER_SERVICE); this.properties = Collections.unmodifiableList(properties); final Set<Relationship> relationships = new HashSet<>(); relationships.add(REL_MSG_SEND); relationships.add(REL_FAILURE); this.relationships = Collections.unmodifiableSet(relationships); }
From source file:org.springframework.boot.web.client.RestTemplateBuilder.java
/** * Create a new {@link RestTemplateBuilder} instance. * @param customizers any {@link RestTemplateCustomizer RestTemplateCustomizers} that * should be applied when the {@link RestTemplate} is built *///from ww w . j av a2 s. c o m public RestTemplateBuilder(RestTemplateCustomizer... customizers) { Assert.notNull(customizers, "Customizers must not be null"); this.detectRequestFactory = true; this.rootUri = null; this.messageConverters = null; this.requestFactory = null; this.uriTemplateHandler = null; this.errorHandler = null; this.basicAuthorization = null; this.restTemplateCustomizers = Collections.unmodifiableSet(new LinkedHashSet<>(Arrays.asList(customizers))); this.requestFactoryCustomizers = Collections.<RequestFactoryCustomizer>emptySet(); this.interceptors = Collections.<ClientHttpRequestInterceptor>emptySet(); }
From source file:com.simonellistonball.nifi.processors.OpenScoringProcessor.OpenScoringProcessor.java
@Override protected void init(final ProcessorInitializationContext context) { final List<PropertyDescriptor> descriptors = new ArrayList<PropertyDescriptor>(); descriptors.add(PMML);//from w w w. jav a 2s. c o m descriptors.add(OPENSCORING_URL); this.descriptors = Collections.unmodifiableList(descriptors); final Set<Relationship> relationships = new HashSet<Relationship>(); relationships.add(SUCCESS); relationships.add(FAILURE); relationships.add(FAILURE_MODEL); this.relationships = Collections.unmodifiableSet(relationships); }
From source file:org.osiam.auth.oauth_client.ClientEntity.java
@Override public Set<String> getScope() { return Collections.unmodifiableSet(scope); }
From source file:com.github.aptd.simulation.TestCLanguageLabels.java
/** * check package translation configuration versus property items *//*from w w w.ja v a 2 s .c om*/ @Test public void testTranslation() { assumeTrue("no languages are defined for checking", !LANGUAGEPROPERY.isEmpty()); // --- read language definitions from the configuration final Set<String> l_translation = Collections.unmodifiableSet( Arrays.stream(CCommon.configuration().getObject("translation").toString().split(",")) .map(i -> i.trim().toLowerCase()).collect(Collectors.toSet())); // --- check if a test (language resource) exists for each definied language final Set<String> l_translationtesting = new HashSet<>(l_translation); l_translationtesting.removeAll(LANGUAGEPROPERY.keySet()); assertFalse(MessageFormat.format( "configuration defines {1,choice,1#translation|1<translations} {0} that {1,choice,1#is|1<are} not tested", l_translationtesting, l_translationtesting.size()), !l_translationtesting.isEmpty()); // --- check unused language resource files final Set<String> l_translationusing = new HashSet<>(LANGUAGEPROPERY.keySet()); l_translationusing.removeAll(l_translation); assertFalse(MessageFormat.format( "{1,choice,1#translation|1<translations} {0} {1,choice,1#is|1<are} checked, which will not be used within the package configuration", l_translationusing, l_translationusing.size()), !l_translationusing.isEmpty()); }
From source file:com.keedio.nifi.processors.azure.blob.FetchAzureBlobObject.java
@Override protected void init(final ProcessorInitializationContext context) { final List<PropertyDescriptor> descriptors = initPropertyDescriptors(); descriptors.add(AZURE_STORAGE_BLOB_OBJECT); this.descriptors = Collections.unmodifiableList(descriptors); final Set<Relationship> relationships = initRelationships(); this.relationships = Collections.unmodifiableSet(relationships); }
From source file:hr.fer.spocc.grammar.cfg.CfgGrammar.java
public Set<CfgProductionRule<T>> getSubstitutions(Variable<T> variable) { if (!this.rulesByVariable.containsKey(variable)) return Collections.EMPTY_SET; return Collections.unmodifiableSet(this.rulesByVariable.getAll(variable)); }
From source file:org.apache.nifi.processors.example.utils.RenameJSONFields.java
@OnScheduled public void onScheduled(final ProcessContext context) { Map<String, String> mFieldMappings = new HashMap<>(); String fieldMappingsProp = context.getProperty(FIELD_MAPPINGS).getValue(); String[] fieldMappingsSplit = fieldMappingsProp.split("[,]"); for (String fieldMapping : fieldMappingsSplit) { int equalsIndex = fieldMapping.indexOf('='); String fieldName = fieldMapping.substring(0, equalsIndex); String mappedName = fieldMapping.substring(equalsIndex + 1); mFieldMappings.put(fieldName, mappedName); }//from ww w .ja v a2 s.c om this.fieldMappings = Collections.unmodifiableMap(mFieldMappings); Set<String> mExcludeFields = new HashSet<>(); String excludeFields = context.getProperty(EXCLUDE_FIELDS).getValue(); if (excludeFields != null && !excludeFields.isEmpty()) { String[] excludeFieldsSplit = excludeFields.split("[,]"); for (String excludeField : excludeFieldsSplit) { mExcludeFields.add(excludeField); } } this.excludeFields = Collections.unmodifiableSet(mExcludeFields); }
From source file:org.n52.iceland.service.operator.ServiceOperatorRepository.java
/** * @return the supportedVersions//www .java 2 s . com */ public Set<String> getSupportedServices() { return Collections.unmodifiableSet(this.supportedVersions.keySet()); }
From source file:com.facebook.Settings.java
/** * Certain logging behaviors are available for debugging beyond those that should be * enabled in production.//from ww w . j a v a 2 s .c o m * * Returns the types of extended logging that are currently enabled. * * @return a set containing enabled logging behaviors */ public static final Set<LoggingBehavior> getLoggingBehaviors() { synchronized (loggingBehaviors) { return Collections.unmodifiableSet(new HashSet<LoggingBehavior>(loggingBehaviors)); } }