Module spring.data.mongodb
Class CollectionOptions.EncryptedFieldsOptions
java.lang.Object
org.springframework.data.mongodb.core.CollectionOptions.EncryptedFieldsOptions
- Enclosing class:
- CollectionOptions
Encapsulation of Encryption options for collections.
- Since:
- 4.5
- Author:
- Christoph Strobl
-
Method Summary
Modifier and TypeMethodDescriptionencrypted(JsonSchemaProperty property, Object keyId) Add apropertythat should be encrypted but not queryable.fromProperties(List<? extends JsonSchemaProperty> properties) fromSchema(MongoJsonSchema schema) none()queryable(JsonSchemaProperty property, QueryCharacteristic... characteristics) Add a newqueryable propertyfor the given source property.org.bson.DocumentAdd anencrypted propertythat should not be queryable.
-
Method Details
-
none
- Returns:
NONE
-
fromSchema
- Returns:
- new instance of
CollectionOptions.EncryptedFieldsOptions.
-
fromProperties
public static CollectionOptions.EncryptedFieldsOptions fromProperties(List<? extends JsonSchemaProperty> properties) - Returns:
- new instance of
CollectionOptions.EncryptedFieldsOptions.
-
queryable
@Contract("_, _ -> new") @CheckReturnValue public CollectionOptions.EncryptedFieldsOptions queryable(JsonSchemaProperty property, QueryCharacteristic... characteristics) Add a newqueryable propertyfor the given source property.Please note that, a given
JsonSchemaPropertymay override options from a givenMongoJsonSchemaif set.- Parameters:
property- the queryable source - typicallyencrypted.characteristics- the query options to set.- Returns:
- new instance of
CollectionOptions.EncryptedFieldsOptions.
-
with
@Contract("_ -> new") @CheckReturnValue public CollectionOptions.EncryptedFieldsOptions with(IdentifiableJsonSchemaProperty.EncryptedJsonSchemaProperty property) Add anencrypted propertythat should not be queryable.- Parameters:
property- must not be null.- Returns:
- new instance of
CollectionOptions.EncryptedFieldsOptions. - Since:
- 4.5.1
-
encrypted
@Contract("_, _ -> new") @CheckReturnValue public CollectionOptions.EncryptedFieldsOptions encrypted(JsonSchemaProperty property, @Nullable Object keyId) Add apropertythat should be encrypted but not queryable.- Parameters:
property- must not be null.keyId- the key identifier to be used, can be null.- Returns:
- new instance of
CollectionOptions.EncryptedFieldsOptions. - Since:
- 4.5.1
-
toDocument
public org.bson.Document toDocument()
-