Interface StructuredCollection

All Known Implementing Classes:
StructuredInnerList, StructuredList

public interface StructuredCollection
Shared interface for StructuredInnerList and StructuredList. Contains methods for converting structured lists to Java List containing Java plain objects.
  • Method Summary

    Modifier and Type
    Method
    Description
    default List<BigDecimal>
    Returns values of Structured Items in this Structured List converted to BigDecimal objects.
    default List<Boolean>
    Returns values of Structured Items in this Structured List converted to Boolean objects.
    default List<byte[]>
    Returns values of Structured Items in this Structured List converted to byte[] objects.
    default List<Double>
    Returns values of Structured Items in this Structured List converted to Double objects.
    default List<Integer>
    Returns values of Structured Items in this Structured List converted to Integer objects.
    default boolean
    Returns true if this list contains no elements
    <T extends StructuredItem>
    List<T>
    Returns List of Structured Items stored in this Structured List
    default <T extends StructuredItem>
    List<T>
    itemList(Class<T> itemClass)
    Returns List of Structured Items stored in this Structured List.
    default List<Long>
    Returns values of Structured Items in this Structured List converted to Long objects.
    default List<String>
    Returns values of Structured Items in this Structured List converted to String objects.
  • Method Details

    • itemList

      <T extends StructuredItem> List<T> itemList()
      Returns List of Structured Items stored in this Structured List
      Type Parameters:
      T - Specific Item class if needed. No type check is performed, only simple casting.
      Returns:
      Underlying list of StructuredItem objects
    • itemList

      default <T extends StructuredItem> List<T> itemList(Class<T> itemClass)
      Returns List of Structured Items stored in this Structured List.

      Similar to itemList(), but class of list members is provided as method argument rather than "generic type argument", e.g. myList.itemList(StructuredInteger.class) instead of myList.<StructuredInteger>itemList().

      Type Parameters:
      T - Type of list members
      Parameters:
      itemClass - Class of list members. No type check is performed, only simple casting.
      Returns:
      Underlying list of StructuredItem objects
    • isEmpty

      default boolean isEmpty()
      Returns true if this list contains no elements
      Returns:
      True if list contains no elements
    • stringList

      default List<String> stringList()
      Returns values of Structured Items in this Structured List converted to String objects.
      Returns:
      List of item values converted to String
      See Also:
    • boolList

      default List<Boolean> boolList()
      Returns values of Structured Items in this Structured List converted to Boolean objects. This Structured List must contain StructuredBoolean members only.
      Returns:
      List of item values converted to Boolean
      Throws:
      UnsupportedOperationException - Thrown if this list contains non-StructuredBoolean members.
    • intList

      default List<Integer> intList()
      Returns values of Structured Items in this Structured List converted to Integer objects. This Structured List must contain StructuredInteger members only.

      (int) cast is used internally, which means that returned value will be wrong for item values smaller than Integer.MIN_VALUE or grater than Integer.MAX_VALUE.

      Returns:
      List of item values converted to Integer
      Throws:
      UnsupportedOperationException - Thrown if this list contains non-StructuredInteger members
    • longList

      default List<Long> longList()
      Returns values of Structured Items in this Structured List converted to Long objects. This Structured List must contain StructuredInteger members only.
      Returns:
      List of item values converted to Long
      Throws:
      UnsupportedOperationException - Thrown if this list contains non-StructuredInteger members
    • bigDecimalList

      default List<BigDecimal> bigDecimalList()
      Returns values of Structured Items in this Structured List converted to BigDecimal objects. This Structured List must contain StructuredDecimal or StructuredInteger members only.
      Returns:
      List of item values converted to BigDecimal
      Throws:
      UnsupportedOperationException - Thrown if this list contains a member which is neither StructuredDecimal nor StructuredInteger
    • doubleList

      default List<Double> doubleList()
      Returns values of Structured Items in this Structured List converted to Double objects. This Structured List must contain StructuredDecimal or StructuredInteger members only.
      Returns:
      List of item values converted to Double
      Throws:
      UnsupportedOperationException - Thrown if this list contains non-StructuredDecimal or non-StructuredInteger members.
    • bytesList

      default List<byte[]> bytesList()
      Returns values of Structured Items in this Structured List converted to byte[] objects. This Structured List must contain StructuredBytes members only.
      Returns:
      List of item values converted to byte[]
      Throws:
      UnsupportedOperationException - Thrown if this list contains non-StructuredBytes members.