EnumField

@Target(allowedTargets = [AnnotationTarget.FIELD])
annotation class EnumField(val describedBy: KClass<out IntegerEnumSlotDescriptionEnum>, val lookupMethodName: String = "")

EnumField annotation is used to indicate which enumeration should be used to describe an integer value embedded in an integer slot that has this annotation. This is used for pretty-printing AvailObjects.

Author

Mark van Gulik

Types

Link copied to clipboard

A helper class for presenting values for IntegerSlotsEnum and BitFields in alternative ways, for example as decimal numbers.

Properties

Link copied to clipboard

This annotation field indicates the Enum responsible for describing the integer slot to which the annotation is applied. The value of the field (an int) should equal an ordinal of a member of the specified enum. If a lookupMethodName is also specified then the int value may be something other than the Enum's ordinal.

Link copied to clipboard

This optional annotation field indicates the name of a static method defined within the describing enumeration. The method should take an int argument and return an instance of the #describedBy() enumeration or null. If null, only the numeric value is displayed, otherwise the enumeration value's name is displayed. If this annotation field is omitted, the value of the field is treated as the ordinal to look up. Similarly, in this case an ordinal that is out of range will only display its numeric value.