Class AbstractRuntimeObjectModel

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isCollection​(java.lang.Object target)
      Checks if an object is a Collection or is backed by one.
      boolean isDate​(java.lang.Object target)
      Checks if the provided object represents a date or calendar.
      boolean isNumber​(java.lang.Object target)
      Checks if the provided object represents a number or not.
      boolean isPrimitive​(java.lang.Object obj)
      Checks if the provided object represents a primitive data type or not.
      java.lang.Object resolveProperty​(java.lang.Object target, java.lang.Object property)
      Resolve a property of a target object and return its value.
      boolean toBoolean​(java.lang.Object object)
      Convert the given object to a boolean value
      java.util.Collection<java.lang.Object> toCollection​(java.lang.Object object)
      Force the conversion of the object to a collection
      java.util.Date toDate​(java.lang.Object object)
      Convert the given object to a Date object
      java.time.Instant toInstant​(java.lang.Object object)
      Convert the given object to an Instant object
      java.util.Map toMap​(java.lang.Object object)
      Force the conversion of the target object to a map
      java.lang.Number toNumber​(java.lang.Object object)
      Coerce the object to a numeric value
      java.lang.String toString​(java.lang.Object target)
      Convert the given object to a string.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractRuntimeObjectModel

        public AbstractRuntimeObjectModel()
    • Method Detail

      • isPrimitive

        public boolean isPrimitive​(java.lang.Object obj)
        Description copied from interface: RuntimeObjectModel
        Checks if the provided object represents a primitive data type or not.
        Specified by:
        isPrimitive in interface RuntimeObjectModel
        Parameters:
        obj - the target object
        Returns:
        true if the target is a primitive, false otherwise
      • isDate

        public boolean isDate​(java.lang.Object target)
        Description copied from interface: RuntimeObjectModel
        Checks if the provided object represents a date or calendar.
        Specified by:
        isDate in interface RuntimeObjectModel
        Parameters:
        target - the target object
        Returns:
        true if the target is a date or calendar, false otherwise
      • isNumber

        public boolean isNumber​(java.lang.Object target)
        Description copied from interface: RuntimeObjectModel
        Checks if the provided object represents a number or not.
        Specified by:
        isNumber in interface RuntimeObjectModel
        Parameters:
        target - the target object
        Returns:
        true if the target is a number, false otherwise
      • isCollection

        public boolean isCollection​(java.lang.Object target)
        Description copied from interface: RuntimeObjectModel
        Checks if an object is a Collection or is backed by one.
        Specified by:
        isCollection in interface RuntimeObjectModel
        Parameters:
        target - the target object
        Returns:
        true if the target is a collection or is backed by one, false otherwise
      • resolveProperty

        public java.lang.Object resolveProperty​(java.lang.Object target,
                                                java.lang.Object property)
        Description copied from interface: RuntimeObjectModel
        Resolve a property of a target object and return its value. The property can be either an index or a name
        Specified by:
        resolveProperty in interface RuntimeObjectModel
        Parameters:
        target - the target object
        property - the property to be resolved
        Returns:
        the value of the property
      • toBoolean

        public boolean toBoolean​(java.lang.Object object)
        Description copied from interface: RuntimeObjectModel
        Convert the given object to a boolean value
        Specified by:
        toBoolean in interface RuntimeObjectModel
        Parameters:
        object - the target object
        Returns:
        the boolean representation of that object
      • toNumber

        public java.lang.Number toNumber​(java.lang.Object object)
        Description copied from interface: RuntimeObjectModel
        Coerce the object to a numeric value
        Specified by:
        toNumber in interface RuntimeObjectModel
        Parameters:
        object - the target object
        Returns:
        the numeric representation
      • toDate

        public java.util.Date toDate​(java.lang.Object object)
        Description copied from interface: RuntimeObjectModel
        Convert the given object to a Date object
        Specified by:
        toDate in interface RuntimeObjectModel
        Parameters:
        object - the target object
        Returns:
        the date represented by the object
      • toInstant

        public java.time.Instant toInstant​(java.lang.Object object)
        Description copied from interface: RuntimeObjectModel
        Convert the given object to an Instant object
        Specified by:
        toInstant in interface RuntimeObjectModel
        Parameters:
        object - the target object
        Returns:
        the date represented by the object
      • toString

        public java.lang.String toString​(java.lang.Object target)
        Description copied from interface: RuntimeObjectModel
        Convert the given object to a string.
        Specified by:
        toString in interface RuntimeObjectModel
        Parameters:
        target - the target object
        Returns:
        the string representation of the object
      • toCollection

        public java.util.Collection<java.lang.Object> toCollection​(java.lang.Object object)
        Description copied from interface: RuntimeObjectModel
        Force the conversion of the object to a collection
        Specified by:
        toCollection in interface RuntimeObjectModel
        Parameters:
        object - the target object
        Returns:
        the collection representation of the object
      • toMap

        public java.util.Map toMap​(java.lang.Object object)
        Description copied from interface: RuntimeObjectModel
        Force the conversion of the target object to a map
        Specified by:
        toMap in interface RuntimeObjectModel
        Parameters:
        object - the target object
        Returns:
        a map representation of the object. Default is an empty map