Package io.jsondb.query.ddl
Class CollectionSchemaUpdate
- java.lang.Object
-
- io.jsondb.query.ddl.CollectionSchemaUpdate
-
public class CollectionSchemaUpdate extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCollectionSchemaUpdate.Type
-
Constructor Summary
Constructors Constructor Description CollectionSchemaUpdate()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,AddOperation>getAddOperations()Returns a Map of ADD operations which have a non-null default value specified.java.util.Map<java.lang.String,DeleteOperation>getDeleteOperations()Returns a Map of DELETE operations.java.util.Map<java.lang.String,RenameOperation>getRenameOperations()Returns a Map of RENAME operations.java.util.Map<java.lang.String,IOperation>getUpdateData()CollectionSchemaUpdateset(java.lang.String key, IOperation operation)A method to set a new Operation for a key.static CollectionSchemaUpdateupdate(java.lang.String key, IOperation operation)Static factory method to create an CollectionUpdate for the specified key
-
-
-
Method Detail
-
update
public static CollectionSchemaUpdate update(java.lang.String key, IOperation operation)
Static factory method to create an CollectionUpdate for the specified key- Parameters:
key- : JSON attribute to updateoperation- : operation to carry out on the attribute- Returns:
- the updated CollectionSchemaUpdate
-
set
public CollectionSchemaUpdate set(java.lang.String key, IOperation operation)
A method to set a new Operation for a key. It may be of type ADD, RENAME or DELETE. Only one operation per key can be specified. Attempt to add a second operation for a any key will override the first one. Attempt to add a ADD operation for a key which already exists will have no effect. Attempt to add a DELETE operation for akey which does not exist will have no effect.- Parameters:
key- (a.k.a JSON Field name) for which operation is being addedoperation- operation to perform- Returns:
- the updated CollectionSchemaUpdate
-
getUpdateData
public java.util.Map<java.lang.String,IOperation> getUpdateData()
-
getAddOperations
public java.util.Map<java.lang.String,AddOperation> getAddOperations()
Returns a Map of ADD operations which have a non-null default value specified.- Returns:
- Map of ADD operations which have a non-null default value specified
-
getRenameOperations
public java.util.Map<java.lang.String,RenameOperation> getRenameOperations()
Returns a Map of RENAME operations.- Returns:
- Map of RENAME operations which have a non-null default value specified
-
getDeleteOperations
public java.util.Map<java.lang.String,DeleteOperation> getDeleteOperations()
Returns a Map of DELETE operations.- Returns:
- Map of DELETE operations which have a non-null default value specified
-
-