Class StructuredBytes
java.lang.Object
net.visma.autopay.http.structured.StructuredItem
net.visma.autopay.http.structured.StructuredBytes
- All Implemented Interfaces:
StructuredField
Class representing Structured Byte Sequences. Also used as "bare" Bytes in Structured parameters.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
Returns bytes[] value of this Structured Byte Sequenceboolean
Compares the specified object with this Structured Item for equality.int
hashCode()
Returns hash code for this Structured Item.static StructuredBytes
of
(byte[] value) Creates Structured Byte Sequence of given value, without parametersstatic StructuredBytes
Parses given string for Structured Byte Sequence, according to the specificationReturns string representation of value of this Structured Byte Sequence, which is a Base64-encoded byte[] valuestatic StructuredBytes
withParams
(byte[] value, Map<String, ?> parameters) Creates Structured Byte Sequence of given value and parametersstatic StructuredBytes
withParams
(byte[] value, StructuredParameters parameters) Creates Structured Byte Sequence of given value and parametersMethods inherited from class net.visma.autopay.http.structured.StructuredItem
bigDecimalParam, boolParam, bytesParam, doubleParam, intParam, longParam, parameters, serialize, stringParam, toString
-
Method Details
-
of
Creates Structured Byte Sequence of given value, without parameters- Parameters:
value
- Item value- Returns:
- Created Structured Byte Sequence
-
withParams
Creates Structured Byte Sequence of given value and parameters- Parameters:
value
- Item valueparameters
- Parameter map. For details, checkStructuredParameters.of(Map)
.- Returns:
- Created Structured Byte Sequence
-
withParams
Creates Structured Byte Sequence of given value and parameters- Parameters:
value
- Item valueparameters
- Structured Parameters- Returns:
- Created Structured Byte Sequence
-
bytesValue
public byte[] bytesValue()Returns bytes[] value of this Structured Byte Sequence- Returns:
- bytes[] value represented by this Structured Byte Sequence
-
stringValue
Returns string representation of value of this Structured Byte Sequence, which is a Base64-encoded byte[] value- Overrides:
stringValue
in classStructuredItem
- Returns:
- String value represented by this Structured Byte Sequence
-
parse
Parses given string for Structured Byte Sequence, according to the specification- Parameters:
httpHeader
- String to parse, e.g. HTTP header- Returns:
- Parsed Structured Byte Sequence
- Throws:
StructuredException
- Thrown in case of malformatted string or wrong item type- See Also:
-
equals
Description copied from class:StructuredItem
Compares the specified object with this Structured Item for equality. Returns true if the given object is of the same class as this Item, it has the same value and properties.- Overrides:
equals
in classStructuredItem
- Parameters:
o
- Object to be compared with this Structured Item- Returns:
- True is specified object is equal to this Structured Item
-
hashCode
public int hashCode()Description copied from class:StructuredItem
Returns hash code for this Structured Item. The hash code is a combination of hash codes of Item parameters and Item value.- Overrides:
hashCode
in classStructuredItem
- Returns:
- The hash code for this Structured Item
-