Class DefaultVaultTypeMapper
java.lang.Object
org.springframework.data.convert.DefaultTypeMapper<Map<String,Object>>
org.springframework.vault.repository.convert.DefaultVaultTypeMapper
- All Implemented Interfaces:
Aware
,BeanClassLoaderAware
,TypeMapper<Map<String,
,Object>> VaultTypeMapper
public class DefaultVaultTypeMapper
extends DefaultTypeMapper<Map<String,Object>>
implements VaultTypeMapper
Default implementation of
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.- Since:
- 2.0
- Author:
- Mark Paluch
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a defaultVaultTypeMapper
that exchanges types using the type key _class.DefaultVaultTypeMapper
(String typeKey) Creates a defaultVaultTypeMapper
that exchanges types using the giventypeKey
.DefaultVaultTypeMapper
(String typeKey, List<? extends TypeInformationMapper> mappers) DefaultVaultTypeMapper
(String typeKey, MappingContext<? extends PersistentEntity<?, ?>, ?> mappingContext) -
Method Summary
Modifier and TypeMethodDescriptionprotected TypeInformation<?>
getFallbackTypeFor
(Map<String, Object> source) boolean
Checks whether the given key name matches the typeKey.Methods inherited from class org.springframework.data.convert.DefaultTypeMapper
getAliasFor, readType, readType, setBeanClassLoader, writeType, writeType
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.data.convert.TypeMapper
readType, readType, writeType, writeType
-
Field Details
-
DEFAULT_TYPE_KEY
- See Also:
-
-
Constructor Details
-
DefaultVaultTypeMapper
public DefaultVaultTypeMapper()Creates a defaultVaultTypeMapper
that exchanges types using the type key _class. -
DefaultVaultTypeMapper
Creates a defaultVaultTypeMapper
that exchanges types using the giventypeKey
.- Parameters:
typeKey
- may not be null to disable type hinting.
-
DefaultVaultTypeMapper
public DefaultVaultTypeMapper(@Nullable String typeKey, MappingContext<? extends PersistentEntity<?, ?>, ?> mappingContext) - Parameters:
typeKey
- may not be null to disable type hinting.mappingContext
- must not be null or empty.
-
DefaultVaultTypeMapper
public DefaultVaultTypeMapper(@Nullable String typeKey, List<? extends TypeInformationMapper> mappers)
-
-
Method Details
-
isTypeKey
Checks whether the given key name matches the typeKey.- Specified by:
isTypeKey
in interfaceVaultTypeMapper
- Parameters:
key
-- Returns:
- true if
key
matches the typeKey.
-
getFallbackTypeFor
- Overrides:
getFallbackTypeFor
in classDefaultTypeMapper<Map<String,
Object>>
-