Class StructuredParameters
java.lang.Object
net.visma.autopay.http.structured.StructuredParameters
- All Implemented Interfaces:
StructuredMap
Class representing Structured Parameters
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Compares the specified object with these Structured Parameters for equality.int
hashCode()
Returns hash code for these Structured Parameters.<T extends StructuredItem>
Map<String,T> itemMap()
ReturnsMap
of Structured Items stored in this Dictionary or Parameters.static StructuredParameters
Creates Structured Parameters from provided keys and values.static StructuredParameters
Creates Structured Parameters from given maptoString()
Returns the string representation of these Structured Parameters, which is the same as serialized representation.Methods inherited from interface net.visma.autopay.http.structured.StructuredMap
bigDecimalMap, boolMap, bytesMap, doubleMap, entrySet, entrySet, getBigDecimal, getBool, getBytes, getDouble, getInt, getItem, getItem, getLong, getString, intMap, isEmpty, itemMap, keySet, longMap, stringMap, values, values
-
Method Details
-
of
Creates Structured Parameters from given mapOrder of Map entries is preserved. For supported value types and conversion rules see
StructuredList.of(Collection)
.*- Parameters:
parameters
- Parameter map- Returns:
- Created Structured Parameters
- Throws:
IllegalArgumentException
- Invalid keys or values
-
of
Creates Structured Parameters from provided keys and values.Keys and values should be provided in alternate indices of the vararg param. Order of Map entries is preserved.
Keys are created using from "even" vararg items, using
Object.toString()
. Values are created from "odd" vararg items, using conversion described atStructuredList.of(Collection)
.- Parameters:
keysAndValues
- Alternating keys and values: key1, value1, key2, value2, ...- Returns:
- Created Structured Parameters
- Throws:
IllegalArgumentException
- Invalid keys or values
-
itemMap
Description copied from interface:StructuredMap
ReturnsMap
of Structured Items stored in this Dictionary or Parameters. Keys or returned map correspond to Dictionary or Parameters keys. Values areStructuredItem
members of Dictionary or Parameters.- Specified by:
itemMap
in interfaceStructuredMap
- Type Parameters:
T
- Specific Item class if needed. No type check is performed, only simple casting.- Returns:
- Underlying map of
StructuredItem
objects
-
equals
Compares the specified object with these Structured Parameters for equality. Returns true if the given object is of the same class as these Parameters, underlying map has the same keys and values. -
hashCode
public int hashCode()Returns hash code for these Structured Parameters. The hash code is a combination of hash codes of Parameters entries. -
toString
Returns the string representation of these Structured Parameters, which is the same as serialized representation.
-