/** * Return the set of all option arguments present on the command line. */ public Set<String> getOptionNames() { return Collections.unmodifiableSet(this.optionArgs.keySet()); }
private static Set<? extends Annotation> jsonAnnotations(Annotation[] annotations) { Set<Annotation> result = null; for (Annotation annotation : annotations) { if (annotation.annotationType().isAnnotationPresent(JsonQualifier.class)) { if (result == null) result = new LinkedHashSet<>(); result.add(annotation); } } return result != null ? unmodifiableSet(result) : Collections.<Annotation>emptySet(); } }
public MethodNotAllowedException(String method, @Nullable Collection<HttpMethod> supportedMethods) { super(HttpStatus.METHOD_NOT_ALLOWED, "Request method '" + method + "' not supported"); Assert.notNull(method, "'method' is required"); if (supportedMethods == null) { supportedMethods = Collections.emptySet(); } this.method = method; this.supportedMethods = Collections.unmodifiableSet(new HashSet<>(supportedMethods)); }
@Override protected void init(final ProcessorInitializationContext context) { final List<PropertyDescriptor> properties = new ArrayList<>(); properties.add(USE_FILENAME_IN_DETECTION); this.properties = Collections.unmodifiableList(properties); final Set<Relationship> rels = new HashSet<>(); rels.add(REL_SUCCESS); this.relationships = Collections.unmodifiableSet(rels); }
public static <T> Set<T> of(Iterable<T> elements) { final Set<T> set = new HashSet<>(); for (T element : elements) { set.add(element); } return unmodifiableSet(set); } }
/** * Update the exposed {@link #cacheNames} set with the given name. * <p>This will always be called within a full {@link #cacheMap} lock * and effectively behaves like a {@code CopyOnWriteArraySet} with * preserved order but exposed as an unmodifiable reference. * @param name the name of the cache to be added */ private void updateCacheNames(String name) { Set<String> cacheNames = new LinkedHashSet<>(this.cacheNames.size() + 1); cacheNames.addAll(this.cacheNames); cacheNames.add(name); this.cacheNames = Collections.unmodifiableSet(cacheNames); }
public Set<Map.Entry<String, Object>> entrySet() { if (entries != null) { return entries; } Set<Map.Entry<String, Object>> all = new HashSet<Map.Entry<String, Object>>(properties.entrySet()); add: for (String key : service.getPropertyKeys()) { for (String k : properties.keySet()) { if (key.equalsIgnoreCase(k)) { continue add; } } all.add(new Entry(key, service.getProperty(key))); } return entries = Collections.unmodifiableSet(all); }
@Override protected void init(final ProcessorInitializationContext context) { final Set<Relationship> relationships = new HashSet<>(); relationships.add(REL_ATTACHMENTS); relationships.add(REL_ORIGINAL); relationships.add(REL_FAILURE); this.relationships = Collections.unmodifiableSet(relationships); final List<PropertyDescriptor> descriptors = new ArrayList<>(); this.descriptors = Collections.unmodifiableList(descriptors); }
/** * @param uri the uri to look uo * @return a set that contains all keys for that uri, never <code>null</code> */ public Set<String> getModuleConfigKeys(SimpleUri uri) { Map<String, JsonElement> map = config.getModuleConfigs().get(uri); if (map == null) { return Collections.emptySet(); } return Collections.unmodifiableSet(map.keySet()); }
@Override public void setupModule(SetupContext context) { SecurityJackson2Modules.enableDefaultTyping((ObjectMapper) context.getOwner()); context.setMixInAnnotations(AnonymousAuthenticationToken.class, AnonymousAuthenticationTokenMixin.class); context.setMixInAnnotations(RememberMeAuthenticationToken.class, RememberMeAuthenticationTokenMixin.class); context.setMixInAnnotations(SimpleGrantedAuthority.class, SimpleGrantedAuthorityMixin.class); context.setMixInAnnotations(Collections.<Object>unmodifiableSet(Collections.emptySet()).getClass(), UnmodifiableSetMixin.class); context.setMixInAnnotations(Collections.<Object>unmodifiableList(Collections.emptyList()).getClass(), UnmodifiableListMixin.class); context.setMixInAnnotations(User.class, UserMixin.class); context.setMixInAnnotations(UsernamePasswordAuthenticationToken.class, UsernamePasswordAuthenticationTokenMixin.class); context.setMixInAnnotations(BadCredentialsException.class, BadCredentialsExceptionMixin.class); } }
@Override protected void init(final ProcessorInitializationContext context) { final List<PropertyDescriptor> properties = new ArrayList<>(); properties.add(MODE); this.properties = Collections.unmodifiableList(properties); final Set<Relationship> relationships = new HashSet<>(); relationships.add(REL_SUCCESS); relationships.add(REL_FAILURE); this.relationships = Collections.unmodifiableSet(relationships); }
public static <T> Set<T> of(T e1, T e2) { final Set<T> set = new HashSet<>(2); set.add(e1); set.add(e2); return unmodifiableSet(set); }
/** * Return the ids of the managed {@link MessageListenerContainer} instance(s). * @since 4.2.3 * @see #getListenerContainer(String) */ public Set<String> getListenerContainerIds() { return Collections.unmodifiableSet(this.listenerContainers.keySet()); }
/** * Returns the distinct query parameter names in this URL, like {@code ["a", "b"]} for {@code * http://host/?a=apple&b=banana}. If this URL has no query this returns the empty set. * * <p><table summary=""> * <tr><th>URL</th><th>{@code queryParameterNames()}</th></tr> * <tr><td>{@code http://host/}</td><td>{@code []}</td></tr> * <tr><td>{@code http://host/?}</td><td>{@code [""]}</td></tr> * <tr><td>{@code http://host/?a=apple&k=key+lime}</td><td>{@code ["a", "k"]}</td></tr> * <tr><td>{@code http://host/?a=apple&a=apricot}</td><td>{@code ["a"]}</td></tr> * <tr><td>{@code http://host/?a=apple&b}</td><td>{@code ["a", "b"]}</td></tr> * </table> */ public Set<String> queryParameterNames() { if (queryNamesAndValues == null) return Collections.emptySet(); Set<String> result = new LinkedHashSet<>(); for (int i = 0, size = queryNamesAndValues.size(); i < size; i += 2) { result.add(queryNamesAndValues.get(i)); } return Collections.unmodifiableSet(result); }
/** * Update the exposed {@link #cacheNames} set with the given name. * <p>This will always be called within a full {@link #cacheMap} lock * and effectively behaves like a {@code CopyOnWriteArraySet} with * preserved order but exposed as an unmodifiable reference. * @param name the name of the cache to be added */ private void updateCacheNames(String name) { Set<String> cacheNames = new LinkedHashSet<>(this.cacheNames.size() + 1); cacheNames.addAll(this.cacheNames); cacheNames.add(name); this.cacheNames = Collections.unmodifiableSet(cacheNames); }
public Set<String> keySet() { return CollectionUtils.isEmpty(this.combinedPrincipals) ? Collections.<String>emptySet() : Collections.unmodifiableSet(this.combinedPrincipals.keySet()); }
/** * Creates an instance with the specified parameters. * * @param topicPartitions List of topic partitions */ public MemberAssignment(Set<TopicPartition> topicPartitions) { this.topicPartitions = topicPartitions == null ? Collections.<TopicPartition>emptySet() : Collections.unmodifiableSet(new HashSet<>(topicPartitions)); }
@Override protected void init(final ProcessorInitializationContext context) { final Set<Relationship> relationships = new HashSet<>(); relationships.add(REL_FAILURE); relationships.add(REL_SUCCESS); this.relationships = Collections.unmodifiableSet(relationships); final List<PropertyDescriptor> properties = new ArrayList<>(); properties.add(HASH_VALUE_ATTRIBUTE); this.properties = Collections.unmodifiableList(properties); }
public static <T> Set<T> of(T e1, T e2, T e3) { final Set<T> set = new HashSet<>(3); set.add(e1); set.add(e2); set.add(e3); return unmodifiableSet(set); }
@Override public Set<E> incidentEdges() { return Collections.unmodifiableSet(incidentEdgeMap.keySet()); }