std.lib.enum

+enum-map

create-enum

added in 3.0

(create-enum s type)

creates an enum value from a string

(create-enum “TYPE” ElementType) => ElementType/TYPE

enum-map

added in 3.0

(enum-map type)

cached map of enum values

enum-map-form

added in 3.0

(enum-map-form type)

creates the form for the enum

enum-map-raw

(enum-map-raw type)

helper function for std.lib.enum/enum-map

enum-map>

macro

added in 3.0

(enum-map> type)

a macro for getting elements of the enum

enum-values

added in 3.0

(enum-values type)

returns all values of an enum type

(->> (enum-values ElementType) (map str)) => (contains [“TYPE” “FIELD” “METHOD” “PARAMETER” “CONSTRUCTOR”] :in-any-order :gaps-ok)

enum?

added in 3.0

(enum? type)

check to see if class is an enum type

(enum? java.lang.annotation.ElementType) => true

(enum? String) => false

to-enum

added in 3.0

(to-enum s type)

gets an enum value given a symbol

(to-enum “TYPE” ElementType) => ElementType/TYPE

(to-enum :field ElementType) => ElementType/FIELD