Package: groovy.lang

## [Java] Class ListWithDefault

- groovy.lang.ListWithDefault

-     public class ListWithDefault
      extends Object

  GDK enhancements for ListWithDefault.

  displayName:
    ListWithDefault
  receiverFqcn:
    groovy.lang.ListWithDefault

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `<T>` | `public List<T>` | `getAt(Collection indices)` Select a List of items from an eager or lazy List using a Collection to identify the indices to be selected.
    `<T>` | `public List<T>` | `getAt(Range range)` Support the range subscript operator for an eager or lazy List.
    `<T>` | `public List<T>` | `getAt(EmptyRange range)` Support the range subscript operator for an eager or lazy List.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `addShutdownHook, any, any, asBoolean, asType, clamp, clamp, collect, collect, collect, dump, each, eachMatch, eachMatch, eachWithIndex, every, every, find, find, findAll, findAll, findIndexOf, findIndexOf, findIndexValues, findIndexValues, findLastIndexOf, findLastIndexOf, findResult, findResult, findResult, findResult, getAt, getMetaClass, getMetaPropertyValues, getProperties, grep, grep, hasProperty, identity, inject, inject, inject, inject, inspect, invokeMethod, is, isCase, isNotCase, iterator, metaClass, print, print, printf, printf, println, println, println, putAt, respondsTo, respondsTo, setMetaClass, sleep, sleep, split, sprintf, sprintf, stream, takeIf, tap, toString, use, use, use, with, with, withCloseable, withCloseable, withMethodClosure, withStream, withStream, withTraits`

- - ### Method Detail

    - #### <T> public List<T> getAt(Collection indices)

      Select a List of items from an eager or lazy List using a Collection to identify the indices to be selected.

          def list = [].withDefault { 42 }
           assert list[1,0,2] == [42, 42, 42]

      Parameters:
        `indices` - a Collection of indices
      Returns:
        a new eager or lazy list of the values at the given indices

    - #### <T> public List<T> getAt(Range range)

      Support the range subscript operator for an eager or lazy List.

          def list = [].withDefault { 42 }
           assert list[1..2] == [null, 42]

      Parameters:
        `range` - a Range indicating the items to get
      Returns:
        a new eager or lazy list instance based on range borders

    - #### <T> public List<T> getAt(EmptyRange range)

      Support the range subscript operator for an eager or lazy List.

           def list = [true, 1, 3.4].withDefault{ 42 }
           assert list[0..<0] == []

      Parameters:
        `range` - a Range indicating the items to get
      Returns:
        a new list instance based on range borders