javax.annotation.meta

Class When

public class When extends Enum<When>

Used to describe the relationship between a qualifier T and the set of values S possible on an annotated element. In particular, an issues should be reported if an ALWAYS or MAYBE value is used where a NEVER value is required, or if a NEVER or MAYBE value is used where an ALWAYS value is required.
Field Summary
static WhenALWAYS
S is a subset of T
static WhenMAYBE
S intersection T is non empty and S - T is nonempty
static WhenNEVER
S intersection T is empty
static WhenUNKNOWN
nothing definitive is known about the relation between S and T
static List<When>VALUES
An immutable list containing the values comprising this enum class in the order they're declared.
Method Summary
List<When>family()
Returns an immutable list containing the values comprising this enum class in the order they're declared.
static WhenvalueOf(String name)
Static factory to return the enum constant pertaining to the given string name.

Field Detail

ALWAYS

public static final When ALWAYS
S is a subset of T

MAYBE

public static final When MAYBE
S intersection T is non empty and S - T is nonempty

NEVER

public static final When NEVER
S intersection T is empty

UNKNOWN

public static final When UNKNOWN
nothing definitive is known about the relation between S and T

VALUES

public static final List<When> VALUES
An immutable list containing the values comprising this enum class in the order they're declared. This field may be used to iterate over the constants as follows:
for(When c : When.VALUES)
    System.out.println(c);

Method Detail

family

public final List<When> family()
Returns an immutable list containing the values comprising this enum class in the order they're declared. This instance method simply returns VALUES. Few programmers should have any need to use this method. It is provided for use by sophisticated enum-based data structures to prevent the need for reflective access to VALUES.

Returns: an immutable list containing the values comprising this enum class, in the order they're declared.

valueOf

public static final When valueOf(String name)
Static factory to return the enum constant pertaining to the given string name. The string must match exactly an identifier used to declare an enum constant in this type.

Throws: IllegalArgumentException if this enum class has no constant with the specified name.

Copyright © {inceptionYear}-2008 null. All Rights Reserved.