public final class ConstantUtils extends Object
Object.equals(Object) method. Constant
type implementations SHOULD provide adequate protection mechanisms to prevent changes of the constant values.| Modifier and Type | Method and Description |
|---|---|
static <T> Map<String,T> |
duplicates(Class<?> constantDefinition,
Class<T> constantType)
Inspects a constant definition class and returns all duplicate constant definitions of the given element type.
|
static String |
name(Class<?> constantDefinition,
Object constant)
Inspects a constant definition class and returns the constant's name.
|
static <T> T[] |
values(Class<?> constantDefinition,
Class<T> constantType)
Inspects a constant definition class and returns all constant definitions of the given element type.
|
public static <T> Map<String,T> duplicates(Class<?> constantDefinition, Class<T> constantType)
Object.equals(Object) method of the constant value is called.T - the constant element typeconstantDefinition - the constant definition classconstantType - the constant element typepublic static String name(Class<?> constantDefinition, Object constant)
constantDefinition - the constant definition classconstant - the constant element typenull if no equal constant was found in the definitionpublic static <T> T[] values(Class<?> constantDefinition, Class<T> constantType)
T - the constant element typeconstantDefinition - the constant definition classconstantType - the constant element typeCopyright © 2016 Lexmark Enterprise Software Deutschland GmbH. All rights reserved.