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(S) or
DefaultTypeMapper.getDefaultedTypeToBeUsed(S). respectively.- Since:
- 2.0
- Author:
- Mark Paluch
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreate a defaultVaultTypeMapperthat exchanges types using the type key _class.DefaultVaultTypeMapper(@Nullable String typeKey) Create a defaultVaultTypeMapperthat exchanges types using the giventypeKey.DefaultVaultTypeMapper(@Nullable String typeKey, List<? extends TypeInformationMapper> mappers) DefaultVaultTypeMapper(@Nullable String typeKey, MappingContext<? extends PersistentEntity<?, ?>, ?> mappingContext) -
Method Summary
Modifier and TypeMethodDescriptionprotected TypeInformation<?>getFallbackTypeFor(Map<String, Object> source) booleanChecks whether the given key name matches the typeKey.Methods inherited from class org.springframework.data.convert.DefaultTypeMapper
getAliasFor, readType, readType, setBeanClassLoader, writeType, writeTypeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.data.convert.TypeMapper
readType, readType, writeType, writeType
-
Field Details
-
DEFAULT_TYPE_KEY
- See Also:
-
-
Constructor Details
-
DefaultVaultTypeMapper
public DefaultVaultTypeMapper()Create a defaultVaultTypeMapperthat exchanges types using the type key _class. -
DefaultVaultTypeMapper
Create a defaultVaultTypeMapperthat 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:
isTypeKeyin interfaceVaultTypeMapper- Parameters:
key-- Returns:
- true if
keymatches the typeKey.
-
getFallbackTypeFor
- Overrides:
getFallbackTypeForin classDefaultTypeMapper<Map<String,Object>>
-