Class AddressKeyDeserializer
java.lang.Object
com.fasterxml.jackson.databind.KeyDeserializer
org.consensusj.bitcoin.json.conversion.AddressKeyDeserializer
Key Deserializer to support using Address as the key in a Map.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.KeyDeserializer
KeyDeserializer.None
-
Constructor Summary
ConstructorDescriptionConstruct an address deserializer that will deserialize addresses for the default supported networks.AddressKeyDeserializer
(org.bitcoinj.base.AddressParser addressParser) Construct an address KeyDeserializer with a customAddressParser
AddressKeyDeserializer
(org.bitcoinj.base.Network network) Construct an address KeyDeserializer that validates addresses for the specifiedNetwork
. -
Method Summary
-
Constructor Details
-
AddressKeyDeserializer
public AddressKeyDeserializer()Construct an address deserializer that will deserialize addresses for the default supported networks. SeeNetwork
to understand what the supported networks are. -
AddressKeyDeserializer
Construct an address KeyDeserializer with a customAddressParser
- Parameters:
addressParser
- parser to convert a string to an address
-
AddressKeyDeserializer
Construct an address KeyDeserializer that validates addresses for the specifiedNetwork
. When deserializing addresses, addresses that are not from the specified network will cause aInvalidFormatException
to be thrown during deserialization.- Parameters:
network
- specify the only network we will deserialize addresses for.
-
-
Method Details
-
deserializeKey
public Object deserializeKey(String key, DeserializationContext ctxt) throws IOException, JsonProcessingException - Specified by:
deserializeKey
in classKeyDeserializer
- Throws:
IOException
JsonProcessingException
-