Interface BusinessObject


public interface BusinessObject
Provides a convenient mechanism to retrieve and modify an instance of a business object.

Supported API: true

Extendable: false
This class is not thread safe. It is the responsibility of users of this class to ensure it is handled correctly if used in multiple threads.
  • Method Details

    • get

      Object get(BusinessField businessField) throws WTException
      Get the value(s) of the field.

      Supported API: true
      Parameters:
      businessField - The field to get the value(s) for.
      Returns:
      The value(s) of the field. This could be null if there are no value(s) or if the field passed in is null. It could return an array of objects if the field supports multiple values.
      Throws:
      WTException - If the field is applicable to the business object, but has not been loaded yet. If there were errors retrieving the value for the field.
    • getConstraintDescriptor

      default ConstraintSummary getConstraintDescriptor(BusinessField businessField) throws WTException
      Get the constraint descriptor for the specified business field.

      Supported API: true
      Parameters:
      businessField - The field to get the constraint descriptor for.
      Returns:
      The constraint descriptor to the field. This could be null if the constraints weren't loaded for the field or if the field passed in is null.
      Throws:
      WTException - If the field is applicable to the business object, but has not been loaded yet. If there were errors retrieving the constraint descriptor for the field.
    • set

      Object set(BusinessField businessField, Object value) throws WTException
      Set the value(s) of the field.

      Supported API: true
      Parameters:
      businessField - The field to set the value(s) for.
      value - The value(s) to set for the field. It could return an array of objects if the field supports multiple values.
      Returns:
      The value(s) actually set for the field. It could return an array of objects if the field supports multiple values. This is not necessarily the value that was passed to be set. There can be data conversion if the value passed in is a String but the datatype of the business field is something that can be converted from a String. Also, constraints can modify the value that actually gets set (e.g. convert a string to upper case).
      Throws:
      WTException
    • markAsLoaded

      void markAsLoaded(Collection<BusinessField> businessFields) throws WTException
      Marks the business fields which are applicable to this business object as loaded. This affects the value(s) and constraints of the objects attributes.

      Supported API: true
      Parameters:
      businessFields - The fields to mark as loaded.
      Throws:
      WTException
    • markAsLoaded

      void markAsLoaded(BusinessFieldNamespaceIdentifier namespace) throws WTException
      Marks all the namespace's fields which are applicable to this business object as loaded. This affects the value(s) and constraints of the object's attributes.

      Supported API: true
      Parameters:
      namespace - The namespace whose fields should be marked as loaded.
      Throws:
      WTException - If there were errors marking the namespace's fields as loaded.
    • getWTReference

      default WTReference getWTReference() throws WTException
      Get the reference for the object behind this instance.

      Supported API: true
      Returns:
      The reference for the object behind this instance. Will return null if the object has not yet been persisted.
      Throws:
      WTException - If there were errors getting the reference.
    • getTypeIdentifier

      default TypeIdentifier getTypeIdentifier() throws WTException
      Get the type identifier for the object behind this instance.

      Supported API: true
      Returns:
      The type identifier for the object behind this instance. Will not return null.
      Throws:
      WTException - If there were errors getting the type identifier.
    • validate

      void validate() throws ConstraintException
      Validate the values of the loaded fields. If all values for loaded fields are valid, nothing happens.

      Supported API: true
      Throws:
      ConstraintException - For the first invalid value encountered for a loaded field.