Package org.apache.sling.scripting.sightly.render

## Interface RuntimeObjectModel

All Known Implementing Classes:
  `AbstractRuntimeObjectModel`

    @ProviderType
    public interface RuntimeObjectModel

The `RuntimeObjectModel` provides various utility object inspection & conversion methods that can be applied to runtime objects when executing HTL scripts.

### Method Summary

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

### Method Detail

#### isPrimitive

    boolean isPrimitive​(Object obj)

Checks if the provided object represents a primitive data type or not.

Parameters:
  `obj` - the target object
Returns:
  `true` if the `target` is a primitive, `false` otherwise

#### isCollection

    boolean isCollection​(Object target)

Checks if an object is a `Collection` or is backed by one.

Parameters:
  `target` - the target object
Returns:
  `true` if the `target` is a collection or is backed by one, `false` otherwise

#### isNumber

    boolean isNumber​(Object target)

Checks if the provided object represents a number or not.

Parameters:
  `target` - the target object
Returns:
  `true` if the `target` is a number, `false` otherwise

#### isDate

    boolean isDate​(Object target)

Checks if the provided object represents a date or calendar.

Parameters:
  `target` - the target object
Returns:
  `true` if the `target` is a date or calendar, `false` otherwise

#### resolveProperty

    Object resolveProperty​(Object target,
                           Object property)

Resolve a property of a target object and return its value. The property can be either an index or a name

Parameters:
  `target` - the target object
  `property` - the property to be resolved
Returns:
  the value of the property

#### toBoolean

    boolean toBoolean​(Object object)

Convert the given object to a boolean value

Parameters:
  `object` - the target object
Returns:
  the boolean representation of that object

#### toNumber

    Number toNumber​(Object object)

Coerce the object to a numeric value

Parameters:
  `object` - the target object
Returns:
  the numeric representation

#### toDate

    Date toDate​(Object object)

Convert the given object to a `Date` object

Parameters:
  `object` - the target object
Returns:
  the date represented by the `object`

#### toInstant

    Instant toInstant​(Object object)

Convert the given object to an `Instant` object

Parameters:
  `object` - the target object
Returns:
  the date represented by the `object`

#### toString

    String toString​(Object target)

Convert the given object to a string.

Parameters:
  `target` - the target object
Returns:
  the string representation of the object

#### toCollection

    Collection<Object> toCollection​(Object object)

Force the conversion of the object to a collection

Parameters:
  `object` - the target object
Returns:
  the collection representation of the object

#### toMap

    Map toMap​(Object object)

Force the conversion of the target object to a map

Parameters:
  `object` - the target object
Returns:
  a map representation of the object. Default is an empty map