public class StructValue extends Object implements DataValue
Constructor and Description |
---|
StructValue(String name) |
Modifier and Type | Method and Description |
---|---|
void |
accept(ValueVisitor visitor) |
StructValue |
copy() |
boolean |
equals(Object other) |
boolean |
getBoolean(String field) |
double |
getDouble(String field) |
DataValue |
getField(String field)
Gets the value for a field with given name.
|
Set<String> |
getFieldNames() |
Map<String,DataValue> |
getFields() |
long |
getInteger(String field) |
ListValue |
getList(String field)
Gets the list value for a field with given name.
|
String |
getName() |
OptionalValue |
getOptional(String field) |
char[] |
getSecret(String field) |
String |
getString(String fieldName) |
StructValue |
getStruct(String field) |
DataType |
getType() |
boolean |
hasField(String field) |
int |
hashCode() |
void |
setField(String field,
boolean value) |
void |
setField(String field,
char[] value) |
void |
setField(String field,
DataValue value) |
void |
setField(String field,
double value) |
void |
setField(String field,
long value) |
void |
setField(String field,
String value) |
void |
setOptionalField(String field,
boolean value) |
void |
setOptionalField(String field,
Boolean value) |
void |
setOptionalField(String field,
double value) |
void |
setOptionalField(String field,
Double value) |
void |
setOptionalField(String field,
long value) |
void |
setOptionalField(String field,
Long value) |
void |
setOptionalField(String field,
String value) |
String |
toString() |
public StructValue(String name)
name
- the canonical name of the structure type. cannot be
null
public String getName()
public boolean hasField(String field)
public DataValue getField(String field)
field
- name of the fieldDataValue
representing the value of the fieldCoreException
- if field with the specified name is not presentpublic long getInteger(String field)
public double getDouble(String field)
public boolean getBoolean(String field)
public String getString(String fieldName)
fieldName
- name of the field to fetchCoreException
- if field with the specified name is not present
or its type is not StringValue
public char[] getSecret(String field)
public OptionalValue getOptional(String field)
public ListValue getList(String field)
field
- name of the fieldListValue
representing the value of the fieldCoreException
- if field with the specified name is not present
or its type is not listpublic StructValue getStruct(String field)
public void setField(String field, long value)
public void setField(String field, boolean value)
public void setField(String field, double value)
public void setField(String field, char[] value)
public void setOptionalField(String field, long value)
public void setOptionalField(String field, boolean value)
public void setOptionalField(String field, double value)
public void accept(ValueVisitor visitor)
public StructValue copy()
copy
in interface DataValue
ConcurrentModificationException
if the DataValue is modified at the time of coping.Copyright © 2015. All Rights Reserved.