Class DataType

java.lang.Object
com.aquima.interactions.foundation.DataType
All Implemented Interfaces:
Serializable

public final class DataType extends Object implements Serializable
This class defines all the data types that are supported by the foundation.
Since:
5.0
Author:
O. Kerpershoek, F. v.d. Meer
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    This interface holds the numeric id's of the various data types.
    static final class 
    This class holds the names of the various data types.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final DataType
    Predefined data type for the Any type.
    static final DataType
     
    static final DataType
    Predefined data type for the Boolean type (true or false).
    static final DataType
    Predefined data type for the Currency type.
    static final DataType
    Predefined data type for the Date type.
    static final DataType
    Predefined data type for the datetime type.
    static final DataType
    Predefined data type for the Entity type.
    static final DataType
    Predefined data type for the Integer type.
    static final DataType
    Predefined data type for the Number type.
    static final DataType
    Predefined data type for the Percentage type.
    static final DataType
    Predefined data type for the String type.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    This method will compare this instance against the object passed to the method, and return true when both are identical.
    static DataType
    This method returns the data type matching the specified name.
    int
    This method return the unique id of this data type.
    This method return the name of the datatype.
    int
    This method returns a hash code based on the id of the data type.
    boolean
    This method returns true when the data type represents a date.
    boolean
    This method returns true when the data type represents a number.
    This method returns a string containing descriptive information about this datatype.
    static DataType
    This method tries to determine the data type of the object passed to the method.
    static DataType
    valueOf(int id)
    This method can be used to lookup a DataType instance of an id.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • ANY

      public static final DataType ANY
      Predefined data type for the Any type. The any type is a special case data type in the sense that it represents all known data types.
    • BINARY

      public static final DataType BINARY
    • BOOLEAN

      public static final DataType BOOLEAN
      Predefined data type for the Boolean type (true or false).
    • STRING

      public static final DataType STRING
      Predefined data type for the String type.
    • INTEGER

      public static final DataType INTEGER
      Predefined data type for the Integer type. This type is used for natural and negative numbers including zero.
    • NUMBER

      public static final DataType NUMBER
      Predefined data type for the Number type. Numbers include both integers and rational numbers.
    • DATE

      public static final DataType DATE
      Predefined data type for the Date type.
    • DATETIME

      public static final DataType DATETIME
      Predefined data type for the datetime type.
    • ENTITY

      public static final DataType ENTITY
      Predefined data type for the Entity type.
    • CURRENCY

      public static final DataType CURRENCY
      Predefined data type for the Currency type.
    • PERCENTAGE

      public static final DataType PERCENTAGE
      Predefined data type for the Percentage type.
  • Method Details

    • valueOf

      public static DataType valueOf(int id)
      This method can be used to lookup a DataType instance of an id. When an invalid id is passed to this method a ProfileException will be thrown. The list of valid id's is specified in the Id interface.
      Parameters:
      id - integer containing the id of the data type that should be returned.
      Returns:
      DataType instance for the specified id.
    • typeOf

      public static DataType typeOf(Object obj)
      This method tries to determine the data type of the object passed to the method. When no type could be determined for the object, an exception will be raised.
      Parameters:
      obj - The object for which the data type should be determined.
      Returns:
      The data type of the object.
    • forName

      public static DataType forName(String name)
      This method returns the data type matching the specified name.
      Parameters:
      name - The name of the requested data type.
      Returns:
      The data type matching the specified name.
    • getId

      public int getId()
      This method return the unique id of this data type.
      Returns:
      integer containing the unique id of the data type.
    • getName

      public String getName()
      This method return the name of the datatype.
      Returns:
      String containing the name of the datatype.
    • toString

      public String toString()
      This method returns a string containing descriptive information about this datatype.
      Overrides:
      toString in class Object
      Returns:
      String containing descriptive information about this datatype.
    • hashCode

      public int hashCode()
      This method returns a hash code based on the id of the data type.
      Overrides:
      hashCode in class Object
      Returns:
      hash code based on the data type id.
    • equals

      public boolean equals(Object obj)
      This method will compare this instance against the object passed to the method, and return true when both are identical.
      Overrides:
      equals in class Object
      Parameters:
      obj - The object that should be used to compare this data type to.
      Returns:
      boolean indicating if the object passed is identical to this data type.
    • isNumeric

      public boolean isNumeric()
      This method returns true when the data type represents a number.
      Returns:
      boolean indicating if this is a numeric data type.
    • isDate

      public boolean isDate()
      This method returns true when the data type represents a date.
      Returns:
      boolean indicating if this is a date data type.