public class StructValue extends java.lang.Object implements DataValue
Constructor and Description |
---|
StructValue(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
void |
accept(ValueVisitor visitor) |
StructValue |
copy() |
boolean |
equals(java.lang.Object other) |
boolean |
getBoolean(java.lang.String field) |
double |
getDouble(java.lang.String field) |
DataValue |
getField(java.lang.String field)
Gets the value for a field with given name.
|
java.util.Set<java.lang.String> |
getFieldNames() |
java.util.Map<java.lang.String,DataValue> |
getFields() |
long |
getInteger(java.lang.String field) |
ListValue |
getList(java.lang.String field)
Gets the list value for a field with given name.
|
java.lang.String |
getName() |
OptionalValue |
getOptional(java.lang.String field) |
char[] |
getSecret(java.lang.String field) |
java.lang.String |
getString(java.lang.String fieldName) |
StructValue |
getStruct(java.lang.String field) |
DataType |
getType() |
boolean |
hasField(java.lang.String field) |
int |
hashCode() |
void |
setField(java.lang.String field,
boolean value) |
void |
setField(java.lang.String field,
char[] value) |
void |
setField(java.lang.String field,
DataValue value) |
void |
setField(java.lang.String field,
double value) |
void |
setField(java.lang.String field,
long value) |
void |
setField(java.lang.String field,
java.lang.String value) |
void |
setOptionalField(java.lang.String field,
boolean value) |
void |
setOptionalField(java.lang.String field,
java.lang.Boolean value) |
void |
setOptionalField(java.lang.String field,
double value) |
void |
setOptionalField(java.lang.String field,
java.lang.Double value) |
void |
setOptionalField(java.lang.String field,
long value) |
void |
setOptionalField(java.lang.String field,
java.lang.Long value) |
void |
setOptionalField(java.lang.String field,
java.lang.String value) |
java.lang.String |
toString() |
public StructValue(java.lang.String name)
name
- the canonical name of the structure type. cannot be
null
public java.lang.String getName()
public java.util.Set<java.lang.String> getFieldNames()
public boolean hasField(java.lang.String field)
public DataValue getField(java.lang.String field)
field
- name of the fieldDataValue
representing the value of the fieldCoreException
- if field with the specified name is not presentpublic java.util.Map<java.lang.String,DataValue> getFields()
public long getInteger(java.lang.String field)
public double getDouble(java.lang.String field)
public boolean getBoolean(java.lang.String field)
public java.lang.String getString(java.lang.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(java.lang.String field)
public OptionalValue getOptional(java.lang.String field)
public ListValue getList(java.lang.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(java.lang.String field)
public void setField(java.lang.String field, DataValue value)
public void setField(java.lang.String field, long value)
public void setField(java.lang.String field, boolean value)
public void setField(java.lang.String field, double value)
public void setField(java.lang.String field, java.lang.String value)
public void setField(java.lang.String field, char[] value)
public void setOptionalField(java.lang.String field, java.lang.Long value)
public void setOptionalField(java.lang.String field, java.lang.Boolean value)
public void setOptionalField(java.lang.String field, java.lang.Double value)
public void setOptionalField(java.lang.String field, java.lang.String value)
public void setOptionalField(java.lang.String field, long value)
public void setOptionalField(java.lang.String field, boolean value)
public void setOptionalField(java.lang.String field, double value)
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public void accept(ValueVisitor visitor)
public StructValue copy()