public class ComplexValue
extends java.lang.Object
implements java.lang.Cloneable
| Constructor and Description |
|---|
ComplexValue() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(java.lang.String attributeName,
java.util.List<java.lang.String> values)
Sets one or more values for the specified attribute of this complex value.
|
void |
add(java.lang.String attributeName,
java.lang.String value)
Sets a single value for the specified attribute of this complex value.
|
java.lang.Object |
clone() |
boolean |
containsAttribute(java.lang.String attributeName)
Indicates whether this ComplexValue contains the specified attribute.
|
com.fasterxml.jackson.databind.JsonNode |
get(java.lang.String attributeName)
Returns the value(s) for the specified attribute in the format of a com.fasterxml.jackson.databind.JsonNode object,
or
null if the attribute does not exist. |
java.util.Set<java.lang.String> |
getAttributeNames()
Returns the set of all attribute names for this ComplexValue.
|
java.lang.String |
getFirstValueAsString(java.lang.String attributeName)
Returns the first value in the list of values for the specified attribute, or
null if the attribute
does not exist. |
java.util.List<java.lang.String> |
getValuesAsString(java.lang.String attributeName)
Returns the list of values for the specified attribute, or
null if the attribute
does not exist. |
void |
remove(java.lang.String attributeName)
Removes the specified attribute and its associated values from this ComplexValue.
|
void |
setAdditionalProperty(java.lang.String name,
java.lang.Object value)
This method is reserved for internal use.
|
java.lang.String |
toJSONString()
Returns a String containing the JSON representation of this object.
|
java.lang.String |
toString()
Returns the String representation of this object.
|
ComplexValue |
withAttribute(java.lang.String attributeName,
java.util.List<java.lang.String> values)
Returns an instance of the current ComplexValue object with the specified attribute set to the specified values.
|
ComplexValue |
withAttribute(java.lang.String attributeName,
java.lang.String value)
Returns an instance of the current ComplexValue object with the specified attribute set to the specified value.
|
public void setAdditionalProperty(java.lang.String name,
java.lang.Object value)
name - The name of an attribute.value - The value to set for the attribute.public java.lang.Object clone()
clone in class java.lang.Objectpublic void add(java.lang.String attributeName,
java.lang.String value)
attributeName - The name of the attribute.value - The value to set for the attribute.public void add(java.lang.String attributeName,
java.util.List<java.lang.String> values)
attributeName - The name of the attribute.values - The values to set for the attribute.public ComplexValue withAttribute(java.lang.String attributeName, java.lang.String value)
Example: ComplexValue cv = new ComplexValue().withAttribute("city", "Novato").withAttribute("name", "Radiant Logic");
attributeName - The name of an attribute.value - The value to set for the attribute.public ComplexValue withAttribute(java.lang.String attributeName, java.util.List<java.lang.String> values)
Example: ComplexValue cv = new ComplexValue().withAttribute("city", Arrays.asList("Novato", "Chicago")) .withAttribute("name", "Radiant Logic");
attributeName - The name of an attribute.values - The values to set for the attribute.public void remove(java.lang.String attributeName)
attributeName - The attribute to remove.public boolean containsAttribute(java.lang.String attributeName)
attributeName - The name of the attribute.true if this ComplexValue contains the specified attribute, or false otherwise.public java.util.Set<java.lang.String> getAttributeNames()
public java.lang.String getFirstValueAsString(java.lang.String attributeName)
null if the attribute
does not exist.attributeName - The name of the attribute.null if the attribute does
not exist.public java.util.List<java.lang.String> getValuesAsString(java.lang.String attributeName)
null if the attribute
does not exist.attributeName - The name of the attribute.null if the attribute does not exist.public com.fasterxml.jackson.databind.JsonNode get(java.lang.String attributeName)
null if the attribute does not exist.attributeName - The name of an attribute.null if the attribute does not exist.public java.lang.String toJSONString()
public java.lang.String toString()
toString in class java.lang.Object