Class DataField

  • All Implemented Interfaces:
    Serializable

    public class DataField
    extends Object
    implements Serializable
    The DataField class is an object container class which provides multiple cast methods to retrieve the initially stored object in different formats / types.
    See Also:
    Serialized Form
    • Constructor Detail

      • DataField

        public DataField​(Object value)
        Creates the DataField object with the given object as the DataField's value
        Parameters:
        value - The value object of the DataField to be created
    • Method Detail

      • getValue

        public Object getValue()
        Returns the DataField's value.
        Returns:
        value the DataField's value
      • equals

        public Boolean equals​(DataField dataField)
        Returns true in case the given DataField object equals the current DataField object, false otherwise. The method does only compare the value object of both DataField objects, not the attributes.
        Parameters:
        dataField - The DataField object to compare with.
        Returns:
        equal The boolean value indicating whether the given DataField object equals this DataField object.
      • equals

        public Boolean equals​(String pattern)
        Returns true in case the given DataField object equals the current DataField object, false otherwise. The method does only compare the value object of both DataField objects, not the attributes.
        Parameters:
        pattern - The DataField object to compare with.
        Returns:
        equal The boolean value indicating whether the given DataField object equals this DataField object.
      • equals

        public Boolean equals​(String pattern,
                              boolean caseSensitive,
                              boolean trimmed)
        Returns true in case the given DataField object equals the current DataField object, false otherwise. The method does only compare the value object of both DataField objects, not the attributes.
        Parameters:
        pattern - The DataField object to compare with.
        Returns:
        equal The boolean value indicating whether the given DataField object equals this DataField object.
      • setValue

        public void setValue​(Object value)
        Sets the given object as the DataField's value
        Parameters:
        value - The object to set as the DataField's value
      • getClassName

        public String getClassName()
        Returns the class name of the DataField's value object.
        Returns:
        className The DataField value's class name.
      • getObject

        public Object getObject()
        Returns the DataField's value.
        Returns:
        value The DataField's value.
      • getString

        public String getString()
        Returns the DataField's value as java.lang.String object.
        Returns:
        value The DataField's value as java.lang.String object.
      • getInt

        public Integer getInt()
        Returns the DataField's value as java.lang.Integer object.
        Returns:
        value The DataField's value as java.lang.Integer object.
      • getByte

        public Byte getByte()
        Returns the DataField's value as java.lang.Byte object.
        Returns:
        value The DataField's value as java.lang.Byte object.
      • getShort

        public Short getShort()
        Returns the DataField's value as java.lang.Short object.
        Returns:
        value The DataField's value as java.lang.Short object.
      • getLong

        public Long getLong()
        Returns the DataField's value as java.lang.Long object.
        Returns:
        value The DataField's value as java.lang.Long object.
      • getBigDecimal

        public BigDecimal getBigDecimal()
        Returns the DataField's value as java.math.BigDecimal object.
        Returns:
        value The DataField's value as java.math.BigDecimal object.
      • getDouble

        public Double getDouble()
        Returns the DataField's value as java.lang.Double object.
        Returns:
        value The DataField's value as java.lang.Double object.
      • getFloat

        public Float getFloat()
        Returns the DataField's value as java.lang.Float object.
        Returns:
        value The DataField's value as java.lang.Float object.
      • getDate

        public Date getDate()
        Returns the DataField's value as java.sql.Date object.
        Returns:
        value The DataField's value as java.sql.Date object.
      • getTime

        public Time getTime()
        Returns the DataField's value as java.sql.Time object.
        Returns:
        value The DataField's value as java.sql.Time object.
      • getTimestamp

        public Timestamp getTimestamp()
        Returns the DataField's value as java.sql.Timestamp object.
        Returns:
        value The DataField's value as java.sql.Timestamp object.
      • getBytes

        public byte[] getBytes()
        Returns the DataField's value as byte array.
        Returns:
        value The DataField's value as byte array.
      • getArray

        public Array getArray()
        Returns the DataField's value as java.sql.Array object.
        Returns:
        value The DataField's value as java.sql.Array object.
      • getBlob

        public Blob getBlob()
        Returns the DataField's value as java.sql.Blob object.
        Returns:
        value The DataField's value as java.sql.Blob object.
      • getClob

        public Clob getClob()
        Returns the DataField's value as java.sql.Clob object.
        Returns:
        value The DataField's value as java.sql.Clob object.
      • getNClob

        public NClob getNClob()
        Returns the DataField's value as java.sql.NClob object.
        Returns:
        value The DataField's value as java.sql.NClob object.
      • getBoolean

        public Boolean getBoolean()
        Returns the DataField's value as java.lang.Boolean object.
        Returns:
        value The DataField's value as java.lang.Boolean object.
      • getRef

        public Ref getRef()
        Returns the DataField's value as java.sql.Ref object.
        Returns:
        value The DataField's value as java.sql.Ref object.
      • getURL

        public URL getURL()
        Returns the DataField's value as java.net.URL object.
        Returns:
        value The DataField's value as java.net.URL object.
      • getSQLXML

        public SQLXML getSQLXML()
        Returns the DataField's value as java.sql.SQLXML object.
        Returns:
        value The DataField's value as java.sql.SQLXML object.
      • getEtag

        public String getEtag()
      • setAttribute

        public void setAttribute​(String attributeName,
                                 String attributeValue)
        Sets the value of the attribute with the given name. Creates the attribute if it doesn't exist.
        Parameters:
        attributeName - The attribute's name.
        attributeValue - The attribute's value.
      • setAttribute

        public void setAttribute​(String attributeName,
                                 Attribute attributeValue)
      • getAttribute

        public String getAttribute​(String attributeName)
        Returns the value for the given attribute name. null is returned if no attribute matches the given name.
        Parameters:
        attributeName - The attribute's name.
        Returns:
        attributeValue The attribute's value.
      • getAttributes

        public Map<String,​String> getAttributes()
        Returns a java.util.HashMap object with the DataField's attributes and their corresponding value.
        Returns:
        attributesMap The java.util.HashMap object containing the DataField's attributes and their values.
      • setAttributes

        public void setAttributes​(Map<String,​String> attributes)
        Sets the attributes for this DataField.
        Parameters:
        attributes - The attribute's java.util.HashMap object with the attributes and their corresponding values.
      • removeAttribute

        public void removeAttribute​(String attributeName)
        Removes the attribute with the given name. Nothing happens in case the name doesn't exist.
        Parameters:
        attributeName - The name of the attribute to remove.
      • clear

        public void clear()
        Sets the DataField's value to null
      • convertType

        public static Object convertType​(Object o,
                                         int targetType)
      • createEtag

        public String createEtag()