Interface ConfigList
- All Superinterfaces:
Collection<ConfigValue>,ConfigMergeable,ConfigValue,Iterable<ConfigValue>,List<ConfigValue>,SequencedCollection<ConfigValue>
ConfigValue representing a list value, as in JSON's
[1,2,3] syntax.
ConfigList implements java.util.List<ConfigValue> so you can
use it like a regular Java list. Or call unwrapped() to unwrap the
list elements into plain Java values.
Like all ConfigValue subtypes, ConfigList is immutable. This
makes it threadsafe and you never have to create "defensive copies." The
mutator methods from List all throw
UnsupportedOperationException.
The ConfigValue.valueType() method on a list returns
ConfigValueType.LIST.
Do not implement ConfigList; it should only be implemented
by the config library. Arbitrary implementations will not work because the
library internals assume a specific concrete implementation. Also, this
interface is likely to grow new methods over time, so third-party
implementations will break.
-
Method Summary
Modifier and TypeMethodDescriptionRecursively unwraps the list, returning a list of plain Java values such as Integer or String or whatever is in the list.withOrigin(ConfigOrigin origin) Returns aConfigValuebased on this one, but with the given origin.Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface com.typesafe.config.ConfigValue
atKey, atPath, origin, render, render, valueType, withFallbackMethods inherited from interface java.util.List
add, add, addAll, addAll, addFirst, addLast, clear, contains, containsAll, equals, get, getFirst, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeLast, replaceAll, retainAll, reversed, set, size, sort, spliterator, subList, toArray, toArray
-
Method Details
-
unwrapped
Recursively unwraps the list, returning a list of plain Java values such as Integer or String or whatever is in the list.- Specified by:
unwrappedin interfaceConfigValue- Returns:
- a
Listcontaining plain Java objects
-
withOrigin
Description copied from interface:ConfigValueReturns aConfigValuebased on this one, but with the given origin. This is useful when you are parsing a new format of file or setting comments for a single ConfigValue.- Specified by:
withOriginin interfaceConfigValue- Parameters:
origin- the origin set on the returned value- Returns:
- the new ConfigValue with the given origin
-