Package com.boomi.connector.testutil
Class MutablePropertyMap
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<String,Object>
-
- com.boomi.connector.testutil.MutablePropertyMap
-
- All Implemented Interfaces:
PropertyMap
,Serializable
,Cloneable
,Map<String,Object>
public class MutablePropertyMap extends HashMap<String,Object> implements PropertyMap
SimplePropertyMap
implementation for use in testing withConnectorTest
.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Constructor Summary
Constructors Constructor Description MutablePropertyMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Boolean
getBooleanProperty(String key)
Gets the Boolean property for the given key.Boolean
getBooleanProperty(String key, Boolean defaultValue)
Gets the Boolean property for the given key, returning the defaultValue if the located property valuenull
.Map<String,String>
getCustomProperties(String key)
Gets the key/value pairs as a map for custom property type fields.Long
getLongProperty(String key)
Gets the Long property for the given key.Long
getLongProperty(String key, Long defaultValue)
Gets the Long property for the given key, returning the defaultValue if the located property valuenull
.OAuth2Context
getOAuth2Context(String key)
Gets the OAuth2Context property for the given key.PrivateKeyStore
getPrivateKeyStoreProperty(String key)
Gets the KeyStore property for the given key.String
getProperty(String key)
Gets the String property for the given key.String
getProperty(String key, String defaultValue)
Gets the String property for the given key, returning the defaultValue if the located property value is blank (null
or all characters are whitespace).PublicKeyStore
getPublicKeyStoreProperty(String key)
Gets the KeyStore property for the given key.-
Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
-
-
-
Method Detail
-
getProperty
public String getProperty(String key)
Description copied from interface:PropertyMap
Gets the String property for the given key. This method may be used to retrieve properties of type "string" or "password".- Specified by:
getProperty
in interfacePropertyMap
- Parameters:
key
- key of the desired property- Returns:
- String property value or
null
if not found.
-
getProperty
public String getProperty(String key, String defaultValue)
Description copied from interface:PropertyMap
Gets the String property for the given key, returning the defaultValue if the located property value is blank (null
or all characters are whitespace). This method may be used to retrieve properties of type "string" or "password".- Specified by:
getProperty
in interfacePropertyMap
- Parameters:
key
- key of the desired propertydefaultValue
- value to return if property value is blank- Returns:
- String property value or defaultValue if not found.
-
getBooleanProperty
public Boolean getBooleanProperty(String key)
Description copied from interface:PropertyMap
Gets the Boolean property for the given key. This method may be used to retrieve properties of type "boolean".- Specified by:
getBooleanProperty
in interfacePropertyMap
- Parameters:
key
- key of the desired property- Returns:
- Boolean property value or
null
if not found.
-
getBooleanProperty
public Boolean getBooleanProperty(String key, Boolean defaultValue)
Description copied from interface:PropertyMap
Gets the Boolean property for the given key, returning the defaultValue if the located property valuenull
. This method may be used to retrieve properties of type "boolean".- Specified by:
getBooleanProperty
in interfacePropertyMap
- Parameters:
key
- key of the desired propertydefaultValue
- value to return if property value isnull
- Returns:
- Boolean property value or defaultValue if not found.
-
getLongProperty
public Long getLongProperty(String key)
Description copied from interface:PropertyMap
Gets the Long property for the given key. This method may be used to retrieve properties of type "integer".- Specified by:
getLongProperty
in interfacePropertyMap
- Parameters:
key
- key of the desired property- Returns:
- Long property value or
null
if not found.
-
getLongProperty
public Long getLongProperty(String key, Long defaultValue)
Description copied from interface:PropertyMap
Gets the Long property for the given key, returning the defaultValue if the located property valuenull
. This method may be used to retrieve properties of type "integer".- Specified by:
getLongProperty
in interfacePropertyMap
- Parameters:
key
- key of the desired propertydefaultValue
- value to return if property value isnull
- Returns:
- Long property value or defaultValue if not found.
-
getPrivateKeyStoreProperty
public PrivateKeyStore getPrivateKeyStoreProperty(String key)
Description copied from interface:PropertyMap
Gets the KeyStore property for the given key. This method may be used to retrieve properties of type PrivateKeyStore. The PrivateKeyStore contains a java KeyStore containing a single private key and the keystore password.- Specified by:
getPrivateKeyStoreProperty
in interfacePropertyMap
- Parameters:
key
- key of the desired property- Returns:
- PrivateKeyStore property value or
null
if not found.
-
getPublicKeyStoreProperty
public PublicKeyStore getPublicKeyStoreProperty(String key)
Description copied from interface:PropertyMap
Gets the KeyStore property for the given key. This method may be used to retrieve properties of type PublicKeyStore. The PublicKeyStore contains a java KeyStore containing a single public key.- Specified by:
getPublicKeyStoreProperty
in interfacePropertyMap
- Parameters:
key
- key of the desired property- Returns:
- PublicKeyStore property value or
null
if not found.
-
getOAuth2Context
public OAuth2Context getOAuth2Context(String key)
Description copied from interface:PropertyMap
Gets the OAuth2Context property for the given key. This method may be used to retrieve properties of type OAuth2Context. The OAuth2Context contains OAuth 2 configuration.- Specified by:
getOAuth2Context
in interfacePropertyMap
- Parameters:
key
- key of the desired property- Returns:
- OAuth2Context property value or
null
if not found.
-
getCustomProperties
public Map<String,String> getCustomProperties(String key)
Description copied from interface:PropertyMap
Gets the key/value pairs as a map for custom property type fields. This method may be used to retrieve the keys and values for properties of type "customproperties". If the property is not found for a given key an empty map will be returned.- Specified by:
getCustomProperties
in interfacePropertyMap
- Parameters:
key
- key of the desired property- Returns:
- An immutable Map where the map entry key is a custom property key as a string and the map entry value is a string representing the value, decrypted when necessary.
-
-