Class ResultShape<T>

  • All Implemented Interfaces:
    java.io.Serializable

    public class ResultShape<T>
    extends java.lang.Object
    implements java.io.Serializable
    Describes the shape of a query result.
    A shape is described as a Java class by the generic type argument T. A shape may contain zero or more shapes. A shape is categorized as follows:
  • A primitive shape can not have child shapes e.g. Foo or float.
  • A compound shape has zero or more child shapes e.g. Foo{} or Foo{String, int} or Foo{String,Bar{Double},int}.
  • A nesting shape has one or more compound child shape(s). For example, Foo{String,Bar{Double},int}. On the other hand, Foo{String, int} is a compound shape but is not nesting because all its child shapes are primitive.
    A primitive category shape is declared during construction and immutable. The category of a non-primitive shape is mutable.
    Notice that all nested shapes are compound shapes but not all compound shapes are nesting.
    A compound shape can add other primitive shapes or nest other shapes to any arbitrary depth. However, a shape does not allow recursive nesting of shapes.
    Usage: The purpose of a shape is to populate an instance of T from an array of input values where each array element is further specified with a type and an alias. FillStrategy determines how a shape populates an instance of T by consuming the input array element values. The input data is presented as an Object[] with a parallel array of types because the primitive types (short, float etc.) are not preserved in the input array. For certain FillStrategy such as MAP or BEAN, the alias of the input array element are used to identify the Map key or setter methods respectively.
Since:
2.0.0
Author:
Pinaki Poddar
See Also:
Serialized Form