Refine search
public SegmentMetadataQueryBuilder analysisTypes(SegmentMetadataQuery.AnalysisType... analysisTypes) { if (analysisTypes == null) { this.analysisTypes = null; } else { this.analysisTypes = analysisTypes.length == 0 ? EnumSet.noneOf(SegmentMetadataQuery.AnalysisType.class) : EnumSet.copyOf(Arrays.asList(analysisTypes)); } return this; }
/** * Create a UnicodeUnescaper. * * The constructor takes a list of options, only one type of which is currently * available (whether to allow, error or ignore the semi-colon on the end of a * numeric entity to being missing). * * For example, to support numeric entities without a ';': * new NumericEntityUnescaper(NumericEntityUnescaper.OPTION.semiColonOptional) * and to throw an IllegalArgumentException when they're missing: * new NumericEntityUnescaper(NumericEntityUnescaper.OPTION.errorIfNoSemiColon) * * Note that the default behaviour is to ignore them. * * @param options to apply to this unescaper */ public NumericEntityUnescaper(final OPTION... options) { if(options.length > 0) { this.options = EnumSet.copyOf(Arrays.asList(options)); } else { this.options = EnumSet.copyOf(Arrays.asList(new OPTION[] { OPTION.semiColonRequired })); } }
/** * Return the set of allowed {@link HttpMethod HTTP methods}, * as specified by the {@code Allow} header. * <p>Returns an empty set when the allowed methods are unspecified. */ public Set<HttpMethod> getAllow() { String value = getFirst(ALLOW); if (!StringUtils.isEmpty(value)) { String[] tokens = StringUtils.tokenizeToStringArray(value, ","); List<HttpMethod> result = new ArrayList<>(tokens.length); for (String token : tokens) { HttpMethod resolved = HttpMethod.resolve(token); if (resolved != null) { result.add(resolved); } } return EnumSet.copyOf(result); } else { return EnumSet.noneOf(HttpMethod.class); } }
/** {@inheritDoc} */ @Override public GridClientData flagsOn(GridClientCacheFlag... flags) throws GridClientException { if (flags == null || flags.length == 0) return this; EnumSet<GridClientCacheFlag> flagSet = this.flags == null || this.flags.isEmpty() ? EnumSet.noneOf(GridClientCacheFlag.class) : EnumSet.copyOf(this.flags); flagSet.addAll(Arrays.asList(flags)); return createProjection(nodes, filter, balancer, new GridClientDataFactory(flagSet)); }
@Override public EnumSet<SGR> getSGRs() { ThemeTreeNode node = styleNode; while(node != null) { if(node.sgrMap.containsKey(name)) { return EnumSet.copyOf(node.sgrMap.get(name)); } node = node.parent; } EnumSet<SGR> fallback = rootNode.sgrMap.get(STYLE_NORMAL); if(fallback == null) { fallback = EnumSet.noneOf(SGR.class); } return EnumSet.copyOf(fallback); } }
/** * Returns all annotations searching from the specified {@code element}. The search range depends on * the specified {@link FindOption}s and the built-in Java meta-annotations will not be collected. * * @param element the {@link AnnotatedElement} to find annotations * @param findOptions the options to be applied when retrieving annotations */ static List<Annotation> getAnnotations(AnnotatedElement element, FindOption... findOptions) { requireNonNull(findOptions, "findOptions"); return getAnnotations(element, findOptions.length > 0 ? EnumSet.copyOf(ImmutableList.copyOf(findOptions)) : EnumSet.noneOf(FindOption.class)); }
ThreadStateMatcher(String pattern) { Pattern regEx = Pattern.compile(wildCardTranslate(pattern)); Set<State> st = new HashSet<State>(); for(State s: State.values()) { if (regEx.matcher(s.toString()).matches()) { st.add(s); } } states = st.isEmpty() ? EnumSet.noneOf(State.class) : EnumSet.copyOf(st); matchNull = regEx.matcher(String.valueOf((Object)null)).matches(); }