Class PropertyExtractors.ListPropertyExtractor

java.lang.Object
org.apache.juneau.junit.bct.PropertyExtractors.ObjectPropertyExtractor
org.apache.juneau.junit.bct.PropertyExtractors.ListPropertyExtractor
All Implemented Interfaces:
PropertyExtractor
Enclosing class:
PropertyExtractors

Property extractor for array and collection objects with numeric indexing and size access.

This extractor extends PropertyExtractors.ObjectPropertyExtractor to add special handling for collection-like objects. It provides array-style access using numeric indices and universal size/length properties for any listifiable object.

Additional Properties:
  • Numeric indices: "0", "1", "2", etc. for element access
  • Negative indices: "-1", "-2" for reverse indexing (from end)
  • Size properties: "length" and "size" return collection size
Supported Types:

Works with any object that can be listified by the converter:

  • Arrays: All array types (primitive and object)
  • Collections: List, Set, Queue, and all Collection subtypes
  • Iterables: Any object implementing Iterable
  • Streams: Stream objects and other lazy sequences
  • Maps: Converted to list of entries for iteration
Examples:

// Array/List access list.get(0) // "0" property array[2] // "2" property list.get(-1) // "-1" property (last element) // Size access array.length // "length" property collection.size() // "size" property stream.count() // "length" or "size" property

Fallback: If the property is not a numeric index or size property, delegates to PropertyExtractors.ObjectPropertyExtractor for standard property access.