Class ISODataset
java.lang.Object
org.jpos.iso.ISODataset
- All Implemented Interfaces:
Dataset
Mutable dataset implementation used by
ISODatasetField.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddElement(int id, ISOComponent component) Appends a primitive element.voidaddElement(int id, ISOComponent component, boolean constructed) Appends an element and records its constructed TLV flag.voidaddElement(DatasetElement element) Appends an element without replacing existing entries with the same id.byte[]getBytes(int id) Returns the bytes of the first matching element.getComponent(int id) Returns theISOComponentof the first matching element.getElement(int id) Returns the first element that matches the supplied identifier.Returns all decoded elements in insertion order.getElements(int id) Returns all elements that match the supplied element identifier.Returns the logical dataset encoding format.intReturns the dataset identifier as carried on the wire.getValue(int id) Returns the logical value of the first matching element.booleanisEmpty()Indicates whether the dataset contains any elements.voidputElement(int id, ISOComponent component) Replaces any existing element with the same id.voidputElement(int id, ISOComponent component, boolean constructed) Replaces any existing element with the same id and records its constructed TLV flag.voidputElement(DatasetElement element) Replaces any existing elements with the same id and then appends the supplied element.voidremoveElement(int id) Removes all elements that match the supplied identifier.with(int id, byte[] value) Stores a binary element and returns this dataset for fluent chaining.Stores a character element and returns this dataset for fluent chaining.with(int id, ISOComponent component) Stores an ISO component and returns this dataset for fluent chaining.with(int id, ISOComponent component, boolean constructed) Stores an ISO component and its constructed TLV flag, returning this dataset for fluent chaining.
-
Constructor Details
-
ISODataset
Creates an empty dataset.- Parameters:
identifier- dataset identifierformat- dataset format
-
-
Method Details
-
getIdentifier
Description copied from interface:DatasetReturns the dataset identifier as carried on the wire.- Specified by:
getIdentifierin interfaceDataset- Returns:
- dataset identifier in the range
0x01to0xFE
-
getFormat
Description copied from interface:DatasetReturns the logical dataset encoding format. -
addElement
Appends an element without replacing existing entries with the same id.- Parameters:
element- element to append
-
putElement
Replaces any existing elements with the same id and then appends the supplied element.- Parameters:
element- element to store
-
addElement
Appends a primitive element.- Parameters:
id- element identifiercomponent- backing component
-
putElement
Replaces any existing element with the same id.- Parameters:
id- element identifiercomponent- backing component
-
addElement
Appends an element and records its constructed TLV flag.- Parameters:
id- element identifiercomponent- backing componentconstructed- whether the tag is constructed
-
putElement
Replaces any existing element with the same id and records its constructed TLV flag.- Parameters:
id- element identifiercomponent- backing componentconstructed- whether the tag is constructed
-
removeElement
Removes all elements that match the supplied identifier.- Parameters:
id- element identifier to remove
-
isEmpty
Indicates whether the dataset contains any elements.- Returns:
truewhen empty
-
with
Stores a character element and returns this dataset for fluent chaining.- Parameters:
id- element identifiervalue- element value- Returns:
- this dataset
-
with
Stores a binary element and returns this dataset for fluent chaining.- Parameters:
id- element identifiervalue- element value- Returns:
- this dataset
-
with
Stores an ISO component and returns this dataset for fluent chaining.- Parameters:
id- element identifiercomponent- backing component- Returns:
- this dataset
-
with
Stores an ISO component and its constructed TLV flag, returning this dataset for fluent chaining.- Parameters:
id- element identifiercomponent- backing componentconstructed- whether the tag is constructed- Returns:
- this dataset
-
getElements
Description copied from interface:DatasetReturns all decoded elements in insertion order.- Specified by:
getElementsin interfaceDataset- Returns:
- immutable list of dataset elements
-
getElements
Description copied from interface:DatasetReturns all elements that match the supplied element identifier.- Specified by:
getElementsin interfaceDataset- Parameters:
id- element identifier, either a TLV tag or DBM bit number- Returns:
- immutable list of matching elements
-
getElement
Description copied from interface:DatasetReturns the first element that matches the supplied identifier.- Specified by:
getElementin interfaceDataset- Parameters:
id- element identifier, either a TLV tag or DBM bit number- Returns:
- matching element or
nullwhen absent
-
getComponent
Returns theISOComponentof the first matching element.- Parameters:
id- element identifier- Returns:
- matching component, or
nullif no element has the given id
-
getValue
Returns the logical value of the first matching element.- Parameters:
id- element identifier- Returns:
- element value or
null - Throws:
ISOException- on component access errors
-
getBytes
Returns the bytes of the first matching element.- Parameters:
id- element identifier- Returns:
- element bytes or
null - Throws:
ISOException- on component access errors
-