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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetName()getType()static UDFFinds a UDF by name in the UDFs of the given object.static UDFFinds a UDF by name in the UDFs of the given object.static UDFFinds a UDF by name in the UDFs of the given object.static UDFgetUDF(Collection<UDF> udfs, String name) Finds a UDF by name in a collection of UDF objects.static UDFgetUDF(Collection<UDF> udfs, String name, boolean fail) Finds a UDF by name in a collection of UDF objects.static UDFgetUDF(Collection<UDF> udfs, String name, boolean fail, String failMessage) Finds a UDF by name in a collection of UDF objects.static StringgetUDFValue(UDFHolder thing, String name) Finds a UDF by name in the UDFs of the given object and, if found, returns its value.static StringgetUDFValue(UDFHolder thing, String name, boolean fail) Finds a UDF by name in the UDFs of the given object and returns its value.static StringgetUDFValue(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 StringgetUDFValue(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 StringgetUDFValue(Collection<UDF> udfs, String name) Finds a UDF by name in a collection of UDF objects and, if found, returns its value.static StringgetUDFValue(Collection<UDF> udfs, String name, boolean fail) Finds a UDF by name in a collection of UDF objects and returns its value.static StringgetUDFValue(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 StringgetUDFValue(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()voidvoidstatic UDFAdds, sets or removes a UDF from the collection of fields on the given object.static UDFsetUDF(Collection<UDF> udfs, String name, Object value) Adds, sets or removes a UDF from the given collection of fields.voidtoString()
-
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
nullif there is no matching UDF. - Throws:
IllegalArgumentException- ifnameis 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
nullif there is no matching UDF. - Throws:
IllegalArgumentException- ifnameis 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
defaultValueif there is no matching UDF. - Throws:
IllegalArgumentException- ifnameis 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 aMissingUDFExceptionif the field is not found.- Returns:
- The UDF object with the same name, or
nullif there is no matching UDF andfailis false. - Throws:
IllegalArgumentException- ifnameis null.MissingUDFException- iffailis 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 aMissingUDFExceptionif the field is not found.- Returns:
- The value of the UDF, or
nullif there is no matching UDF andfailis false. - Throws:
IllegalArgumentException- ifnameis null.MissingUDFException- iffailis 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 aMissingUDFExceptionif the field is not found.failMessage- The message to put in theMissingUDFExceptionwhen such an exception is raised.- Returns:
- The UDF object with the same name, or
nullif there is no matching UDF andfailis false. - Throws:
IllegalArgumentException- ifnameis null.MissingUDFException- iffailis 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 aMissingUDFExceptionif the field is not found.failMessage- The message to put in theMissingUDFExceptionwhen such an exception is raised.- Returns:
- The value of the UDF, or
nullif there is no matching UDF andfailis false. - Throws:
IllegalArgumentException- ifnameis null.MissingUDFException- iffailis 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
nullif there is no matching UDF. - Throws:
IllegalArgumentException- ifnameis 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
nullif there is no matching UDF. - Throws:
IllegalArgumentException- ifnameis 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
defaultValueif there is no matching UDF. - Throws:
IllegalArgumentException- ifnameis 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 aMissingUDFExceptionif the field is not found.- Returns:
- The UDF object with the same name, or
nullif there is no matching UDF andfailis false. - Throws:
IllegalArgumentException- ifnameis null.MissingUDFException- iffailis 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 aMissingUDFExceptionif the field is not found.- Returns:
- The value of the UDF, or
nullif there is no matching UDF andfailis false. - Throws:
IllegalArgumentException- ifnameis null.MissingUDFException- iffailis 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 aMissingUDFExceptionif the field is not found.failMessage- The message to put in theMissingUDFExceptionwhen such an exception is raised.- Returns:
- The UDF object with the same name, or
nullif there is no matching UDF andfailis false. - Throws:
IllegalArgumentException- ifnameis null.MissingUDFException- iffailis 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 aMissingUDFExceptionif the field is not found.failMessage- The message to put in theMissingUDFExceptionwhen such an exception is raised.- Returns:
- The value of the UDF, or
nullif there is no matching UDF andfailis false. - Throws:
IllegalArgumentException- ifnameis null.MissingUDFException- iffailis 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 newUDFobject 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 ofthingornameare 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 newUDFobject 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 ofudfsornameare null.
-