public interface Payload extends PayloadProductType, java.io.Serializable
Modifier and Type | Method and Description |
---|---|
PayloadBlockIterator<PayloadBlock> |
createIterator()
method to create an iterator that will do a depth first traversal of all sub-blocks below this Payload.
|
PayloadBlockIterator<PayloadBlock> |
createIterator(java.lang.String blockName)
method to create an iterator that will do a depth first traversal of all sub-blocks below this PayloadBlock that
match the supplied blockName.
|
PayloadBlockIterator<PayloadBlock> |
createIterator(java.lang.String blockName,
java.lang.String attrName)
method to create an iterator that will do a depth first traversal of all sub-blocks below this PayloadBlock that
match the supplied blockName and attribute name.
|
PayloadBlockIterator<PayloadBlock> |
createIterator(java.lang.String blockName,
java.lang.String attrName,
java.lang.String value)
method to create an iterator that will do a depth first traversal of all sub-blocks below this PayloadBlock that
match the supplied blockName.
|
<T> T |
getAttribute(java.lang.String name)
method returns the attribute value for the provided attribute name.
|
java.util.List<PayloadAttributeInfo> |
getAttributeInfo()
method returns meta data about attributes in this Payload.
|
PayloadAttributeInfo |
getAttributeInfo(java.lang.String attributeName)
method returns meta data about the attribute info for the given fully qualified attribute.
|
PayloadBlock |
getSubBlock(java.lang.String name,
int index)
method gets the sub-block matching the supplied name and index.
|
java.util.List<PayloadBlockInfo> |
getSubBlockInfo()
method returns meta data about PayloadBlocks in this Payload.
|
boolean |
hasAttribute(java.lang.String name) |
Payload |
setAttribute(java.lang.String name,
java.math.BigDecimal value)
method assigns an decimal value to the specified attribute in this PayloadBlock.
|
Payload |
setAttribute(java.lang.String name,
Data unit,
java.math.BigDecimal amount)
method assigns an Data value to the specified attribute in this PayloadBlock.
|
Payload |
setAttribute(java.lang.String name,
Duration unit,
java.math.BigDecimal amount)
method assigns an Duration value to the specified attribute in this PayloadBlock.
|
Payload |
setAttribute(java.lang.String name,
int value)
method assigns an integer value to the specified attribute in this PayloadBlock.
|
Payload |
setAttribute(java.lang.String name,
long value)
method assigns an String value to the specified attribute in this PayloadBlock.
|
Payload |
setAttribute(java.lang.String name,
Occurrence unit,
java.lang.Integer amount)
method assigns an Occurrence value to the specified attribute in this PayloadBlock.
|
Payload |
setAttribute(java.lang.String name,
java.lang.String value)
method assigns an String value to the specified attribute in this PayloadBlock.
|
Payload |
setAttribute(java.lang.String name,
java.time.ZonedDateTime value)
method assigns a ZonedDateTime value to the specified attribute in this PayloadBlock.
|
java.lang.String |
toDebugString()
method will produce a detailed representation of a payload
|
getProductType, setProductType
Payload setAttribute(java.lang.String name, int value)
name
- the name of the attribute (eg. ABC[2].XYZ[1].TIME)value
- the integer value of the attributejava.util.NoSuchElementException
- if the caller attempts to set an attribute which is unknown
to the associated PayloadSpec.Payload setAttribute(java.lang.String name, java.lang.String value)
name
- the name of the attribute (eg. ABC[2].XYZ[1].TIME)value
- the string value of the attributejava.util.NoSuchElementException
- if the caller attempts to set an attribute which is unknown
to the associated PayloadSpec.Payload setAttribute(java.lang.String name, java.math.BigDecimal value)
name
- the name of the attribute (eg. ABC[2].XYZ[1].TIME)value
- the BigDecimal value of the attributejava.util.NoSuchElementException
- if the caller attempts to set an attribute which is unknown
to the associated PayloadSpec.Payload setAttribute(java.lang.String name, long value)
name
- the name of the attribute (eg. ABC[2].XYZ[1].TIME)value
- the long value of the attributejava.util.NoSuchElementException
- if the caller attempts to set an attribute which is unknown
to the associated PayloadSpec.Payload setAttribute(java.lang.String name, java.time.ZonedDateTime value)
name
- the name of the attribute (eg. ABC[2].XYZ[1].TIME)value
- the ZonedDateTime value to set into the payload field.java.util.NoSuchElementException
- if the caller attempts to set an attribute which is unknown
to the associated PayloadSpec.Payload setAttribute(java.lang.String name, Duration unit, java.math.BigDecimal amount)
name
- the name of the attribute (eg. ABC[2].XYZ[1].TIME)unit
- the duration unit to use.amount
- the amount of units to set, value cannot be nulljava.util.NoSuchElementException
- if the caller attempts to set an attribute which is unknown
to the associated PayloadSpec.Payload setAttribute(java.lang.String name, Data unit, java.math.BigDecimal amount)
name
- the name of the attribute (eg. ABC[2].XYZ[1].TIME)unit
- the data unit to be usedamount
- the amount of data, value cannot be nulljava.util.NoSuchElementException
- if the caller attempts to set an attribute which is unknown
to the associated PayloadSpec.Payload setAttribute(java.lang.String name, Occurrence unit, java.lang.Integer amount)
name
- the name of the attribute (eg. ABC[2].XYZ[1].TIME)unit
- the duration unit to use.amount
- the amount of units to set, value cannot be nulljava.util.NoSuchElementException
- if the caller attempts to set an attribute which is unknown
to the associated PayloadSpec.<T> T getAttribute(java.lang.String name)
T
- the type of the expected attributename
- the name of the attribute to be retrieved (eg. ABC[2].XYZ[1].TIME)java.util.NoSuchElementException
- if the caller attempts to get an attribute which is unknown
to the associated PayloadSpec during the builder phase (ie. prior to calling usageRequestBuilder.build()).PayloadBlockIterator<PayloadBlock> createIterator()
PayloadBlockIterator<PayloadBlock> createIterator(java.lang.String blockName)
blockName
- block name to match. A trailing '*' suffix can be used to do wildcard helps. (eg. CUSTOMER.BALANCE*)PayloadBlockIterator<PayloadBlock> createIterator(java.lang.String blockName, java.lang.String attrName)
blockName
- block name to match. A trailing '*' suffix can be used to do wildcard helps. (eg. CUSTOMER.BALANCE*)attrName
- attr name to match.PayloadBlockIterator<PayloadBlock> createIterator(java.lang.String blockName, java.lang.String attrName, java.lang.String value)
blockName
- block name to match. A trailing '*' suffix can be used to do wildcard helps. (eg. CUSTOMER.BALANCE*)attrName
- attr name to match.value
- attr value to match.PayloadBlock getSubBlock(java.lang.String name, int index)
name
- name of the block to get. Dot notation is NOT supported, this is a non-qualified block name
that represents a block with is a direct descendant of this payload.index
- the index of the block to get.java.util.List<PayloadAttributeInfo> getAttributeInfo()
PayloadAttributeInfo getAttributeInfo(java.lang.String attributeName)
attributeName
- name of the attribute for which the attribute info will be returnedjava.util.List<PayloadBlockInfo> getSubBlockInfo()
java.lang.String toDebugString()
boolean hasAttribute(java.lang.String name)