java.lang.Object
com.genologics.ri.userdefined.UDF
- All Implemented Interfaces:
Serializable
Field is the value and data type of a user-defined field.
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetName()
getType()
static UDF
Finds a UDF by name in the UDFs of the given object.static UDF
Finds a UDF by name in the UDFs of the given object.static UDF
Finds a UDF by name in the UDFs of the given object.static UDF
getUDF
(Collection<UDF> udfs, String name) Finds a UDF by name in a collection of UDF objects.static UDF
getUDF
(Collection<UDF> udfs, String name, boolean fail) Finds a UDF by name in a collection of UDF objects.static UDF
getUDF
(Collection<UDF> udfs, String name, boolean fail, String failMessage) Finds a UDF by name in a collection of UDF objects.static String
getUDFValue
(UDFHolder thing, String name) Finds a UDF by name in the UDFs of the given object and, if found, returns its value.static String
getUDFValue
(UDFHolder thing, String name, boolean fail) Finds a UDF by name in the UDFs of the given object and returns its value.static String
getUDFValue
(UDFHolder thing, String name, boolean fail, String failMessage) Finds a UDF by name in the UDFs of the given object and returns its value.static String
getUDFValue
(UDFHolder thing, String name, String defaultValue) Finds a UDF by name in the UDFs of the given object and, if found, returns its value.static String
getUDFValue
(Collection<UDF> udfs, String name) Finds a UDF by name in a collection of UDF objects and, if found, returns its value.static String
getUDFValue
(Collection<UDF> udfs, String name, boolean fail) Finds a UDF by name in a collection of UDF objects and returns its value.static String
getUDFValue
(Collection<UDF> udfs, String name, boolean fail, String failMessage) Finds a UDF by name in a collection of UDF objects and returns its value.static String
getUDFValue
(Collection<UDF> udfs, String name, String defaultValue) Finds a UDF by name in a collection of UDF objects and, if found, returns its value.getUnit()
getValue()
void
void
static UDF
Adds, sets or removes a UDF from the collection of fields on the given object.static UDF
setUDF
(Collection<UDF> udfs, String name, Object value) Adds, sets or removes a UDF from the given collection of fields.void
toString()
-
Field Details
-
name
-
type
-
unit
-
value
-
-
Constructor Details
-
UDF
public UDF() -
UDF
-
UDF
-
UDF
-
-
Method Details
-
getValue
-
setValue
-
getUnit
-
getName
-
setName
-
getType
-
setType
-
toString
-
getUDF
Finds a UDF by name in a collection of UDF objects.- Parameters:
udfs
- The collection to search.name
- The name of the UDF to find.- Returns:
- The UDF object with the same name, or
null
if there is no matching UDF. - Throws:
IllegalArgumentException
- ifname
is null.
-
getUDFValue
Finds a UDF by name in a collection of UDF objects and, if found, returns its value.- Parameters:
udfs
- The collection to search.name
- The name of the UDF to find.- Returns:
- The value of the UDF, or
null
if there is no matching UDF. - Throws:
IllegalArgumentException
- ifname
is null.
-
getUDFValue
Finds a UDF by name in a collection of UDF objects and, if found, returns its value.- Parameters:
udfs
- The collection to search.name
- The name of the UDF to find.defaultValue
- The value to return if there is no matching UDF.- Returns:
- The value of the UDF, or
defaultValue
if there is no matching UDF. - Throws:
IllegalArgumentException
- ifname
is null.- Since:
- 2.22
-
getUDF
Finds a UDF by name in a collection of UDF objects.- Parameters:
udfs
- The collection to search.name
- The name of the UDF to find.fail
- Whether to fail with aMissingUDFException
if the field is not found.- Returns:
- The UDF object with the same name, or
null
if there is no matching UDF andfail
is false. - Throws:
IllegalArgumentException
- ifname
is null.MissingUDFException
- iffail
is true and there is no matching UDF.
-
getUDFValue
Finds a UDF by name in a collection of UDF objects and returns its value.- Parameters:
udfs
- The collection to search.name
- The name of the UDF to find.fail
- Whether to fail with aMissingUDFException
if the field is not found.- Returns:
- The value of the UDF, or
null
if there is no matching UDF andfail
is false. - Throws:
IllegalArgumentException
- ifname
is null.MissingUDFException
- iffail
is true and there is no matching UDF.
-
getUDF
Finds a UDF by name in a collection of UDF objects.- Parameters:
udfs
- The collection to search.name
- The name of the UDF to find.fail
- Whether to fail with aMissingUDFException
if the field is not found.failMessage
- The message to put in theMissingUDFException
when such an exception is raised.- Returns:
- The UDF object with the same name, or
null
if there is no matching UDF andfail
is false. - Throws:
IllegalArgumentException
- ifname
is null.MissingUDFException
- iffail
is true and there is no matching UDF.
-
getUDFValue
public static String getUDFValue(Collection<UDF> udfs, String name, boolean fail, String failMessage) Finds a UDF by name in a collection of UDF objects and returns its value.- Parameters:
udfs
- The collection to search.name
- The name of the UDF to find.fail
- Whether to fail with aMissingUDFException
if the field is not found.failMessage
- The message to put in theMissingUDFException
when such an exception is raised.- Returns:
- The value of the UDF, or
null
if there is no matching UDF andfail
is false. - Throws:
IllegalArgumentException
- ifname
is null.MissingUDFException
- iffail
is true and there is no matching UDF.
-
getUDF
Finds a UDF by name in the UDFs of the given object.- Parameters:
thing
- The object that holds UDFs.name
- The name of the UDF to find.- Returns:
- The UDF object with the same name, or
null
if there is no matching UDF. - Throws:
IllegalArgumentException
- ifname
is null.
-
getUDFValue
Finds a UDF by name in the UDFs of the given object and, if found, returns its value.- Parameters:
thing
- The object that holds UDFs.name
- The name of the UDF to find.- Returns:
- The value of the UDF, or
null
if there is no matching UDF. - Throws:
IllegalArgumentException
- ifname
is null.
-
getUDFValue
Finds a UDF by name in the UDFs of the given object and, if found, returns its value.- Parameters:
thing
- The object that holds UDFs.name
- The name of the UDF to find.defaultValue
- The value to return if there is no matching UDF.- Returns:
- The value of the UDF, or
defaultValue
if there is no matching UDF. - Throws:
IllegalArgumentException
- ifname
is null.- Since:
- 2.22
-
getUDF
Finds a UDF by name in the UDFs of the given object.- Parameters:
thing
- The object that holds UDFs.name
- The name of the UDF to find.fail
- Whether to fail with aMissingUDFException
if the field is not found.- Returns:
- The UDF object with the same name, or
null
if there is no matching UDF andfail
is false. - Throws:
IllegalArgumentException
- ifname
is null.MissingUDFException
- iffail
is true and there is no matching UDF.
-
getUDFValue
Finds a UDF by name in the UDFs of the given object and returns its value.- Parameters:
thing
- The object that holds UDFs.name
- The name of the UDF to find.fail
- Whether to fail with aMissingUDFException
if the field is not found.- Returns:
- The value of the UDF, or
null
if there is no matching UDF andfail
is false. - Throws:
IllegalArgumentException
- ifname
is null.MissingUDFException
- iffail
is true and there is no matching UDF.
-
getUDF
Finds a UDF by name in the UDFs of the given object.- Parameters:
thing
- The object that holds UDFs.name
- The name of the UDF to find.fail
- Whether to fail with aMissingUDFException
if the field is not found.failMessage
- The message to put in theMissingUDFException
when such an exception is raised.- Returns:
- The UDF object with the same name, or
null
if there is no matching UDF andfail
is false. - Throws:
IllegalArgumentException
- ifname
is null.MissingUDFException
- iffail
is true and there is no matching UDF.
-
getUDFValue
Finds a UDF by name in the UDFs of the given object and returns its value.- Parameters:
thing
- The object that holds UDFs.name
- The name of the UDF to find.fail
- Whether to fail with aMissingUDFException
if the field is not found.failMessage
- The message to put in theMissingUDFException
when such an exception is raised.- Returns:
- The value of the UDF, or
null
if there is no matching UDF andfail
is false. - Throws:
IllegalArgumentException
- ifname
is null.MissingUDFException
- iffail
is true and there is no matching UDF.
-
setUDF
Adds, sets or removes a UDF from the collection of fields on the given object. If the named UDF exists in the collection, it either has its value set (if "value" is not null) or is removed (if "value" is null). If it doesn't exist, a newUDF
object is created for the field and is added to the collection.- Parameters:
thing
- The object containing UDFs.name
- The name of the field to change.value
- The value to set the field to.- Returns:
- The UDF object found or created, or null if it is removed or not found.
- Throws:
IllegalArgumentException
- if either ofthing
orname
are null.
-
setUDF
Adds, sets or removes a UDF from the given collection of fields. If the named UDF exists in the collection, it either has its value set (if "value" is not null) or is removed (if "value" is null). If it doesn't exist, a newUDF
object is created for the field and is added to the collection.- Parameters:
udfs
- The collection of UDF objects.name
- The name of the field to change.value
- The value to set the field to.- Returns:
- The UDF object found or created, or null if it is removed or not found.
- Throws:
IllegalArgumentException
- if either ofudfs
orname
are null.
-