public class AnyTypeRecord extends Record
Constructor and Description |
---|
AnyTypeRecord(java.lang.String type) |
AnyTypeRecord(java.lang.String id,
java.lang.String type) |
Modifier and Type | Method and Description |
---|---|
void |
deleteAttribute(java.lang.String name)
Delete an attribute in the record
|
java.lang.Object |
getAttribute(java.lang.String name)
Return the Object value of an attribute stored in this record
|
java.util.List<java.lang.String> |
getAttributeAsList(java.lang.String name)
Return the value of a String List attribute stored in this record.
|
java.lang.String |
getAttributeAsString(java.lang.String name)
Return the value of a String attribute stored in this record.
|
Record |
parse(com.ibm.json.java.JSONObject jsonObj)
Create the record from JSON.
|
void |
setAttribute(java.lang.String name,
java.util.List<java.lang.String> value)
Set a String List value to the record.
|
void |
setAttribute(java.lang.String name,
java.lang.String value)
Set a String value attribute to the record.
|
com.ibm.json.java.JSONObject |
toJSON()
Returns the record in JSON format.
|
public AnyTypeRecord(java.lang.String type)
public AnyTypeRecord(java.lang.String id, java.lang.String type)
public void setAttribute(java.lang.String name, java.lang.String value) throws BuildException
name
- name of the attributevalue
- String value of the attribute to add or replaceBuildException
- if a reserved attribute name is used.public void setAttribute(java.lang.String name, java.util.List<java.lang.String> value) throws BuildException
name
- name of the attributevalue
- String List value of the attribute to add or replaceBuildException
- if a reserved attribute name is used.public java.lang.Object getAttribute(java.lang.String name)
name
- the name of the attribute to be retrievedpublic java.lang.String getAttributeAsString(java.lang.String name) throws java.lang.ClassCastException
name
- the name of the attribute to be retrievedjava.lang.ClassCastException
- if the attribute value is not a Stringpublic java.util.List<java.lang.String> getAttributeAsList(java.lang.String name) throws java.lang.ClassCastException
name
- the name of the attribute to be retrievedjava.lang.ClassCastException
- if the attribute value is not a Listpublic void deleteAttribute(java.lang.String name)
name
- the name of the attribute to deletepublic com.ibm.json.java.JSONObject toJSON()
<IBM Copyright © 2018 IBM Corp. All Rights Reserved.