Here you can find the source of getEnumConstants(Class> c)
Parameter | Description |
---|---|
c | The Enum you are targeting |
public static List<?> getEnumConstants(Class<?> c)
//package com.java2s; //License from project: Open Source License import java.util.Arrays; import java.util.List; public class Main { /**//from www .j a v a 2 s.c om * Returns all Enum Constants in an Enum * * @param c The Enum you are targeting * @return An ArrayList of all Enum Constants in that Enum */ public static List<?> getEnumConstants(Class<?> c) { return Arrays.asList(c.getEnumConstants()); } }