public static String[] enumOptions(Class<? extends Enum<?>> enumClass) {
        Objects.requireNonNull(enumClass);
        if (!enumClass.isEnum()) {
            throw new IllegalArgumentException("Class " + enumClass + " is not an enumerable type");
        }

        return Stream.of(enumClass.getEnumConstants())
                .map(Object::toString)
                .toArray(String[]::new);
    }
Get an array containing all of the {@link Object#toString string representations} of a given enumerable type.
@param enumClass the enum class; may not be null
@return an array with the names of every value for the enum class; never null, but may be empty
if there are no values defined for the enum
clients/src/main/java/org/apache/kafka/common/utils/Utils.java