本文整理汇总了Java中java.util.EnumSet.removeAll方法的典型用法代码示例。如果您正苦于以下问题:Java EnumSet.removeAll方法的具体用法?Java EnumSet.removeAll怎么用?Java EnumSet.removeAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.util.EnumSet
的用法示例。
在下文中一共展示了EnumSet.removeAll方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: check
import java.util.EnumSet; //导入方法依赖的package包/类
private boolean check(ElementKind kind, Set<Modifier> modifiers) {
if (this.kind != kind)
return false;
if (modifiers == null || modifiers.isEmpty())
return mods.isEmpty();
if (!modifiers.containsAll(this.mods))
return false;
EnumSet<Modifier> copy = EnumSet.copyOf(modifiers);
copy.removeAll(this.mods);
copy.retainAll(ignoreVisibility? EnumSet.of(Modifier.STATIC)
: EnumSet.of(Modifier.STATIC, Modifier.PUBLIC, Modifier.PRIVATE, Modifier.PROTECTED));
return copy.isEmpty();
}
示例2: build
import java.util.EnumSet; //导入方法依赖的package包/类
/**
* Creates a new {@link ConnectionProfile} based on the added connections.
* @throws IllegalStateException if any of the {@link org.elasticsearch.transport.TransportRequestOptions.Type} enum is missing
*/
public ConnectionProfile build() {
EnumSet<TransportRequestOptions.Type> types = EnumSet.allOf(TransportRequestOptions.Type.class);
types.removeAll(addedTypes);
if (types.isEmpty() == false) {
throw new IllegalStateException("not all types are added for this connection profile - missing types: " + types);
}
return new ConnectionProfile(Collections.unmodifiableList(handles), offset, connectTimeout, handshakeTimeout);
}
示例3: assertSetOfTypesIsEqual
import java.util.EnumSet; //导入方法依赖的package包/类
/**
* Asserts the the set of rsa given are equal.
*
* @param message A detail message to record if the assertion fails.
* @param expected A list of expected condition rsa.
* @param actual A set of condition rsa to compare against the ones expected.
*/
public static void assertSetOfTypesIsEqual(
final String message, final List<String> expected, final EnumSet<CryptoConditionType> actual
) {
final EnumSet<CryptoConditionType> expectedSet = CryptoConditionType
.getEnumOfTypesFromString(String.join(",", expected.toArray(new String[expected.size()])));
if (!expectedSet.containsAll(actual)) {
throw new AssertionError(message + " - expected does not contain all values from actual.");
}
expectedSet.removeAll(actual);
if (!expectedSet.isEmpty()) {
throw new AssertionError(message + " - expected contains values not in actual.");
}
}
示例4: makeComplementByHand
import java.util.EnumSet; //导入方法依赖的package包/类
private static <E extends Enum<E>> EnumSet<E> makeComplementByHand(
Collection<E> collection, Class<E> type) {
EnumSet<E> result = EnumSet.allOf(type);
result.removeAll(collection);
return result;
}