Class ContentField<T>

java.lang.Object
com.oracle.content.sdk.model.AssetObject
com.oracle.content.sdk.model.field.ContentField<T>
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ContentFieldBoolean, ContentFieldDate, ContentFieldDecimal, ContentFieldInteger, ContentFieldJson, ContentFieldReference, ContentFieldReferenceList, ContentFieldText, ContentFieldTextList, ContentFieldUnknown

public abstract class ContentField<T> extends AssetObject
Abstract base class for all field types. T is the type (Boolean, String) of the value of the field.
See Also:
  • Field Details

    • value

      protected final T value
    • fieldType

      protected final FieldType fieldType
  • Constructor Details

    • ContentField

      protected ContentField(T value, FieldType fieldType)
  • Method Details

    • getType

      public FieldType getType()
      Return the type for the field.
      Returns:
      type
    • getValueAsString

      public String getValueAsString()
      Return a single string representation of the field value, regardless of the type. This works to get a string representation of primitive types like integer, decimal, text as a string but will only return the name of more complex types like references.
      Returns:
      String representation of value for field
    • getValue

      public T getValue()
      Get the java object representation of the field. For example, text would be String, number would be an Integer, Date would a ContentDate.
      Returns:
      String representation of value for field
    • toString

      public String toString()
      String representation of the field for debugging purposes, which includes the type.
      Overrides:
      toString in class Object
      Returns:
      string value of the field