Java EnumSet Usage setOnly(EnumSet theSet, E flag)

Here you can find the source of setOnly(EnumSet theSet, E flag)

Description

set Only

License

Open Source License

Declaration

public static <E extends Enum<E>> EnumSet<E> setOnly(EnumSet<E> theSet, E flag) 

Method Source Code


//package com.java2s;
/*/*from ww  w. j av  a 2  s. c o m*/
 * Copyright (C) 2009 Emweb bvba, Leuven, Belgium.
 *
 * See the LICENSE file for terms of use.
 */

import java.util.EnumSet;

public class Main {
    public static <E extends Enum<E>> EnumSet<E> setOnly(EnumSet<E> theSet, E flag) {
        theSet.clear();
        theSet.add(flag);
        return theSet;
    }
}

Related

  1. getEnumFromString(Class enumClass, String enumValue, boolean compareByValue)
  2. nativeLoadEnumDefaultValues(Class enumType)
  3. nextEnum(T ce)
  4. possibilities(Class enumClass)
  5. rotateEnum(T ce, boolean backwards, EnumSet ValidOptions)
  6. valueOfIgnoreCase(String text, Class cls)
  7. valueOfOrNull(Class enumType, String name)
  8. valueOfOrNull(Class enumType, String name, boolean checkCase)