Java Reflection Enum getEnumNames(Class> e)

Here you can find the source of getEnumNames(Class> e)

Description

get Enum Names

License

Apache License

Declaration

public static String[] getEnumNames(Class<? extends Enum<?>> e) 

Method Source Code

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

import java.util.Arrays;

public class Main {
    public static String[] getEnumNames(Class<? extends Enum<?>> e) {
        return Arrays.toString(e.getEnumConstants()).replaceAll("\\[|]", "").split(", ");
    }/*from  w ww. j  av a 2s  .  c  o m*/
}

Related

  1. getEnumConstants(Class c)
  2. getEnumValues(Class type)
  3. getOptionsFromEnum(Class> enumClass)
  4. isLegalEnum(Class clazz, Object enuValue)
  5. toEnum(Class e, String s)