public class DefaultVaultTypeMapper extends DefaultTypeMapper<Map<String,Object>> implements VaultTypeMapper
VaultTypeMapper
allowing configuration of the key to
lookup and store type information in SecretDocument
. The key defaults to
DEFAULT_TYPE_KEY
. Actual type-to-String
conversion and back is done in
DefaultTypeMapper.readType(Object)
or DefaultTypeMapper.getDefaultedTypeToBeUsed(Object)
. respectively.Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_TYPE_KEY |
Constructor and Description |
---|
DefaultVaultTypeMapper()
Creates a default
VaultTypeMapper that exchanges types using the type key
_class. |
DefaultVaultTypeMapper(String typeKey)
Creates a default
VaultTypeMapper that exchanges types using the given
typeKey . |
DefaultVaultTypeMapper(String typeKey,
List<? extends TypeInformationMapper> mappers) |
DefaultVaultTypeMapper(String typeKey,
MappingContext<? extends PersistentEntity<?,?>,?> mappingContext)
|
Modifier and Type | Method and Description |
---|---|
protected TypeInformation<?> |
getFallbackTypeFor(Map<String,Object> source) |
boolean |
isTypeKey(String key)
Checks whether the given key name matches the typeKey.
|
getAliasFor, readType, readType, writeType, writeType
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
readType, readType, writeType, writeType
public static final String DEFAULT_TYPE_KEY
public DefaultVaultTypeMapper()
VaultTypeMapper
that exchanges types using the type key
_class.public DefaultVaultTypeMapper(@Nullable String typeKey)
VaultTypeMapper
that exchanges types using the given
typeKey
.typeKey
- may not be null to disable type hinting.public DefaultVaultTypeMapper(@Nullable String typeKey, MappingContext<? extends PersistentEntity<?,?>,?> mappingContext)
typeKey
- may not be null to disable type hinting.mappingContext
- must not be null or empty.public DefaultVaultTypeMapper(@Nullable String typeKey, List<? extends TypeInformationMapper> mappers)
public boolean isTypeKey(String key)
isTypeKey
in interface VaultTypeMapper
key
- key
matches the typeKey.protected TypeInformation<?> getFallbackTypeFor(Map<String,Object> source)
getFallbackTypeFor
in class DefaultTypeMapper<Map<String,Object>>
Copyright © 2016–2020 Pivotal Software, Inc.. All rights reserved.