public class KeyTool extends Object
UNDEFINED_VALUE_BYTE, and methods to test if an
attribute is indeed defined.| Modifier and Type | Field and Description |
|---|---|
static boolean |
UNDEFINED_VALUE_BOOLEAN
The default UNDEFINED value for a boolean primitive (which is false).
|
static byte |
UNDEFINED_VALUE_BYTE
The default UNDEFINED value for a byte primitive (which is 0).
|
static char |
UNDEFINED_VALUE_CHAR
The default UNDEFINED value for a char primitive (which is 0).
|
static double |
UNDEFINED_VALUE_DOUBLE
The default UNDEFINED value for a double primitive (which is 0.0).
|
static float |
UNDEFINED_VALUE_FLOAT
The default UNDEFINED value for a float primitive (which is 0.0).
|
static int |
UNDEFINED_VALUE_INT
The default UNDEFINED value for an integer primitive (which is 0).
|
static long |
UNDEFINED_VALUE_LONG
The default UNDEFINED value for a long primitive (which is 0).
|
static String |
UNDEFINED_VALUE_STRING
The default UNDEFINED value for a String (which is an empty String).
|
| Constructor and Description |
|---|
KeyTool() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
attributesDefined(Object instance,
OSRole<?> role,
AttributeConstant[] attributes)
Check if the specified instance contains defined values for all the
attributes specified attribute array (see various
isDefined
methods). |
static Key |
getCompleteUniqueKey(Object instance,
OSRole<?> role)
Searches the specified instance for a defined key (a key where all
attributes are defined), and returns the name of the first completely
defined key.
|
static boolean |
isDefined(boolean primitive)
Check if the specified primitive is defined.
|
static boolean |
isDefined(Boolean b)
Check if the specified primitive wrapper is defined.
|
static boolean |
isDefined(byte primitive)
Check if the specified primitive is defined.
|
static boolean |
isDefined(Byte b)
Check if the specified primitive wrapper is defined.
|
static boolean |
isDefined(char primitive)
Check if the specified primitive is defined.
|
static boolean |
isDefined(Character c)
Check if the specified primitive wrapper is defined.
|
static boolean |
isDefined(double primitive)
Check if the specified primitive is defined.
|
static boolean |
isDefined(Double d)
Check if the specified primitive wrapper is defined.
|
static boolean |
isDefined(float primitive)
Check if the specified primitive is defined.
|
static boolean |
isDefined(Float f)
Check if the specified primitive wrapper is defined.
|
static boolean |
isDefined(int primitive)
Check if the specified primitive is defined.
|
static boolean |
isDefined(Integer i)
Check if the specified primitive wrapper is defined.
|
static boolean |
isDefined(long primitive)
Check if the specified primitive is defined.
|
static boolean |
isDefined(Long l)
Check if the specified primitive wrapper is defined.
|
static boolean |
isDefined(Object o)
Check if the specified object is defined.
|
static boolean |
isDefined(String s)
Check if the specified String is defined.
|
public static final byte UNDEFINED_VALUE_BYTE
public static final char UNDEFINED_VALUE_CHAR
public static final int UNDEFINED_VALUE_INT
public static final long UNDEFINED_VALUE_LONG
public static final float UNDEFINED_VALUE_FLOAT
public static final double UNDEFINED_VALUE_DOUBLE
public static final boolean UNDEFINED_VALUE_BOOLEAN
public static final String UNDEFINED_VALUE_STRING
public static Key getCompleteUniqueKey(Object instance, OSRole<?> role)
instance - the instance.role - the instance role.public static boolean attributesDefined(Object instance, OSRole<?> role, AttributeConstant[] attributes)
isDefined
methods).instance - the instance to check attributes in.role - the object selection role of the instance.attributes - an array containing the attribute names.true if all values defined by the attribute array
are defined.public static boolean isDefined(byte primitive)
primitive - the value to verifyfalse if the specified value equals the primitive's
UNDEFINED value, otherwise trueUNDEFINED_VALUE_BYTEpublic static boolean isDefined(Byte b)
null and the wrapped primitive value
is defined.b - the wrapper to verify.false if the wrapper is either null or
wrapped primitive equals the primitive's UNDEFINED value.public static boolean isDefined(char primitive)
primitive - the value to verifyfalse if the specified value equals the primitive's
UNDEFINED value, otherwise true.UNDEFINED_VALUE_CHARpublic static boolean isDefined(Character c)
null and the wrapped primitive value
is defined.c - the wrapper to verify.false if the wrapper is either null or
wrapped primitive equals the primitive's UNDEFINED value.isDefined(char)public static boolean isDefined(int primitive)
primitive - the value to verifyfalse if the specified value equals the primitive's
UNDEFINED value, otherwise true.UNDEFINED_VALUE_INTpublic static boolean isDefined(Integer i)
null and the wrapped primitive value
is defined.i - the wrapper to verify.false if the wrapper is either null or
wrapped primitive equals the primitive's UNDEFINED value.isDefined(int)public static boolean isDefined(long primitive)
primitive - the value to verifyfalse if the specified value equals the primitive's
UNDEFINED value, otherwise true.UNDEFINED_VALUE_LONGpublic static boolean isDefined(Long l)
null and the wrapped primitive value
is defined.l - the wrapper to verify.false if the wrapper is either null or
wrapped primitive equals the primitive's UNDEFINED value.isDefined(long)public static boolean isDefined(float primitive)
primitive - the value to verifyfalse if the specified value equals the primitive's
UNDEFINED value, otherwise true.UNDEFINED_VALUE_FLOATpublic static boolean isDefined(Float f)
null and the wrapped primitive value
is defined.f - the wrapper to verify.false if the wrapper is either null or
wrapped primitive equals the primitive's UNDEFINED value.isDefined(float)public static boolean isDefined(double primitive)
primitive - the value to verifyfalse if the specified value equals the primitive's
UNDEFINED value, otherwise true.UNDEFINED_VALUE_DOUBLEpublic static boolean isDefined(Double d)
null and the wrapped primitive value
is defined.d - the wrapper to verify.false if the wrapper is either null or
wrapped primitive equals the primitive's UNDEFINED value.isDefined(double)public static boolean isDefined(boolean primitive)
primitive - the value to verifyfalse if the specified value equals the primitive's
UNDEFINED value, otherwise true.UNDEFINED_VALUE_BOOLEANpublic static boolean isDefined(Boolean b)
null and the wrapped primitive value
is defined.b - the wrapper to verify.false if the wrapper is either null or
wrapped primitive equals the primitive's UNDEFINED value.public static boolean isDefined(String s)
s - the String to verifyfalse if the specified String is null or of zero
length.UNDEFINED_VALUE_STRINGpublic static boolean isDefined(Object o)
null reference.
If the object is a primitive wrapper (Byte, Character, Integer, Long,
Float or Double), or a String, the reference is narrowed and the
corresponding isDefined method is invoked (e.g. if this method is invoked
with an Integer reference, the object is casted to an Integer, and the
isDefined(Integer) method is invoked).
o - the value to verifyfalse if the specified value is undefined, otherwise
true.Copyright © 2006–2018 Esito AS. All rights reserved.