- 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 UDFFinds a UDF by name.default UDFFinds a UDF by name.default UDFFinds a UDF by name.getUdfs()Another alternative forgetUserDefinedFieldsthat 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 StringgetUDFValue(String name) Finds a UDF by name and, if found, returns its value.default StringgetUDFValue(String name, boolean fail) Finds a UDF by name and returns its value.default StringgetUDFValue(String name, boolean fail, String failMessage) Finds a UDF by name and return its value.default StringgetUDFValue(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 UDFAdds, 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 forgetUserDefinedFieldsthat 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
nullif there is no matching UDF. - Throws:
IllegalArgumentException- ifnameis 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
nullif there is no matching UDF. - Throws:
IllegalArgumentException- ifnameis 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
defaultValueif there is no matching UDF. - Throws:
IllegalArgumentException- ifnameis 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 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.- 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 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.- Since:
- 2.31.5
-
getUDF
Finds a UDF by name.- Parameters:
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 and return its value.- Parameters:
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.- 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 newUDFobject 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- ifnameis null.- Since:
- 2.31.5
-