- All Known Implementing Classes:
Artifact
,ClarityProcess
,Container
,ExecutableProcess
,Lab
,ProcessTemplate
,Project
,Researcher
,Sample
,SampleBase
,SampleCreation
,StepDetails
,UDT
public interface UDFHolder
Interface for any entity or other object that holds user defined
fields (UDFs).
- Since:
- 2.31
-
Method Summary
Modifier and TypeMethodDescriptiondefault UDF
Finds a UDF by name.default UDF
Finds a UDF by name.default UDF
Finds a UDF by name.getUdfs()
Another alternative forgetUserDefinedFields
that is more pleasant on the eye when used in Groovy or other scripting systems where the property is accessed as if it were a field.getUDFs()
Alternative method used as a shorthand forgetUserDefinedFields
.default String
getUDFValue
(String name) Finds a UDF by name and, if found, returns its value.default String
getUDFValue
(String name, boolean fail) Finds a UDF by name and returns its value.default String
getUDFValue
(String name, boolean fail, String failMessage) Finds a UDF by name and return its value.default String
getUDFValue
(String name, String defaultValue) Finds a UDF by name and, if found, returns its value.Get a list of user defined fields held by the entity.default UDF
Adds, sets or removes a UDF.
-
Method Details
-
getUserDefinedFields
Get a list of user defined fields held by the entity.- Returns:
- A list of UDF objects. This should never return null.
-
getUDFs
Alternative method used as a shorthand forgetUserDefinedFields
.- Returns:
- A list of UDF objects.
-
getUdfs
Another alternative forgetUserDefinedFields
that is more pleasant on the eye when used in Groovy or other scripting systems where the property is accessed as if it were a field.- Returns:
- A list of UDF objects.
-
getUDF
Finds a UDF by name.- Parameters:
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.- Since:
- 2.31.5
-
getUDFValue
Finds a UDF by name and, if found, returns its value.- Parameters:
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.- Since:
- 2.31.5
-
getUDFValue
Finds a UDF by name and, if found, returns its value.- Parameters:
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.31.5
-
getUDF
Finds a UDF by name.- Parameters:
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.- Since:
- 2.31.5
-
getUDFValue
Finds a UDF by name and returns its value.- Parameters:
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.- Since:
- 2.31.5
-
getUDF
Finds a UDF by name.- Parameters:
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 and return its value.- Parameters:
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.- Since:
- 2.31.5
-
setUDF
Adds, sets or removes a UDF. If the named UDF exists, 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.- Parameters:
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
- ifname
is null.- Since:
- 2.31.5
-