Package com.yahoo.data.access.simple
Class Value.ObjectValue
- java.lang.Object
-
- com.yahoo.data.access.simple.Value
-
- com.yahoo.data.access.simple.Value.ObjectValue
-
- All Implemented Interfaces:
Inspectable
,Inspector
- Enclosing class:
- Value
public static class Value.ObjectValue extends Value
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.yahoo.data.access.simple.Value
Value.ArrayValue, Value.BoolValue, Value.DataValue, Value.DoubleValue, Value.EmptyValue, Value.LongValue, Value.ObjectValue, Value.StringValue
-
-
Constructor Summary
Constructors Constructor Description ObjectValue()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Inspector
field(java.lang.String name)
Access an field in an object.int
fieldCount()
Get the number of fields in an OBJECT (always returns 0 for non-objects)java.lang.Iterable<java.util.Map.Entry<java.lang.String,Inspector>>
fields()
Convert an object to an iterable list of (name, value) pairs.Value.ObjectValue
put(java.lang.String name, double value)
Value.ObjectValue
put(java.lang.String name, int value)
Value.ObjectValue
put(java.lang.String name, long value)
Value.ObjectValue
put(java.lang.String name, Inspector v)
Value.ObjectValue
put(java.lang.String name, java.lang.String value)
void
traverse(ObjectTraverser ot)
Traverse an object value, performing callbacks for each field.Type
type()
Get the type of an inspectorboolean
valid()
Check if the inspector is valid.
-
-
-
Method Detail
-
valid
public boolean valid()
Description copied from interface:Inspector
Check if the inspector is valid. If you try to access a field or array entry that does not exist, you will get an invalid Inspector returned.
-
fieldCount
public int fieldCount()
Description copied from interface:Inspector
Get the number of fields in an OBJECT (always returns 0 for non-objects)- Specified by:
fieldCount
in interfaceInspector
- Overrides:
fieldCount
in classValue
-
field
public Inspector field(java.lang.String name)
Description copied from interface:Inspector
Access an field in an object. If the current Inspector doesn't connect to an object value, or the object value does not contain a field with the given symbol name, the returned Inspector will be invalid.
-
traverse
public void traverse(ObjectTraverser ot)
Description copied from interface:Inspector
Traverse an object value, performing callbacks for each field. If the current Inspector is connected to an object value, perform callbacks to the given traverser for each field contained in the object. Otherwise a no-op.
-
fields
public java.lang.Iterable<java.util.Map.Entry<java.lang.String,Inspector>> fields()
Description copied from interface:Inspector
Convert an object to an iterable list of (name, value) pairs. Other types will just return an empty list.
-
put
public Value.ObjectValue put(java.lang.String name, Inspector v)
-
put
public Value.ObjectValue put(java.lang.String name, java.lang.String value)
-
put
public Value.ObjectValue put(java.lang.String name, long value)
-
put
public Value.ObjectValue put(java.lang.String name, int value)
-
put
public Value.ObjectValue put(java.lang.String name, double value)
-
-