Accumulator<E> combine(Accumulator<E> other) { if (this.set == null) { return other; } else if (other.set == null) { return this; } else { this.set.addAll(other.set); return this; } }
private SqlParserOptions(EnumSet<IdentifierSymbol> identifierSymbols, boolean enhancedErrorHandlerEnabled) { this.enhancedErrorHandlerEnabled = enhancedErrorHandlerEnabled; this.allowedIdentifierSymbols.addAll(identifierSymbols); }
Accumulator<E> combine(Accumulator<E> other) { if (this.set == null) { return other; } else if (other.set == null) { return this; } else { this.set.addAll(other.set); return this; } }
@SuppressWarnings("unchecked") private Object readResolve() { EnumSet enumSet = EnumSet.noneOf(type); enumSet.addAll(Arrays.asList(objects)); return enumSet; } }
public ConfigurationBuilder options(Set<Option> options) { this.options.addAll(options); return this; }
Accumulator<E> combine(Accumulator<E> other) { if (this.set == null) { return other; } else if (other.set == null) { return this; } else { this.set.addAll(other.set); return this; } }
public void putAll(EnumBooleanMap<ENUM> other) { store.addAll(other.store); }
public ConfigurationBuilder options(Option... flags) { if(flags.length > 0) { this.options.addAll(asList(flags)); } return this; }
public Permission(Action... assigned) { if (assigned != null && assigned.length > 0) { actions.addAll(Arrays.asList(assigned)); } }
@Override public TextGraphicsWriter enableModifiers(SGR... modifiers) { style.addAll(Arrays.asList(modifiers)); return this; }
@Override public Set<CascadeAction> cascadeActions() { EnumSet<CascadeAction> actions = EnumSet.noneOf(CascadeAction.class); if (cascadeActions != null) { actions.addAll(Arrays.asList(cascadeActions)); } return actions; }
public void setActions(Action[] assigned) { if (assigned != null && assigned.length > 0) { // setActions should cover the previous actions, // so we call clear here. actions.clear(); actions.addAll(Arrays.asList(assigned)); } }
private static void putType(final EnumSet<NodeType> types, final String s) { if (ANY.equals(s)) { types.addAll(EnumSet.allOf(NodeType.class)); return; } final NodeType type = NodeType.fromName(s); types.add(type); if (type == NodeType.NUMBER) types.add(NodeType.INTEGER); } }
@Override public TextGraphicsWriter setModifiers(EnumSet<SGR> modifiers) { style.clear(); style.addAll(modifiers); return this; }
@Override public synchronized TextGraphics setModifiers(EnumSet<SGR> modifiers) { activeModifiers.clear(); activeModifiers.addAll(modifiers); return this; }
@Override public Set setModifiers(EnumSet<SGR> modifiers) { style.clear(); style.addAll(modifiers); return this; } @Override
/** {@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)); }
/** * Creates a new configuration by adding the new options to the options used in this configuration. * @param options options to add * @return a new configuration */ public Configuration addOptions(Option... options) { EnumSet<Option> opts = EnumSet.noneOf(Option.class); opts.addAll(this.options); opts.addAll(asList(options)); return Configuration.builder().jsonProvider(jsonProvider).mappingProvider(mappingProvider).options(opts).evaluationListener(evaluationListeners).build(); }
protected Set<MetricAttribute> getDisabledAttributes() { final EnumSet<MetricAttribute> metricAttributes = EnumSet.complementOf(getIncludesAttributes()); metricAttributes.addAll(getExcludesAttributes()); return metricAttributes; } }
private void checkRequiredCaps(Caps... caps) { EnumSet<Caps> expected = EnumSet.noneOf(Caps.class); expected.addAll(Arrays.asList(caps)); Technique tech = material.getActiveTechnique(); assertEquals(expected, tech.getDef().getRequiredCaps()); }