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 theMongoPersistentProperty
to be handled.lookupValue
(String path) Lookup the value for a given path within the current context.default <T> T
Reads the value as an instance of theproperty type
.default <T> T
Reads the value as an instance oftype
.<T> T
read
(Object value, TypeInformation<T> target) Reads the value as an instance oftype
.default <T> T
Write the value as an instance of theproperty type
.default <T> T
Write the value as an instance oftype
.<T> T
write
(Object value, TypeInformation<T> target) Write the value as an instance of giventype
.
-
Method Details
-
getProperty
MongoPersistentProperty getProperty()Returns theMongoPersistentProperty
to 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
-value
to 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
-value
to be read; can be null.target
-type
of 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
-value
to be read; can be null.target
-type
of 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
-value
to 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
-value
to write; can be null.target
-type
of 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
-value
to write; can be null.target
-type
of 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
-