Interface PayloadView
public interface PayloadView
Class exposes the immutable interface of a Payload. Users cannot modify the attributes and sub-blocks
when using this interface.
-
Method Summary
Modifier and TypeMethodDescriptionmethod to createColumnInfo an iterator that will do a depth first traversal of all sub-blocks below this Payload.createViewIterator
(String blockName) method to createColumnInfo an iterator that will do a depth first traversal of all sub-blocks below this PayloadBlock that match the supplied blockName.createViewIterator
(String blockName, String attrName) method to createColumnInfo an iterator that will do a depth first traversal of all sub-blocks below this PayloadBlock that match the supplied blockName and attribute name.createViewIterator
(String blockName, String attrName, String value) method to createColumnInfo an iterator that will do a depth first traversal of all sub-blocks below this PayloadBlock that match the supplied blockName. attribute name and attribute value.<T> T
getAttribute
(String name) method returns the attribute value for the provided attribute name.method returns meta data about all available attributes in this Payload.getAttributeInfo
(String attributeName) method returns meta data about the attribute info for the given fully qualified attribute.method gets the applicable operation type for this Payloadmethod returns meta data about the PayloadBlocks in this Payload.getSubBlocks
(String name) method gets the sub-block matching the supplied name.getUsedSubBlocks
(String name) method gets the used sub-block.boolean
hasAttribute
(String name) method used to see if the Payload contains an attribute for the supplied name.method will produce a detailed representation of a payload
-
Method Details
-
getOperationType
String getOperationType()method gets the applicable operation type for this Payload- Returns:
- the operation type for this PayloadSpec
-
getAttribute
method returns the attribute value for the provided attribute name. ClassCastException will be thrown if caller attempts to retrieve the attribute as the incorrect data type. Dot notation addressing is supported in the supplied name.- Type Parameters:
T
- the type of the expected attribute- Parameters:
name
- the name of the attribute to be retrieved (eg. ABC[2].XYZ[1].TIME)- Returns:
- the attribute value corresponding to the supplied name.
-
hasAttribute
method used to see if the Payload contains an attribute for the supplied name.- Parameters:
name
- name of the attribute in question.- Returns:
- true if the payload contains an attribute for the supplied name.
-
createViewIterator
PayloadBlockIterator<PayloadBlockView> createViewIterator()method to createColumnInfo an iterator that will do a depth first traversal of all sub-blocks below this Payload.- Returns:
- iterator for all sub-blocks of this PayloadBlock.
-
createViewIterator
method to createColumnInfo an iterator that will do a depth first traversal of all sub-blocks below this PayloadBlock that match the supplied blockName.- Parameters:
blockName
- block name to match. A trailing '*' suffix can be used to do wildcard helps. (eg. CUSTOMER.BALANCE*)- Returns:
- iterator to traverse all sub-blocks of this PayloadBlock that match the supplied blockName.
-
createViewIterator
method to createColumnInfo an iterator that will do a depth first traversal of all sub-blocks below this PayloadBlock that match the supplied blockName and attribute name.- Parameters:
blockName
- block name to match. A trailing '*' suffix can be used to do wildcard helps. (eg. CUSTOMER.BALANCE*)attrName
- attr name to match.- Returns:
- iterator to traverse all sub-blocks of this PayloadBlock that match the supplied blockName and attr name.
-
createViewIterator
PayloadBlockIterator<PayloadBlockView> createViewIterator(String blockName, String attrName, String value) method to createColumnInfo an iterator that will do a depth first traversal of all sub-blocks below this PayloadBlock that match the supplied blockName. attribute name and attribute value.- Parameters:
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.- Returns:
- iterator to traverse all sub-blocks of this PayloadBlock that match the supplied blockName, attr name and attr value.
-
getSubBlocks
method gets the sub-block matching the supplied name. A List of immutable PayloadBlockViews are returned.- Parameters:
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.- Returns:
- the list of matching blocks. Empty collection is return if there are no child blocks available by the supplied name.
-
getAttributeInfo
List<PayloadAttributeInfo> getAttributeInfo()method returns meta data about all available attributes in this Payload.- Returns:
- meta data about all available attributes in this Payload
-
getAttributeInfo
method returns meta data about the attribute info for the given fully qualified attribute.- Parameters:
attributeName
- name of teh attribute for which the attribute info will be returned- Returns:
- meta data about all available attributes in this Payload
-
getSubBlockInfo
List<PayloadBlockInfo> getSubBlockInfo()method returns meta data about the PayloadBlocks in this Payload.- Returns:
- meta data about PayloadBlocks in this Payload
-
toDebugString
String toDebugString()method will produce a detailed representation of a payload- Returns:
- engineer view of the payload
-
getUsedSubBlocks
method gets the used sub-block. A List of immutable PayloadBlockViews are returned.- Parameters:
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.- Returns:
- the list of matching blocks. Empty collection is return if there are no child blocks available by the supplied name.
-