@Immutable public final class ListValue extends VariableValue
Note that several methods (in this class or the enclosed ListValue.Builder
class) can take any object as an argument. It is the caller's responsibility
to ensure that these objects have a suitable Object.toString()
.toString()} implementation.
While a public constructor exists, it is deprecated. Use one of
the factory methods instead, or a ListValue.Builder (see newBuilder()).
| Modifier and Type | Class and Description |
|---|---|
static class |
ListValue.Builder
Builder class for a
ListValue |
BUNDLE| Constructor and Description |
|---|
ListValue(List<String> list)
Deprecated.
use
copyOf(Iterable) instead. Will be removed in
0.6. |
| Modifier and Type | Method and Description |
|---|---|
static <T> VariableValue |
copyOf(Iterable<T> iterable)
Build a list value out of an existing iterable (list, set, other)
|
List<String> |
getListValue()
Get a list for this value
|
boolean |
isEmpty()
Tell whether this value is empty
|
static ListValue.Builder |
newBuilder()
Create a new list value builder
|
static VariableValue |
of(Object first,
Object... other)
Build a list value out of a series of elements
|
getMapValue, getScalarValue, getType@Deprecated public ListValue(List<String> list)
copyOf(Iterable) instead. Will be removed in
0.6.list - the list to usepublic static ListValue.Builder newBuilder()
public static <T> VariableValue copyOf(Iterable<T> iterable)
This calls ListValue.Builder.addAll(Iterable) internally.
T - the type of iterable elementsiterable - the iterablepublic static VariableValue of(Object first, Object... other)
This calls ListValue.Builder.add(Object, Object...) internally.
first - first elementother - other elements, if anypublic List<String> getListValue()
VariableValueOnly valid for list values
getListValue in class VariableValuepublic boolean isEmpty()
VariableValueFor strings, this tells whether the string itself is empty. For lists and maps, this tells whether the list or map have no elements/entries.
isEmpty in class VariableValueCopyright © 2013. All Rights Reserved.