Module spring.data.mongodb
Interface EncryptionContext
public interface EncryptionContext
Context to encapsulate encryption for a specific
MongoPersistentProperty.- Since:
- 4.1
- Author:
- Christoph Strobl
-
Method Summary
Modifier and TypeMethodDescriptionconvertToMongoType(Object value) Shortcut for converting a given value into its store representation using the rootValueConversionContext.getEvaluationContext(Object source) Returns theMongoPersistentPropertyto be handled.lookupValue(String path) Lookup the value for a given path within the current context.default <T> TReads the value as an instance of theproperty type.default <T> TReads the value as an instance oftype.<T> Tread(Object value, TypeInformation<T> target) Reads the value as an instance oftype.default <T> TWrite the value as an instance of theproperty type.default <T> TWrite the value as an instance oftype.<T> Twrite(Object value, TypeInformation<T> target) Write the value as an instance of giventype.
-
Method Details
-
getProperty
MongoPersistentProperty getProperty()Returns theMongoPersistentPropertyto be handled.- Returns:
- will never be null.
-
convertToMongoType
Shortcut for converting a given value into its store representation using the rootValueConversionContext.- Parameters:
value-- Returns:
-
read
Reads the value as an instance of theproperty type.- Parameters:
value-valueto be read; can be null.- Returns:
- can be null.
- Throws:
IllegalStateException- if value cannot be read as an instance oftype.
-
read
Reads the value as an instance oftype.- Parameters:
value-valueto be read; can be null.target-typeof value to be read; must not be null.- Returns:
- can be null.
- Throws:
IllegalStateException- if value cannot be read as an instance oftype.
-
read
Reads the value as an instance oftype.- Parameters:
value-valueto be read; can be null.target-typeof value to be read; must not be null.- Returns:
- can be null.
- Throws:
IllegalStateException- if value cannot be read as an instance oftype.
-
write
Write the value as an instance of theproperty type.- Parameters:
value-valueto write; can be null.- Returns:
- can be null.
- Throws:
IllegalStateException- if value cannot be written as an instance of theproperty type.- See Also:
-
write
Write the value as an instance oftype.- Parameters:
value-valueto write; can be null.target-typeof value to be written; must not be null.- Returns:
- can be null.
- Throws:
IllegalStateException- if value cannot be written as an instance oftype.
-
write
Write the value as an instance of giventype.- Parameters:
value-valueto write; can be null.target-typeof value to be written; must not be null.- Returns:
- can be null.
- Throws:
IllegalStateException- if value cannot be written as an instance oftype.
-
lookupValue
Lookup the value for a given path within the current context.- Parameters:
path- the path/property name to resolve the current value for.- Returns:
- can be null.
-
getEvaluationContext
-