Java EnumSet Usage possibilities(Class enumClass)

Here you can find the source of possibilities(Class enumClass)

Description

possibilities

License

Apache License

Declaration

public static <ENUM extends Enum<ENUM>> Iterable<String> possibilities(Class<ENUM> enumClass) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;

public class Main {
    public static <ENUM extends Enum<ENUM>> Iterable<String> possibilities(Class<ENUM> enumClass) {
        EnumSet<ENUM> values = EnumSet.allOf(enumClass);
        List<String> result = new ArrayList<>(values.size());
        for (ENUM value : values) {
            result.add(value.toString());
        }//w  w  w  .  jav a  2s.  c  o  m
        return result;
    }
}

Related

  1. getDataFromEnum(Class enumClass)
  2. getDataInEnumClass(String enumClassName)
  3. getEnumFromString(Class enumClass, String enumValue, boolean compareByValue)
  4. nativeLoadEnumDefaultValues(Class enumType)
  5. nextEnum(T ce)
  6. rotateEnum(T ce, boolean backwards, EnumSet ValidOptions)
  7. setOnly(EnumSet theSet, E flag)
  8. valueOfIgnoreCase(String text, Class cls)
  9. valueOfOrNull(Class enumType, String name)