diff --git a/src/main/java/com/aerospike/restclient/domain/RestClientError.java b/src/main/java/com/aerospike/restclient/domain/RestClientError.java index 64e2651f..775c6457 100644 --- a/src/main/java/com/aerospike/restclient/domain/RestClientError.java +++ b/src/main/java/com/aerospike/restclient/domain/RestClientError.java @@ -29,7 +29,7 @@ public class RestClientError { @Schema( description = "A boolean specifying whether it was possible that the operation succeeded. This is only included if true.", - required = true, + requiredMode = Schema.RequiredMode.REQUIRED, example = "false" ) private final Boolean inDoubt; @@ -37,18 +37,6 @@ public class RestClientError { @Schema(description = "An internal error code for diagnostic purposes. This may be null", example = "-3") private final Integer internalErrorCode; - public String getMessage() { - return message; - } - - public Boolean getInDoubt() { - return inDoubt; - } - - public Integer getInternalErrorCode() { - return internalErrorCode; - } - public RestClientError(AerospikeException ex) { this.message = ex.getMessage(); this.inDoubt = ex.getInDoubt(); @@ -68,10 +56,25 @@ public RestClientError(String message) { } @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - public RestClientError(@JsonProperty("message") String message, @JsonProperty("inDoubt") boolean inDoubt, - @JsonProperty("internalErrorCode") int internalErrorCode) { + public RestClientError( + @JsonProperty("message") String message, + @JsonProperty("inDoubt") boolean inDoubt, + @JsonProperty("internalErrorCode") int internalErrorCode + ) { this.message = message; this.inDoubt = inDoubt; this.internalErrorCode = internalErrorCode; } + + public String getMessage() { + return message; + } + + public Boolean getInDoubt() { + return inDoubt; + } + + public Integer getInternalErrorCode() { + return internalErrorCode; + } } diff --git a/src/main/java/com/aerospike/restclient/domain/RestClientKey.java b/src/main/java/com/aerospike/restclient/domain/RestClientKey.java index b97d31b1..ce446c3c 100644 --- a/src/main/java/com/aerospike/restclient/domain/RestClientKey.java +++ b/src/main/java/com/aerospike/restclient/domain/RestClientKey.java @@ -31,7 +31,7 @@ public class RestClientKey { - @Schema(required = true, example = "testNS") + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, example = "testNS") public String namespace; @JsonProperty(value = "setName") @@ -46,7 +46,7 @@ public class RestClientKey { public RecordKeyType keyType; @Schema( - required = true, + requiredMode = Schema.RequiredMode.REQUIRED, description = "The user key, it may be a string, integer, or URL safe Base64 encoded bytes.", example = "userKey" ) diff --git a/src/main/java/com/aerospike/restclient/domain/RestClientKeyRecord.java b/src/main/java/com/aerospike/restclient/domain/RestClientKeyRecord.java index 2f3e3480..19b33fd7 100644 --- a/src/main/java/com/aerospike/restclient/domain/RestClientKeyRecord.java +++ b/src/main/java/com/aerospike/restclient/domain/RestClientKeyRecord.java @@ -37,9 +37,11 @@ public RestClientKeyRecord(Key key, Record rec) { bins = rec.bins; } - @Schema(required = true, + @Schema( + requiredMode = Schema.RequiredMode.REQUIRED, description = "The user key, it may be a string, integer, or URL safe Base64 encoded bytes.", - example = "userKey") + example = "userKey" + ) public Object userKey; @Schema(name = "generation", description = "The generation of the record.", example = "2") @@ -48,7 +50,10 @@ public RestClientKeyRecord(Key key, Record rec) { @Schema(name = "ttl", description = "The time to live for the record, in seconds from now.", example = "1000") public int ttl; - @Schema(name = "bins", description = "A mapping from binName to binValue", - example = "{\"bin1\": \"val1\", \"pi\": \"3.14\"}") + @Schema( + name = "bins", + description = "A mapping from binName to binValue", + example = "{\"bin1\": \"val1\", \"pi\": \"3.14\"}" + ) public Map bins; } diff --git a/src/main/java/com/aerospike/restclient/domain/RestClientOperation.java b/src/main/java/com/aerospike/restclient/domain/RestClientOperation.java index 1cf2cce6..27f99221 100644 --- a/src/main/java/com/aerospike/restclient/domain/RestClientOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/RestClientOperation.java @@ -55,11 +55,13 @@ public RestClientOperation(Map opMap) { } @Schema( - required = true, description = "Aerospike operation to perform on the record", example = "LIST_APPEND_ITEMS" + requiredMode = Schema.RequiredMode.REQUIRED, + description = "Aerospike operation to perform on the record", + example = "LIST_APPEND_ITEMS" ) private AerospikeOperation operation; - @Schema(required = true, example = "{\"bin\":\"listbin\", \"values\":[1,2,3]}") + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, example = "{\"bin\":\"listbin\", \"values\":[1,2,3]}") private Map opValues; public AerospikeOperation getOperation() { diff --git a/src/main/java/com/aerospike/restclient/domain/RestClientPrivilege.java b/src/main/java/com/aerospike/restclient/domain/RestClientPrivilege.java index ca289116..8676f227 100644 --- a/src/main/java/com/aerospike/restclient/domain/RestClientPrivilege.java +++ b/src/main/java/com/aerospike/restclient/domain/RestClientPrivilege.java @@ -25,7 +25,7 @@ public class RestClientPrivilege { @NotNull - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) PrivilegeCode code; @Schema(description = "Namespace Scope", example = "testNS") diff --git a/src/main/java/com/aerospike/restclient/domain/RestClientRole.java b/src/main/java/com/aerospike/restclient/domain/RestClientRole.java index 176610cc..8cb86d0d 100644 --- a/src/main/java/com/aerospike/restclient/domain/RestClientRole.java +++ b/src/main/java/com/aerospike/restclient/domain/RestClientRole.java @@ -28,11 +28,11 @@ public class RestClientRole { @NotNull - @Schema(required = true, description = "Role name.", example = "customRole") + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "Role name.", example = "customRole") private String name; @NotNull - @Schema(required = true, description = "List of assigned privileges.") + @Schema(requiredMode = Schema.RequiredMode.REQUIRED, description = "List of assigned privileges.") private List privileges; @Schema(description = "List of allowable IP addresses.") diff --git a/src/main/java/com/aerospike/restclient/domain/batchmodels/BatchDelete.java b/src/main/java/com/aerospike/restclient/domain/batchmodels/BatchDelete.java index aa75cc21..0f79c909 100644 --- a/src/main/java/com/aerospike/restclient/domain/batchmodels/BatchDelete.java +++ b/src/main/java/com/aerospike/restclient/domain/batchmodels/BatchDelete.java @@ -32,8 +32,8 @@ public class BatchDelete extends BatchRecord { @Schema( description = "The type of batch request. It is always " + AerospikeAPIConstants.BATCH_TYPE_DELETE, - allowableValues = AerospikeAPIConstants.BATCH_TYPE_DELETE, - required = true + allowableValues = {AerospikeAPIConstants.BATCH_TYPE_DELETE}, + requiredMode = Schema.RequiredMode.REQUIRED ) public final String type = AerospikeAPIConstants.BATCH_TYPE_DELETE; diff --git a/src/main/java/com/aerospike/restclient/domain/batchmodels/BatchRead.java b/src/main/java/com/aerospike/restclient/domain/batchmodels/BatchRead.java index 6b958be9..b69d8848 100644 --- a/src/main/java/com/aerospike/restclient/domain/batchmodels/BatchRead.java +++ b/src/main/java/com/aerospike/restclient/domain/batchmodels/BatchRead.java @@ -34,8 +34,8 @@ public class BatchRead extends BatchRecord { @Schema( description = "The type of batch request. It is always " + AerospikeAPIConstants.BATCH_TYPE_READ, - allowableValues = AerospikeAPIConstants.BATCH_TYPE_READ, - required = true + allowableValues = {AerospikeAPIConstants.BATCH_TYPE_READ}, + requiredMode = Schema.RequiredMode.REQUIRED ) public final String type = AerospikeAPIConstants.BATCH_TYPE_READ; diff --git a/src/main/java/com/aerospike/restclient/domain/batchmodels/BatchRecord.java b/src/main/java/com/aerospike/restclient/domain/batchmodels/BatchRecord.java index b541dbf9..a496c324 100644 --- a/src/main/java/com/aerospike/restclient/domain/batchmodels/BatchRecord.java +++ b/src/main/java/com/aerospike/restclient/domain/batchmodels/BatchRecord.java @@ -24,28 +24,20 @@ import io.swagger.v3.oas.annotations.media.Schema; @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") -@JsonSubTypes( - { - @JsonSubTypes.Type(value = BatchRead.class, name = AerospikeAPIConstants.BATCH_TYPE_READ), - @JsonSubTypes.Type( - value = BatchWrite.class, name = AerospikeAPIConstants.BATCH_TYPE_WRITE - ), - @JsonSubTypes.Type( - value = BatchDelete.class, name = AerospikeAPIConstants.BATCH_TYPE_DELETE - ), - @JsonSubTypes.Type(value = BatchUDF.class, name = AerospikeAPIConstants.BATCH_TYPE_UDF), - } -) +@JsonSubTypes({ + @JsonSubTypes.Type(value = BatchRead.class, name = AerospikeAPIConstants.BATCH_TYPE_READ), + @JsonSubTypes.Type(value = BatchWrite.class, name = AerospikeAPIConstants.BATCH_TYPE_WRITE), + @JsonSubTypes.Type(value = BatchDelete.class, name = AerospikeAPIConstants.BATCH_TYPE_DELETE), + @JsonSubTypes.Type(value = BatchUDF.class, name = AerospikeAPIConstants.BATCH_TYPE_UDF), +}) @Schema( - description = "The batch operation base type.", oneOf = { - BatchRead.class, BatchWrite.class, BatchDelete.class, BatchUDF.class -} + description = "The batch operation base type.", + oneOf = {BatchRead.class, BatchWrite.class, BatchDelete.class, BatchUDF.class} ) public abstract class BatchRecord { - @Schema(description = "Key to a record.", required = true) + @Schema(description = "Key to a record.", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty(required = true) public RestClientKey key; - abstract public com.aerospike.client.BatchRecord toBatchRecord(); + public abstract com.aerospike.client.BatchRecord toBatchRecord(); } - diff --git a/src/main/java/com/aerospike/restclient/domain/batchmodels/BatchRecordResponse.java b/src/main/java/com/aerospike/restclient/domain/batchmodels/BatchRecordResponse.java index 6e902a4f..7e1dac97 100644 --- a/src/main/java/com/aerospike/restclient/domain/batchmodels/BatchRecordResponse.java +++ b/src/main/java/com/aerospike/restclient/domain/batchmodels/BatchRecordResponse.java @@ -31,29 +31,25 @@ ) public class BatchRecordResponse { - public BatchRecordResponse() { - } - - public BatchRecordResponse(BatchRecord batchRecord) { - resultCode = batchRecord.resultCode; - resultCodeString = ResultCode.getResultString(resultCode); - record = batchRecord.record != null ? new RestClientRecord(batchRecord.record) : null; - key = new RestClientKey(batchRecord.key); - inDoubt = batchRecord.inDoubt; - } - @Schema(description = "Result code for this returned record.") public int resultCode; - @Schema(description = "Message associated with resultCode.") public String resultCodeString; - @Schema(description = "Record associated with the key. Null if the record was not found.") public RestClientRecord record; - @Schema(description = "Key to retrieve a record.") public RestClientKey key; - @Schema(description = "Is it possible that the write transaction may have completed even though an error occurred for this record.") public boolean inDoubt; -} \ No newline at end of file + + public BatchRecordResponse() { + } + + public BatchRecordResponse(BatchRecord batchRecord) { + resultCode = batchRecord.resultCode; + resultCodeString = ResultCode.getResultString(resultCode); + record = batchRecord.record != null ? new RestClientRecord(batchRecord.record) : null; + key = new RestClientKey(batchRecord.key); + inDoubt = batchRecord.inDoubt; + } +} diff --git a/src/main/java/com/aerospike/restclient/domain/batchmodels/BatchUDF.java b/src/main/java/com/aerospike/restclient/domain/batchmodels/BatchUDF.java index a8ad8e90..630c460c 100644 --- a/src/main/java/com/aerospike/restclient/domain/batchmodels/BatchUDF.java +++ b/src/main/java/com/aerospike/restclient/domain/batchmodels/BatchUDF.java @@ -38,8 +38,8 @@ public class BatchUDF extends BatchRecord { @Schema( description = "List of bins to limit the record response to.", - allowableValues = AerospikeAPIConstants.BATCH_TYPE_UDF, - required = true + allowableValues = {AerospikeAPIConstants.BATCH_TYPE_UDF}, + requiredMode = Schema.RequiredMode.REQUIRED ) @JsonProperty(required = true) public final String type = AerospikeAPIConstants.BATCH_TYPE_UDF; @@ -81,4 +81,3 @@ public com.aerospike.client.BatchUDF toBatchRecord() { return new com.aerospike.client.BatchUDF(batchUDFPolicy, key.toKey(), packageName, functionName, values); } } - diff --git a/src/main/java/com/aerospike/restclient/domain/batchmodels/BatchWrite.java b/src/main/java/com/aerospike/restclient/domain/batchmodels/BatchWrite.java index e496b873..cfe4eda7 100644 --- a/src/main/java/com/aerospike/restclient/domain/batchmodels/BatchWrite.java +++ b/src/main/java/com/aerospike/restclient/domain/batchmodels/BatchWrite.java @@ -36,8 +36,8 @@ public class BatchWrite extends BatchRecord { @Schema( description = "List of bins to limit the record response to.", - allowableValues = AerospikeAPIConstants.BATCH_TYPE_WRITE, - required = true + allowableValues = {AerospikeAPIConstants.BATCH_TYPE_WRITE}, + requiredMode = Schema.RequiredMode.REQUIRED ) @JsonProperty(required = true) public final String type = AerospikeAPIConstants.BATCH_TYPE_WRITE; diff --git a/src/main/java/com/aerospike/restclient/domain/ctxmodels/CTX.java b/src/main/java/com/aerospike/restclient/domain/ctxmodels/CTX.java index c2a06cd8..77cedeb8 100644 --- a/src/main/java/com/aerospike/restclient/domain/ctxmodels/CTX.java +++ b/src/main/java/com/aerospike/restclient/domain/ctxmodels/CTX.java @@ -39,21 +39,17 @@ } ) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") -@JsonSubTypes( - { - @JsonSubTypes.Type(value = ListIndexCTX.class, name = AerospikeAPIConstants.CTX.LIST_INDEX), - @JsonSubTypes.Type(value = ListRankCTX.class, name = AerospikeAPIConstants.CTX.LIST_RANK), - @JsonSubTypes.Type(value = ListValueCTX.class, name = AerospikeAPIConstants.CTX.LIST_VALUE), - @JsonSubTypes.Type(value = MapIndexCTX.class, name = AerospikeAPIConstants.CTX.MAP_INDEX), - @JsonSubTypes.Type(value = MapRankCTX.class, name = AerospikeAPIConstants.CTX.MAP_RANK), - @JsonSubTypes.Type(value = MapKeyCTX.class, name = AerospikeAPIConstants.CTX.MAP_KEY), - @JsonSubTypes.Type(value = MapValueCTX.class, name = AerospikeAPIConstants.CTX.MAP_VALUE), - @JsonSubTypes.Type(value = MapKeyCreateCTX.class, name = AerospikeAPIConstants.CTX.MAP_KEY_CREATE), - @JsonSubTypes.Type( - value = ListIndexCreateCTX.class, name = AerospikeAPIConstants.CTX.LIST_INDEX_CREATE - ), - } -) -abstract public class CTX { - abstract public com.aerospike.client.cdt.CTX toCTX(); +@JsonSubTypes({ + @JsonSubTypes.Type(value = ListIndexCTX.class, name = AerospikeAPIConstants.CTX.LIST_INDEX), + @JsonSubTypes.Type(value = ListRankCTX.class, name = AerospikeAPIConstants.CTX.LIST_RANK), + @JsonSubTypes.Type(value = ListValueCTX.class, name = AerospikeAPIConstants.CTX.LIST_VALUE), + @JsonSubTypes.Type(value = MapIndexCTX.class, name = AerospikeAPIConstants.CTX.MAP_INDEX), + @JsonSubTypes.Type(value = MapRankCTX.class, name = AerospikeAPIConstants.CTX.MAP_RANK), + @JsonSubTypes.Type(value = MapKeyCTX.class, name = AerospikeAPIConstants.CTX.MAP_KEY), + @JsonSubTypes.Type(value = MapValueCTX.class, name = AerospikeAPIConstants.CTX.MAP_VALUE), + @JsonSubTypes.Type(value = MapKeyCreateCTX.class, name = AerospikeAPIConstants.CTX.MAP_KEY_CREATE), + @JsonSubTypes.Type(value = ListIndexCreateCTX.class, name = AerospikeAPIConstants.CTX.LIST_INDEX_CREATE), +}) +public abstract class CTX { + public abstract com.aerospike.client.cdt.CTX toCTX(); } diff --git a/src/main/java/com/aerospike/restclient/domain/ctxmodels/ListIndexCTX.java b/src/main/java/com/aerospike/restclient/domain/ctxmodels/ListIndexCTX.java index 488b09c2..26617bb5 100644 --- a/src/main/java/com/aerospike/restclient/domain/ctxmodels/ListIndexCTX.java +++ b/src/main/java/com/aerospike/restclient/domain/ctxmodels/ListIndexCTX.java @@ -28,14 +28,14 @@ public class ListIndexCTX extends CTX { @Schema( description = "The type of context this object represents. It is always " + AerospikeAPIConstants.CTX.LIST_INDEX, - allowableValues = AerospikeAPIConstants.CTX.LIST_INDEX, - required = true + allowableValues = {AerospikeAPIConstants.CTX.LIST_INDEX}, + requiredMode = Schema.RequiredMode.REQUIRED ) public final String type = AerospikeAPIConstants.CTX.LIST_INDEX; @Schema( description = "If the index is negative, the resolved index starts backwards from end of list. If an index is out of bounds, a parameter error will be returned. Examples:\n" + "* 0: First item.\n" + "* 4: Fifth item.\n" + "* -1: Last item.\n" + "* -3: Third to last item.", - required = true + requiredMode = Schema.RequiredMode.REQUIRED ) public Integer index; diff --git a/src/main/java/com/aerospike/restclient/domain/ctxmodels/ListIndexCreateCTX.java b/src/main/java/com/aerospike/restclient/domain/ctxmodels/ListIndexCreateCTX.java index aab77582..2364164c 100644 --- a/src/main/java/com/aerospike/restclient/domain/ctxmodels/ListIndexCreateCTX.java +++ b/src/main/java/com/aerospike/restclient/domain/ctxmodels/ListIndexCreateCTX.java @@ -28,14 +28,14 @@ public class ListIndexCreateCTX extends CTX { @Schema( description = "The type of context this object represents. It is always " + AerospikeAPIConstants.CTX.LIST_INDEX_CREATE, - allowableValues = AerospikeAPIConstants.CTX.LIST_INDEX_CREATE, - required = true + allowableValues = {AerospikeAPIConstants.CTX.LIST_INDEX_CREATE}, + requiredMode = Schema.RequiredMode.REQUIRED ) public final String type = AerospikeAPIConstants.CTX.LIST_INDEX_CREATE; @Schema( description = "If the index is negative, the resolved index starts backwards from end of list. If an index is out of bounds, a parameter error will be returned. Examples:\n" + "* 0: First item.\n" + "* 4: Fifth item.\n" + "* -1: Last item.\n" + "* -3: Third to last item.", - required = true + requiredMode = Schema.RequiredMode.REQUIRED ) public Integer index; diff --git a/src/main/java/com/aerospike/restclient/domain/ctxmodels/ListRankCTX.java b/src/main/java/com/aerospike/restclient/domain/ctxmodels/ListRankCTX.java index 30df84c0..94c5da54 100644 --- a/src/main/java/com/aerospike/restclient/domain/ctxmodels/ListRankCTX.java +++ b/src/main/java/com/aerospike/restclient/domain/ctxmodels/ListRankCTX.java @@ -27,8 +27,8 @@ public class ListRankCTX extends CTX { @Schema( description = "The type of context this object represents. It is always " + AerospikeAPIConstants.CTX.LIST_RANK, - allowableValues = AerospikeAPIConstants.CTX.LIST_RANK, - required = true + allowableValues = {AerospikeAPIConstants.CTX.LIST_RANK}, + requiredMode = Schema.RequiredMode.REQUIRED ) public final String type = AerospikeAPIConstants.CTX.LIST_RANK; @@ -36,7 +36,7 @@ public class ListRankCTX extends CTX { description = """ * 0 = smallest value * N = Nth smallest value - * -1 = largest value""", required = true + * -1 = largest value""", requiredMode = Schema.RequiredMode.REQUIRED ) public Integer rank; diff --git a/src/main/java/com/aerospike/restclient/domain/ctxmodels/ListValueCTX.java b/src/main/java/com/aerospike/restclient/domain/ctxmodels/ListValueCTX.java index c0434cb8..4e7c8a7a 100644 --- a/src/main/java/com/aerospike/restclient/domain/ctxmodels/ListValueCTX.java +++ b/src/main/java/com/aerospike/restclient/domain/ctxmodels/ListValueCTX.java @@ -31,13 +31,13 @@ public class ListValueCTX extends CTX { @Schema( description = "The type of context this object represents. It is always " + AerospikeAPIConstants.CTX.LIST_VALUE, - allowableValues = AerospikeAPIConstants.CTX.LIST_VALUE, - required = true + allowableValues = {AerospikeAPIConstants.CTX.LIST_VALUE}, + requiredMode = Schema.RequiredMode.REQUIRED ) @JsonProperty(required = true) public final String type = AerospikeAPIConstants.CTX.LIST_VALUE; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) @JsonDeserialize(using = ObjectDeserializer.class) public Object value; diff --git a/src/main/java/com/aerospike/restclient/domain/ctxmodels/MapIndexCTX.java b/src/main/java/com/aerospike/restclient/domain/ctxmodels/MapIndexCTX.java index 234bf006..36d1094c 100644 --- a/src/main/java/com/aerospike/restclient/domain/ctxmodels/MapIndexCTX.java +++ b/src/main/java/com/aerospike/restclient/domain/ctxmodels/MapIndexCTX.java @@ -28,15 +28,15 @@ public class MapIndexCTX extends CTX { @Schema( description = "The type of context this object represents. It is always " + AerospikeAPIConstants.CTX.MAP_INDEX, - allowableValues = AerospikeAPIConstants.CTX.MAP_INDEX, - required = true + allowableValues = {AerospikeAPIConstants.CTX.MAP_INDEX}, + requiredMode = Schema.RequiredMode.REQUIRED ) @JsonProperty(required = true) public final String type = AerospikeAPIConstants.CTX.MAP_INDEX; @Schema( description = "If the index is negative, the resolved index starts backwards from end of list. If an index is out of bounds, a parameter error will be returned. Examples:\n" + "\n" + "* 0: First item.\n" + "* 4: Fifth item.\n" + "* -1: Last item.\n" + "* -3: Third to last item.", - required = true + requiredMode = Schema.RequiredMode.REQUIRED ) @JsonProperty(required = true) public Integer index; diff --git a/src/main/java/com/aerospike/restclient/domain/ctxmodels/MapKeyCTX.java b/src/main/java/com/aerospike/restclient/domain/ctxmodels/MapKeyCTX.java index d348fcad..6bf4c133 100644 --- a/src/main/java/com/aerospike/restclient/domain/ctxmodels/MapKeyCTX.java +++ b/src/main/java/com/aerospike/restclient/domain/ctxmodels/MapKeyCTX.java @@ -31,14 +31,18 @@ public class MapKeyCTX extends CTX { @Schema( description = "The type of context this object represents. It is always " + AerospikeAPIConstants.CTX.MAP_KEY, - allowableValues = AerospikeAPIConstants.CTX.MAP_KEY, - required = true + allowableValues = {AerospikeAPIConstants.CTX.MAP_KEY}, + requiredMode = Schema.RequiredMode.REQUIRED ) @JsonProperty(required = true) public final String type = AerospikeAPIConstants.CTX.MAP_KEY; @JsonDeserialize(using = ObjectDeserializer.class) - @Schema(description = "String, Integer, or ByteArraySpecifiedType", required = true, example = "my-user-key") + @Schema( + description = "String, Integer, or ByteArraySpecifiedType", + requiredMode = Schema.RequiredMode.REQUIRED, + example = "my-user-key" + ) public Object key; public MapKeyCTX() { diff --git a/src/main/java/com/aerospike/restclient/domain/ctxmodels/MapKeyCreateCTX.java b/src/main/java/com/aerospike/restclient/domain/ctxmodels/MapKeyCreateCTX.java index 17658ec8..2a25eaec 100644 --- a/src/main/java/com/aerospike/restclient/domain/ctxmodels/MapKeyCreateCTX.java +++ b/src/main/java/com/aerospike/restclient/domain/ctxmodels/MapKeyCreateCTX.java @@ -32,13 +32,17 @@ public class MapKeyCreateCTX extends CTX { @Schema( description = "The type of context this object represents. It is always " + AerospikeAPIConstants.CTX.MAP_KEY_CREATE, - allowableValues = AerospikeAPIConstants.CTX.MAP_KEY_CREATE, - required = true + allowableValues = {AerospikeAPIConstants.CTX.MAP_KEY_CREATE}, + requiredMode = Schema.RequiredMode.REQUIRED ) @JsonProperty(required = true) public final String type = AerospikeAPIConstants.CTX.MAP_KEY_CREATE; - @Schema(description = "String, Integer, or ByteArraySpecifiedType", required = true, example = "my-user-key") + @Schema( + description = "String, Integer, or ByteArraySpecifiedType", + requiredMode = Schema.RequiredMode.REQUIRED, + example = "my-user-key" + ) @JsonDeserialize(using = ObjectDeserializer.class) public Object key; diff --git a/src/main/java/com/aerospike/restclient/domain/ctxmodels/MapRankCTX.java b/src/main/java/com/aerospike/restclient/domain/ctxmodels/MapRankCTX.java index fe970a71..23784362 100644 --- a/src/main/java/com/aerospike/restclient/domain/ctxmodels/MapRankCTX.java +++ b/src/main/java/com/aerospike/restclient/domain/ctxmodels/MapRankCTX.java @@ -28,8 +28,8 @@ public class MapRankCTX extends CTX { @Schema( description = "The type of context this object represents. It is always " + AerospikeAPIConstants.CTX.MAP_RANK, - allowableValues = AerospikeAPIConstants.CTX.MAP_RANK, - required = true + allowableValues = {AerospikeAPIConstants.CTX.MAP_RANK}, + requiredMode = Schema.RequiredMode.REQUIRED ) public final String type = AerospikeAPIConstants.CTX.MAP_RANK; @@ -37,7 +37,7 @@ public class MapRankCTX extends CTX { description = """ * 0 = smallest value * N = Nth smallest value - * -1 = largest value""", required = true + * -1 = largest value""", requiredMode = Schema.RequiredMode.REQUIRED ) public Integer rank; diff --git a/src/main/java/com/aerospike/restclient/domain/ctxmodels/MapValueCTX.java b/src/main/java/com/aerospike/restclient/domain/ctxmodels/MapValueCTX.java index 4e0623b7..3070c15f 100644 --- a/src/main/java/com/aerospike/restclient/domain/ctxmodels/MapValueCTX.java +++ b/src/main/java/com/aerospike/restclient/domain/ctxmodels/MapValueCTX.java @@ -31,13 +31,13 @@ public class MapValueCTX extends CTX { @Schema( description = "The type of context this object represents. It is always " + AerospikeAPIConstants.CTX.MAP_VALUE, - allowableValues = AerospikeAPIConstants.CTX.MAP_VALUE, - required = true + allowableValues = {AerospikeAPIConstants.CTX.MAP_VALUE}, + requiredMode = Schema.RequiredMode.REQUIRED ) @JsonProperty(required = true) public final String type = AerospikeAPIConstants.CTX.MAP_VALUE; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) @JsonDeserialize(using = ObjectDeserializer.class) public Object value; @@ -54,4 +54,3 @@ public com.aerospike.client.cdt.CTX toCTX() { return com.aerospike.client.cdt.CTX.mapValue(asVal); } } - diff --git a/src/main/java/com/aerospike/restclient/domain/geojsonmodels/AeroCircle.java b/src/main/java/com/aerospike/restclient/domain/geojsonmodels/AeroCircle.java index f58bd6bd..eff291f1 100644 --- a/src/main/java/com/aerospike/restclient/domain/geojsonmodels/AeroCircle.java +++ b/src/main/java/com/aerospike/restclient/domain/geojsonmodels/AeroCircle.java @@ -30,7 +30,7 @@ public class AeroCircle extends GeoJSON { @Schema( description = "The type of geoJSON geometry this object represents. It is always " + AerospikeAPIConstants.GeoJSON.Types.AERO_CIRCLE, allowableValues = {AerospikeAPIConstants.GeoJSON.Types.AERO_CIRCLE}, - required = true + requiredMode = Schema.RequiredMode.REQUIRED ) public final String type = AerospikeAPIConstants.GeoJSON.Types.AERO_CIRCLE; @@ -52,4 +52,3 @@ public int hashCode() { return Objects.hash(coordinates); } } - diff --git a/src/main/java/com/aerospike/restclient/domain/geojsonmodels/GeoJSON.java b/src/main/java/com/aerospike/restclient/domain/geojsonmodels/GeoJSON.java index b630d9f2..121769e6 100644 --- a/src/main/java/com/aerospike/restclient/domain/geojsonmodels/GeoJSON.java +++ b/src/main/java/com/aerospike/restclient/domain/geojsonmodels/GeoJSON.java @@ -28,22 +28,18 @@ // This is only a subset of the GeoJSON object supported by aerospike. More will be required // if this model is implemented in the Bin parser. Currently, it is only being used by QueryFilters. @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") -@JsonSubTypes( - { - @JsonSubTypes.Type(value = AeroCircle.class, name = AerospikeAPIConstants.GeoJSON.Types.AERO_CIRCLE), - @JsonSubTypes.Type(value = Point.class, name = AerospikeAPIConstants.GeoJSON.Types.POINT), - @JsonSubTypes.Type(value = Polygon.class, name = AerospikeAPIConstants.GeoJSON.Types.POLYGON), - } -) +@JsonSubTypes({ + @JsonSubTypes.Type(value = AeroCircle.class, name = AerospikeAPIConstants.GeoJSON.Types.AERO_CIRCLE), + @JsonSubTypes.Type(value = Point.class, name = AerospikeAPIConstants.GeoJSON.Types.POINT), + @JsonSubTypes.Type(value = Polygon.class, name = AerospikeAPIConstants.GeoJSON.Types.POLYGON), +}) @Schema( name = "GeoJSON", description = "A geoJSON AeroCirlce, Point, or Polygon object.", externalDocs = @ExternalDocumentation(url = "https://docs.aerospike.com/server/guide/data-types/geospatial"), - oneOf = { - AeroCircle.class, Point.class, Polygon.class, - } + oneOf = {AeroCircle.class, Point.class, Polygon.class,} ) -abstract public class GeoJSON { +public abstract class GeoJSON { private final ObjectMapper mapper = new ObjectMapper(); diff --git a/src/main/java/com/aerospike/restclient/domain/geojsonmodels/LngLat.java b/src/main/java/com/aerospike/restclient/domain/geojsonmodels/LngLat.java index 0e9f8adb..5372a18a 100644 --- a/src/main/java/com/aerospike/restclient/domain/geojsonmodels/LngLat.java +++ b/src/main/java/com/aerospike/restclient/domain/geojsonmodels/LngLat.java @@ -25,7 +25,7 @@ @JsonFormat(shape = JsonFormat.Shape.ARRAY) @JsonPropertyOrder({"longitude", "latitude"}) @Schema( - required = true, + requiredMode = Schema.RequiredMode.REQUIRED, description = "A 2 element array describing a position of the form [longitude, latitude]", example = "[37.421331, -122.098820]" ) @@ -53,4 +53,4 @@ public boolean equals(Object o) { public int hashCode() { return Objects.hash(longitude, latitude); } -} \ No newline at end of file +} diff --git a/src/main/java/com/aerospike/restclient/domain/geojsonmodels/LngLatRad.java b/src/main/java/com/aerospike/restclient/domain/geojsonmodels/LngLatRad.java index ad0d1a6b..2b3605d0 100644 --- a/src/main/java/com/aerospike/restclient/domain/geojsonmodels/LngLatRad.java +++ b/src/main/java/com/aerospike/restclient/domain/geojsonmodels/LngLatRad.java @@ -25,7 +25,7 @@ @JsonFormat(shape = JsonFormat.Shape.ARRAY) @JsonPropertyOrder({"latLng", "radius"}) @Schema( - required = true, + requiredMode = Schema.RequiredMode.REQUIRED, description = "A 2 element array describing a circle of the form [[longitude, latitude], radius].", example = "[[37.421331, -122.098820], 3.14159]" ) diff --git a/src/main/java/com/aerospike/restclient/domain/geojsonmodels/Point.java b/src/main/java/com/aerospike/restclient/domain/geojsonmodels/Point.java index 46830d38..5c35a93b 100644 --- a/src/main/java/com/aerospike/restclient/domain/geojsonmodels/Point.java +++ b/src/main/java/com/aerospike/restclient/domain/geojsonmodels/Point.java @@ -30,7 +30,7 @@ public class Point extends GeoJSON { @Schema( description = "The type of geoJSON geometry this object represents. It is always " + AerospikeAPIConstants.GeoJSON.Types.POINT, allowableValues = {AerospikeAPIConstants.GeoJSON.Types.POINT}, - required = true + requiredMode = Schema.RequiredMode.REQUIRED ) public final String type = AerospikeAPIConstants.GeoJSON.Types.POINT; diff --git a/src/main/java/com/aerospike/restclient/domain/geojsonmodels/Polygon.java b/src/main/java/com/aerospike/restclient/domain/geojsonmodels/Polygon.java index fec0bd7d..08b7991a 100644 --- a/src/main/java/com/aerospike/restclient/domain/geojsonmodels/Polygon.java +++ b/src/main/java/com/aerospike/restclient/domain/geojsonmodels/Polygon.java @@ -32,11 +32,11 @@ public class Polygon extends GeoJSON { @Schema( description = "The type of geoJSON geometry this object represents. It is always " + AerospikeAPIConstants.GeoJSON.Types.POLYGON, allowableValues = {AerospikeAPIConstants.GeoJSON.Types.POLYGON}, - required = true + requiredMode = Schema.RequiredMode.REQUIRED ) public final String type = AerospikeAPIConstants.GeoJSON.Types.POLYGON; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) public List coordinates; public Polygon() { @@ -63,4 +63,3 @@ public int hashCode() { return Objects.hash(coordinates); } } - diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/AddOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/AddOperation.java index 98912bd4..f6cd03d1 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/AddOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/AddOperation.java @@ -32,20 +32,23 @@ public class AddOperation extends Operation { @Schema( description = "The type of operation. It is always " + OperationTypes.ADD, - required = true, - allowableValues = OperationTypes.ADD + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.ADD} ) - final public static String type = OperationTypes.ADD; + public final String type = OperationTypes.ADD; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final String binName; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final Number incr; @JsonCreator - public AddOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "incr", required = true) Number incr) { + public AddOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "incr") + @Schema(name = "incr", requiredMode = Schema.RequiredMode.REQUIRED) Number incr) { this.binName = binName; this.incr = incr; } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/AppendOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/AppendOperation.java index ac5bb9da..0c24bf15 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/AppendOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/AppendOperation.java @@ -31,20 +31,24 @@ public class AppendOperation extends Operation { @Schema( description = "The type of operation. It is always " + OperationTypes.APPEND, - required = true, - allowableValues = OperationTypes.APPEND + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.APPEND} ) - final public static String type = OperationTypes.APPEND; + public final String type = OperationTypes.APPEND; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final String binName; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final String value; @JsonCreator - public AppendOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "value", required = true) String value) { + public AppendOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "value") + @Schema(name = "value") String value + ) { this.binName = binName; this.value = value; } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/BitAddOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/BitAddOperation.java index 292a934e..e95ccca4 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/BitAddOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/BitAddOperation.java @@ -31,18 +31,18 @@ public class BitAddOperation extends BitOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.BIT_ADD, - required = true, - allowableValues = OperationTypes.BIT_ADD + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.BIT_ADD} ) - final public static String type = OperationTypes.BIT_ADD; + public final String type = OperationTypes.BIT_ADD; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int bitOffset; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int bitSize; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final long value; private boolean signed; @@ -50,10 +50,16 @@ public class BitAddOperation extends BitOperation { private BitOverflowAction action = BitOverflowAction.FAIL; @JsonCreator - public BitAddOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "bitOffset", required = true) int bitOffset, - @JsonProperty(value = "bitSize", required = true) int bitSize, - @JsonProperty(value = "value", required = true) long value) { + public BitAddOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "bitOffset") + @Schema(name = "bitOffset", requiredMode = Schema.RequiredMode.REQUIRED) int bitOffset, + @JsonProperty(value = "bitSize") + @Schema(name = "bitSize", requiredMode = Schema.RequiredMode.REQUIRED) int bitSize, + @JsonProperty(value = "value") + @Schema(name = "value", requiredMode = Schema.RequiredMode.REQUIRED) long value + ) { super(binName); this.bitOffset = bitOffset; this.bitSize = bitSize; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/BitAndOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/BitAndOperation.java index 2d726890..54e38952 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/BitAndOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/BitAndOperation.java @@ -30,25 +30,31 @@ public class BitAndOperation extends BitOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.BIT_AND, - required = true, - allowableValues = OperationTypes.BIT_AND + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.BIT_AND} ) - final public static String type = OperationTypes.BIT_AND; + public final String type = OperationTypes.BIT_AND; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int bitOffset; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int bitSize; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final byte[] value; @JsonCreator - public BitAndOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "bitOffset", required = true) int bitOffset, - @JsonProperty(value = "bitSize", required = true) int bitSize, - @JsonProperty(value = "value", required = true) byte[] value) { + public BitAndOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "bitOffset") + @Schema(name = "bitOffset", requiredMode = Schema.RequiredMode.REQUIRED) int bitOffset, + @JsonProperty(value = "bitSize") + @Schema(name = "bitSize", requiredMode = Schema.RequiredMode.REQUIRED) int bitSize, + @JsonProperty(value = "value") + @Schema(name = "value", requiredMode = Schema.RequiredMode.REQUIRED) byte[] value + ) { super(binName); this.bitOffset = bitOffset; this.bitSize = bitSize; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/BitCountOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/BitCountOperation.java index d3c0641f..1d45df81 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/BitCountOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/BitCountOperation.java @@ -29,21 +29,26 @@ public class BitCountOperation extends BitOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.BIT_COUNT, - required = true, - allowableValues = OperationTypes.BIT_COUNT + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.BIT_COUNT} ) - final public static String type = OperationTypes.BIT_COUNT; + public final String type = OperationTypes.BIT_COUNT; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int bitOffset; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int bitSize; @JsonCreator - public BitCountOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "bitOffset", required = true) int bitOffset, - @JsonProperty(value = "bitSize", required = true) int bitSize) { + public BitCountOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "bitOffset") + @Schema(name = "bitOffset", requiredMode = Schema.RequiredMode.REQUIRED) int bitOffset, + @JsonProperty(value = "bitSize") + @Schema(name = "bitSize", requiredMode = Schema.RequiredMode.REQUIRED) int bitSize + ) { super(binName); this.bitOffset = bitOffset; this.bitSize = bitSize; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/BitGetIntOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/BitGetIntOperation.java index 27616cd0..9cdf8612 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/BitGetIntOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/BitGetIntOperation.java @@ -29,25 +29,29 @@ public class BitGetIntOperation extends BitOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.BIT_GET_INT, - required = true, - allowableValues = OperationTypes.BIT_GET_INT + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.BIT_GET_INT} ) - final public static String type = OperationTypes.BIT_GET_INT; + public final String type = OperationTypes.BIT_GET_INT; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int bitOffset; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int bitSize; private final boolean signed; @JsonCreator - public BitGetIntOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "bitOffset", required = true) int bitOffset, - @JsonProperty(value = "bitSize", required = true) int bitSize, @JsonProperty( - value = "signed", defaultValue = "false" - ) boolean signed) { + public BitGetIntOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "bitOffset") + @Schema(name = "bitOffset", requiredMode = Schema.RequiredMode.REQUIRED) int bitOffset, + @JsonProperty(value = "bitSize") + @Schema(name = "bitSize", requiredMode = Schema.RequiredMode.REQUIRED) int bitSize, + @JsonProperty(value = "signed", defaultValue = "false") boolean signed + ) { super(binName); this.bitOffset = bitOffset; this.bitSize = bitSize; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/BitGetOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/BitGetOperation.java index d23927f4..aca6de19 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/BitGetOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/BitGetOperation.java @@ -29,21 +29,26 @@ public class BitGetOperation extends BitOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.BIT_GET, - required = true, - allowableValues = OperationTypes.BIT_GET + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.BIT_GET} ) - final public static String type = OperationTypes.BIT_GET; + public final String type = OperationTypes.BIT_GET; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int bitOffset; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int bitSize; @JsonCreator - public BitGetOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "bitOffset", required = true) int bitOffset, - @JsonProperty(value = "bitSize", required = true) int bitSize) { + public BitGetOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "bitOffset") + @Schema(name = "bitOffset", requiredMode = Schema.RequiredMode.REQUIRED) int bitOffset, + @JsonProperty(value = "bitSize") + @Schema(name = "bitSize", requiredMode = Schema.RequiredMode.REQUIRED) int bitSize + ) { super(binName); this.bitOffset = bitOffset; this.bitSize = bitSize; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/BitInsertOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/BitInsertOperation.java index c978b792..88ecd379 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/BitInsertOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/BitInsertOperation.java @@ -30,20 +30,23 @@ public class BitInsertOperation extends BitOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.BIT_INSERT, - required = true, - allowableValues = OperationTypes.BIT_INSERT + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.BIT_INSERT} ) - final public static String type = OperationTypes.BIT_INSERT; + public final String type = OperationTypes.BIT_INSERT; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int byteOffset; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final byte[] value; @JsonCreator - public BitInsertOperation(@JsonProperty("binName") String binName, @JsonProperty("byteOffset") int byteOffset, - @JsonProperty("value") byte[] value) { + public BitInsertOperation( + @JsonProperty("binName") String binName, + @JsonProperty("byteOffset") int byteOffset, + @JsonProperty("value") byte[] value + ) { super(binName); this.byteOffset = byteOffset; this.value = value; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/BitLScanOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/BitLScanOperation.java index 72e5277e..66df2d86 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/BitLScanOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/BitLScanOperation.java @@ -29,25 +29,31 @@ public class BitLScanOperation extends BitOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.BIT_LSCAN, - required = true, - allowableValues = OperationTypes.BIT_LSCAN + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.BIT_LSCAN} ) - final public static String type = OperationTypes.BIT_LSCAN; + public final String type = OperationTypes.BIT_LSCAN; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int bitOffset; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int bitSize; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final boolean value; @JsonCreator - public BitLScanOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "bitOffset", required = true) int bitOffset, - @JsonProperty(value = "bitSize", required = true) int bitSize, - @JsonProperty(value = "value", required = true) boolean value) { + public BitLScanOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "bitOffset") + @Schema(name = "bitOffset", requiredMode = Schema.RequiredMode.REQUIRED) int bitOffset, + @JsonProperty(value = "bitSize") + @Schema(name = "bitSize", requiredMode = Schema.RequiredMode.REQUIRED) int bitSize, + @JsonProperty(value = "value") + @Schema(name = "value", requiredMode = Schema.RequiredMode.REQUIRED) boolean value + ) { super(binName); this.bitOffset = bitOffset; this.bitSize = bitSize; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/BitLShiftOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/BitLShiftOperation.java index 616c8ec4..e43d4f74 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/BitLShiftOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/BitLShiftOperation.java @@ -30,25 +30,31 @@ public class BitLShiftOperation extends BitOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.BIT_LSHIFT, - required = true, - allowableValues = OperationTypes.BIT_LSHIFT + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.BIT_LSHIFT} ) - final public static String type = OperationTypes.BIT_LSHIFT; + public final String type = OperationTypes.BIT_LSHIFT; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int bitOffset; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int bitSize; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int shift; @JsonCreator - public BitLShiftOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "bitOffset", required = true) int bitOffset, - @JsonProperty(value = "bitSize", required = true) int bitSize, - @JsonProperty(value = "shift", required = true) int shift) { + public BitLShiftOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "bitOffset") + @Schema(name = "bitOffset", requiredMode = Schema.RequiredMode.REQUIRED) int bitOffset, + @JsonProperty(value = "bitSize") + @Schema(name = "bitSize", requiredMode = Schema.RequiredMode.REQUIRED) int bitSize, + @JsonProperty(value = "shift") + @Schema(name = "shift", requiredMode = Schema.RequiredMode.REQUIRED) int shift + ) { super(binName); this.bitOffset = bitOffset; this.bitSize = bitSize; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/BitNotOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/BitNotOperation.java index a463d125..62b42475 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/BitNotOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/BitNotOperation.java @@ -30,21 +30,26 @@ public class BitNotOperation extends BitOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.BIT_NOT, - required = true, - allowableValues = OperationTypes.BIT_NOT + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.BIT_NOT} ) - final public static String type = OperationTypes.BIT_NOT; + public final String type = OperationTypes.BIT_NOT; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int bitOffset; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int bitSize; @JsonCreator - public BitNotOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "bitOffset", required = true) int bitOffset, - @JsonProperty(value = "bitSize", required = true) int bitSize) { + public BitNotOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "bitOffset") + @Schema(name = "bitOffset", requiredMode = Schema.RequiredMode.REQUIRED) int bitOffset, + @JsonProperty(value = "bitSize") + @Schema(name = "bitSize", requiredMode = Schema.RequiredMode.REQUIRED) int bitSize + ) { super(binName); this.bitOffset = bitOffset; this.bitSize = bitSize; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/BitOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/BitOperation.java index 67509663..7ac29078 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/BitOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/BitOperation.java @@ -23,59 +23,60 @@ import io.swagger.v3.oas.annotations.media.Schema; @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") -@JsonSubTypes( - { - @JsonSubTypes.Type(value = BitResizeOperation.class, name = OperationTypes.BIT_RESIZE), - @JsonSubTypes.Type(value = BitInsertOperation.class, name = OperationTypes.BIT_INSERT), - @JsonSubTypes.Type(value = BitRemoveOperation.class, name = OperationTypes.BIT_REMOVE), - @JsonSubTypes.Type(value = BitSetOperation.class, name = OperationTypes.BIT_SET), - @JsonSubTypes.Type(value = BitOrOperation.class, name = OperationTypes.BIT_OR), - @JsonSubTypes.Type(value = BitXOrOperation.class, name = OperationTypes.BIT_XOR), - @JsonSubTypes.Type(value = BitAndOperation.class, name = OperationTypes.BIT_AND), - @JsonSubTypes.Type(value = BitNotOperation.class, name = OperationTypes.BIT_NOT), - @JsonSubTypes.Type(value = BitLShiftOperation.class, name = OperationTypes.BIT_LSHIFT), - @JsonSubTypes.Type(value = BitRShiftOperation.class, name = OperationTypes.BIT_RSHIFT), - @JsonSubTypes.Type(value = BitAddOperation.class, name = OperationTypes.BIT_ADD), - @JsonSubTypes.Type(value = BitSubtractOperation.class, name = OperationTypes.BIT_SUBTRACT), - @JsonSubTypes.Type(value = BitSetOperation.class, name = OperationTypes.BIT_SET), - @JsonSubTypes.Type(value = BitGetOperation.class, name = OperationTypes.BIT_GET), - @JsonSubTypes.Type(value = BitCountOperation.class, name = OperationTypes.BIT_COUNT), - @JsonSubTypes.Type(value = BitLScanOperation.class, name = OperationTypes.BIT_LSCAN), - @JsonSubTypes.Type(value = BitRScanOperation.class, name = OperationTypes.BIT_RSCAN), - @JsonSubTypes.Type(value = BitSetIntOperation.class, name = OperationTypes.BIT_SET_INT), - @JsonSubTypes.Type(value = BitGetIntOperation.class, name = OperationTypes.BIT_GET_INT) - } -) +@JsonSubTypes({ + @JsonSubTypes.Type(value = BitResizeOperation.class, name = OperationTypes.BIT_RESIZE), + @JsonSubTypes.Type(value = BitInsertOperation.class, name = OperationTypes.BIT_INSERT), + @JsonSubTypes.Type(value = BitRemoveOperation.class, name = OperationTypes.BIT_REMOVE), + @JsonSubTypes.Type(value = BitSetOperation.class, name = OperationTypes.BIT_SET), + @JsonSubTypes.Type(value = BitOrOperation.class, name = OperationTypes.BIT_OR), + @JsonSubTypes.Type(value = BitXOrOperation.class, name = OperationTypes.BIT_XOR), + @JsonSubTypes.Type(value = BitAndOperation.class, name = OperationTypes.BIT_AND), + @JsonSubTypes.Type(value = BitNotOperation.class, name = OperationTypes.BIT_NOT), + @JsonSubTypes.Type(value = BitLShiftOperation.class, name = OperationTypes.BIT_LSHIFT), + @JsonSubTypes.Type(value = BitRShiftOperation.class, name = OperationTypes.BIT_RSHIFT), + @JsonSubTypes.Type(value = BitAddOperation.class, name = OperationTypes.BIT_ADD), + @JsonSubTypes.Type(value = BitSubtractOperation.class, name = OperationTypes.BIT_SUBTRACT), + @JsonSubTypes.Type(value = BitSetOperation.class, name = OperationTypes.BIT_SET), + @JsonSubTypes.Type(value = BitGetOperation.class, name = OperationTypes.BIT_GET), + @JsonSubTypes.Type(value = BitCountOperation.class, name = OperationTypes.BIT_COUNT), + @JsonSubTypes.Type(value = BitLScanOperation.class, name = OperationTypes.BIT_LSCAN), + @JsonSubTypes.Type(value = BitRScanOperation.class, name = OperationTypes.BIT_RSCAN), + @JsonSubTypes.Type(value = BitSetIntOperation.class, name = OperationTypes.BIT_SET_INT), + @JsonSubTypes.Type(value = BitGetIntOperation.class, name = OperationTypes.BIT_GET_INT) +}) @Schema( - description = "The base type for describing all bit operations. Should not be used directly.", oneOf = { - BitResizeOperation.class, - BitInsertOperation.class, - BitRemoveOperation.class, - BitSetOperation.class, - BitOrOperation.class, - BitXOrOperation.class, - BitAndOperation.class, - BitNotOperation.class, - BitLShiftOperation.class, - BitRShiftOperation.class, - BitAddOperation.class, - BitSubtractOperation.class, - BitSetOperation.class, - BitGetOperation.class, - BitCountOperation.class, - BitLScanOperation.class, - BitRScanOperation.class, - BitSetIntOperation.class, - BitGetIntOperation.class, -} + description = "The base type for describing all bit operations. Should not be used directly.", + oneOf = { + BitResizeOperation.class, + BitInsertOperation.class, + BitRemoveOperation.class, + BitSetOperation.class, + BitOrOperation.class, + BitXOrOperation.class, + BitAndOperation.class, + BitNotOperation.class, + BitLShiftOperation.class, + BitRShiftOperation.class, + BitAddOperation.class, + BitSubtractOperation.class, + BitSetOperation.class, + BitGetOperation.class, + BitCountOperation.class, + BitLScanOperation.class, + BitRScanOperation.class, + BitSetIntOperation.class, + BitGetIntOperation.class, + } ) -abstract public class BitOperation extends Operation { - @Schema(required = true) +public abstract class BitOperation extends Operation { + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) protected String binName; @JsonCreator - protected BitOperation(@JsonProperty(value = "binName", required = true) String binName) { + protected BitOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName + ) { this.binName = binName; } } - diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/BitOrOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/BitOrOperation.java index 0a062862..6b4899f5 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/BitOrOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/BitOrOperation.java @@ -30,25 +30,31 @@ public class BitOrOperation extends BitOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.BIT_OR, - required = true, - allowableValues = OperationTypes.BIT_OR + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.BIT_OR} ) - final public static String type = OperationTypes.BIT_OR; + public final String type = OperationTypes.BIT_OR; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int bitOffset; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int bitSize; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final byte[] value; @JsonCreator - public BitOrOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "bitOffset", required = true) int bitOffset, - @JsonProperty(value = "bitSize", required = true) int bitSize, - @JsonProperty(value = "value", required = true) byte[] value) { + public BitOrOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "bitOffset") + @Schema(name = "bitOffset", requiredMode = Schema.RequiredMode.REQUIRED) int bitOffset, + @JsonProperty(value = "bitSize") + @Schema(name = "bitSize", requiredMode = Schema.RequiredMode.REQUIRED) int bitSize, + @JsonProperty(value = "value") + @Schema(name = "value", requiredMode = Schema.RequiredMode.REQUIRED) byte[] value + ) { super(binName); this.bitOffset = bitOffset; this.bitSize = bitSize; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/BitRScanOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/BitRScanOperation.java index bdf25f76..910af556 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/BitRScanOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/BitRScanOperation.java @@ -29,25 +29,30 @@ public class BitRScanOperation extends BitOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.BIT_RSCAN, - required = true, - allowableValues = OperationTypes.BIT_RSCAN + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.BIT_RSCAN} ) - final public static String type = OperationTypes.BIT_RSCAN; + public final String type = OperationTypes.BIT_RSCAN; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int bitOffset; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int bitSize; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final boolean value; @JsonCreator - public BitRScanOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "bitOffset", required = true) int bitOffset, - @JsonProperty(value = "bitSize", required = true) int bitSize, - @JsonProperty(value = "value", defaultValue = "false") boolean value) { + public BitRScanOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "bitOffset") + @Schema(name = "bitOffset", requiredMode = Schema.RequiredMode.REQUIRED) int bitOffset, + @JsonProperty(value = "bitSize") + @Schema(name = "bitSize", requiredMode = Schema.RequiredMode.REQUIRED) int bitSize, + @JsonProperty(value = "value", defaultValue = "false") boolean value + ) { super(binName); this.bitOffset = bitOffset; this.bitSize = bitSize; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/BitRShiftOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/BitRShiftOperation.java index 020fb88e..c5175e46 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/BitRShiftOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/BitRShiftOperation.java @@ -30,25 +30,31 @@ public class BitRShiftOperation extends BitOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.BIT_LSHIFT, - required = true, - allowableValues = OperationTypes.BIT_LSHIFT + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.BIT_LSHIFT} ) - final public static String type = OperationTypes.BIT_LSHIFT; + public final String type = OperationTypes.BIT_LSHIFT; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int bitOffset; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int bitSize; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int shift; @JsonCreator - public BitRShiftOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "bitOffset", required = true) int bitOffset, - @JsonProperty(value = "bitSize", required = true) int bitSize, - @JsonProperty(value = "shift", required = true) int shift) { + public BitRShiftOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "bitOffset") + @Schema(name = "bitOffset", requiredMode = Schema.RequiredMode.REQUIRED) int bitOffset, + @JsonProperty(value = "bitSize") + @Schema(name = "bitSize", requiredMode = Schema.RequiredMode.REQUIRED) int bitSize, + @JsonProperty(value = "shift") + @Schema(name = "shift", requiredMode = Schema.RequiredMode.REQUIRED) int shift + ) { super(binName); this.bitOffset = bitOffset; this.bitSize = bitSize; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/BitRemoveOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/BitRemoveOperation.java index 399848e6..d44d6018 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/BitRemoveOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/BitRemoveOperation.java @@ -30,21 +30,26 @@ public class BitRemoveOperation extends BitOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.BIT_REMOVE, - required = true, - allowableValues = OperationTypes.BIT_REMOVE + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.BIT_REMOVE} ) - final public static String type = OperationTypes.BIT_REMOVE; + public final String type = OperationTypes.BIT_REMOVE; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int byteOffset; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int byteSize; @JsonCreator - public BitRemoveOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "byteOffset", required = true) int byteOffset, - @JsonProperty(value = "byteSize", required = true) int byteSize) { + public BitRemoveOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "byteOffset") + @Schema(name = "byteOffset", requiredMode = Schema.RequiredMode.REQUIRED) int byteOffset, + @JsonProperty(value = "byteSize") + @Schema(name = "byteSize", requiredMode = Schema.RequiredMode.REQUIRED) int byteSize + ) { super(binName); this.byteOffset = byteOffset; this.byteSize = byteSize; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/BitResizeOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/BitResizeOperation.java index 1ba71e06..ce69774b 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/BitResizeOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/BitResizeOperation.java @@ -30,21 +30,25 @@ public class BitResizeOperation extends BitOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.BIT_RESIZE, - required = true, - allowableValues = OperationTypes.BIT_RESIZE + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.BIT_RESIZE} ) - final public static String type = OperationTypes.BIT_RESIZE; + public final String type = OperationTypes.BIT_RESIZE; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int byteSize; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int resizeFlags; @JsonCreator - public BitResizeOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "byteSize", required = true) int byteSize, - @JsonProperty(value = "resizeFlags", required = true) int resizeFlags) { + public BitResizeOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "byteSize") + @Schema(name = "byteSize", requiredMode = Schema.RequiredMode.REQUIRED) int byteSize, + @Schema(name = "resizeFlags", requiredMode = Schema.RequiredMode.REQUIRED) int resizeFlags + ) { super(binName); this.byteSize = byteSize; this.resizeFlags = resizeFlags; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/BitSetIntOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/BitSetIntOperation.java index f0193806..7d124fd3 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/BitSetIntOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/BitSetIntOperation.java @@ -30,25 +30,31 @@ public class BitSetIntOperation extends BitOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.BIT_SET_INT, - required = true, - allowableValues = OperationTypes.BIT_SET_INT + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.BIT_SET_INT} ) - final public static String type = OperationTypes.BIT_SET_INT; + public final String type = OperationTypes.BIT_SET_INT; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int bitOffset; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int bitSize; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final long value; @JsonCreator - public BitSetIntOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "bitOffset", required = true) int bitOffset, - @JsonProperty(value = "bitSize", required = true) int bitSize, - @JsonProperty(value = "value", required = true) long value) { + public BitSetIntOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "bitOffset") + @Schema(name = "bitOffset", requiredMode = Schema.RequiredMode.REQUIRED) int bitOffset, + @JsonProperty(value = "bitSize") + @Schema(name = "bitSize", requiredMode = Schema.RequiredMode.REQUIRED) int bitSize, + @JsonProperty(value = "value") + @Schema(name = "value", requiredMode = Schema.RequiredMode.REQUIRED) long value + ) { super(binName); this.bitOffset = bitOffset; this.bitSize = bitSize; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/BitSetOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/BitSetOperation.java index 895a9f17..5bda2435 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/BitSetOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/BitSetOperation.java @@ -30,25 +30,31 @@ public class BitSetOperation extends BitOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.BIT_SET, - required = true, - allowableValues = OperationTypes.BIT_SET + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.BIT_SET} ) - final public static String type = OperationTypes.BIT_SET; + public final String type = OperationTypes.BIT_SET; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int bitOffset; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int bitSize; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final byte[] value; @JsonCreator - public BitSetOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "bitOffset", required = true) int bitOffset, - @JsonProperty(value = "bitSize", required = true) int bitSize, - @JsonProperty(value = "value", required = true) byte[] value) { + public BitSetOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "bitOffset") + @Schema(name = "bitOffset", requiredMode = Schema.RequiredMode.REQUIRED) int bitOffset, + @JsonProperty(value = "bitSize") + @Schema(name = "bitSize", requiredMode = Schema.RequiredMode.REQUIRED) int bitSize, + @JsonProperty(value = "value") + @Schema(name = "value", requiredMode = Schema.RequiredMode.REQUIRED) byte[] value + ) { super(binName); this.bitOffset = bitOffset; this.bitSize = bitSize; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/BitSubtractOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/BitSubtractOperation.java index 0e501278..1b65cf99 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/BitSubtractOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/BitSubtractOperation.java @@ -31,18 +31,18 @@ public class BitSubtractOperation extends BitOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.BIT_SUBTRACT, - required = true, - allowableValues = OperationTypes.BIT_SUBTRACT + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.BIT_SUBTRACT} ) - final public static String type = OperationTypes.BIT_SUBTRACT; + public final String type = OperationTypes.BIT_SUBTRACT; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int bitOffset; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int bitSize; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final long value; private boolean signed; @@ -51,10 +51,16 @@ public class BitSubtractOperation extends BitOperation { private BitOverflowAction action = BitOverflowAction.FAIL; @JsonCreator - public BitSubtractOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "bitOffset", required = true) int bitOffset, - @JsonProperty(value = "bitSize", required = true) int bitSize, - @JsonProperty(value = "value", required = true) long value) { + public BitSubtractOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "bitOffset") + @Schema(name = "bitOffset", requiredMode = Schema.RequiredMode.REQUIRED) int bitOffset, + @JsonProperty(value = "bitSize") + @Schema(name = "bitSize", requiredMode = Schema.RequiredMode.REQUIRED) int bitSize, + @JsonProperty(value = "value") + @Schema(name = "value", requiredMode = Schema.RequiredMode.REQUIRED) long value + ) { super(binName); this.bitOffset = bitOffset; this.bitSize = bitSize; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/BitXOrOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/BitXOrOperation.java index 71710e86..a5af888d 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/BitXOrOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/BitXOrOperation.java @@ -30,25 +30,31 @@ public class BitXOrOperation extends BitOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.BIT_XOR, - required = true, - allowableValues = OperationTypes.BIT_XOR + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.BIT_XOR} ) - final public static String type = OperationTypes.BIT_XOR; + public final String type = OperationTypes.BIT_XOR; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int bitOffset; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int bitSize; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final byte[] value; @JsonCreator - public BitXOrOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "bitOffset", required = true) int bitOffset, - @JsonProperty(value = "bitSize", required = true) int bitSize, - @JsonProperty(value = "value", required = true) byte[] value) { + public BitXOrOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "bitOffset") + @Schema(name = "bitOffset", requiredMode = Schema.RequiredMode.REQUIRED) int bitOffset, + @JsonProperty(value = "bitSize") + @Schema(name = "bitSize", requiredMode = Schema.RequiredMode.REQUIRED) int bitSize, + @JsonProperty(value = "value") + @Schema(name = "value", requiredMode = Schema.RequiredMode.REQUIRED) byte[] value + ) { super(binName); this.bitOffset = bitOffset; this.bitSize = bitSize; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/DeleteOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/DeleteOperation.java index b5410491..3eba90c2 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/DeleteOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/DeleteOperation.java @@ -28,10 +28,10 @@ public class DeleteOperation extends Operation { @Schema( description = "The type of operation. It is always " + OperationTypes.DELETE, - required = true, - allowableValues = OperationTypes.DELETE + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.DELETE} ) - final public static String type = OperationTypes.DELETE; + public final String type = OperationTypes.DELETE; @Override public com.aerospike.client.Operation toOperation() { diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/GetHeaderOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/GetHeaderOperation.java index 1fd97d3c..c2023ba8 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/GetHeaderOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/GetHeaderOperation.java @@ -28,10 +28,10 @@ public class GetHeaderOperation extends Operation { @Schema( description = "The type of operation. It is always " + OperationTypes.GET_HEADER, - required = true, - allowableValues = OperationTypes.GET_HEADER + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.GET_HEADER} ) - final public static String type = OperationTypes.GET_HEADER; + public final String type = OperationTypes.GET_HEADER; @Override public com.aerospike.client.Operation toOperation() { diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/GetOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/GetOperation.java index 14bcbc3e..92e64c5b 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/GetOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/GetOperation.java @@ -30,10 +30,10 @@ public class GetOperation extends Operation { @Schema( description = "The type of operation. It is always " + OperationTypes.GET, - required = true, - allowableValues = OperationTypes.GET + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.GET} ) - final public static String type = OperationTypes.GET; + public final String type = OperationTypes.GET; private final String binName; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLAddOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLAddOperation.java index 578a6fdd..cd2e5b4b 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLAddOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLAddOperation.java @@ -33,12 +33,12 @@ public class HLLAddOperation extends HLLOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.HLL_ADD, - required = true, - allowableValues = OperationTypes.HLL_ADD + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.HLL_ADD} ) - final public static String type = OperationTypes.HLL_ADD; + public final String type = OperationTypes.HLL_ADD; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final List values; private Integer indexBitCount; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLDescribeOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLDescribeOperation.java index 64ee4127..6f231555 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLDescribeOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLDescribeOperation.java @@ -30,13 +30,16 @@ public class HLLDescribeOperation extends HLLOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.HLL_DESCRIBE, - required = true, - allowableValues = OperationTypes.HLL_DESCRIBE + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.HLL_DESCRIBE} ) - final public static String type = OperationTypes.HLL_DESCRIBE; + public final String type = OperationTypes.HLL_DESCRIBE; @JsonCreator - public HLLDescribeOperation(@JsonProperty(value = "binName", required = true) String binName) { + public HLLDescribeOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName + ) { super(binName); } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLFoldOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLFoldOperation.java index f2ae2c72..8c22f3c5 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLFoldOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLFoldOperation.java @@ -29,17 +29,20 @@ public class HLLFoldOperation extends HLLOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.HLL_FOLD, - required = true, - allowableValues = OperationTypes.HLL_FOLD + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.HLL_FOLD} ) - final public static String type = OperationTypes.HLL_FOLD; + public final String type = OperationTypes.HLL_FOLD; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int indexBitCount; @JsonCreator - public HLLFoldOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "indexBitCount", required = true) int indexBitCount) { + public HLLFoldOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @Schema(name = "indexBitCount", requiredMode = Schema.RequiredMode.REQUIRED) int indexBitCount + ) { super(binName); this.indexBitCount = indexBitCount; } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLGetCountOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLGetCountOperation.java index 0c37549f..2bb64376 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLGetCountOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLGetCountOperation.java @@ -29,13 +29,16 @@ public class HLLGetCountOperation extends HLLOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.HLL_COUNT, - required = true, - allowableValues = OperationTypes.HLL_COUNT + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.HLL_COUNT} ) - final public static String type = OperationTypes.HLL_COUNT; + public final String type = OperationTypes.HLL_COUNT; @JsonCreator - public HLLGetCountOperation(@JsonProperty(value = "binName", required = true) String binName) { + public HLLGetCountOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName + ) { super(binName); } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLGetIntersectionCountOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLGetIntersectionCountOperation.java index 9bbe597f..660e649c 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLGetIntersectionCountOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLGetIntersectionCountOperation.java @@ -32,17 +32,19 @@ public class HLLGetIntersectionCountOperation extends HLLOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.HLL_INTERSECT_COUNT, - required = true, - allowableValues = OperationTypes.HLL_INTERSECT_COUNT + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.HLL_INTERSECT_COUNT} ) - final public static String type = OperationTypes.HLL_INTERSECT_COUNT; + public final String type = OperationTypes.HLL_INTERSECT_COUNT; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final List values; @JsonCreator - public HLLGetIntersectionCountOperation(@JsonProperty("binName") String binName, - @JsonProperty("values") List values) { + public HLLGetIntersectionCountOperation( + @JsonProperty("binName") String binName, + @JsonProperty("values") List values + ) { super(binName); this.values = values; } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLGetSimilarityOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLGetSimilarityOperation.java index 83cdb8da..56f13550 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLGetSimilarityOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLGetSimilarityOperation.java @@ -32,17 +32,19 @@ public class HLLGetSimilarityOperation extends HLLOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.HLL_SIMILARITY, - required = true, - allowableValues = OperationTypes.HLL_SIMILARITY + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.HLL_SIMILARITY} ) - final public static String type = OperationTypes.HLL_SIMILARITY; + public final String type = OperationTypes.HLL_SIMILARITY; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final List values; @JsonCreator - public HLLGetSimilarityOperation(@JsonProperty("binName") String binName, - @JsonProperty("values") List values) { + public HLLGetSimilarityOperation( + @JsonProperty("binName") String binName, + @JsonProperty("values") List values + ) { super(binName); this.values = values; } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLGetUnionCountOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLGetUnionCountOperation.java index 33375e9c..9d83eb93 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLGetUnionCountOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLGetUnionCountOperation.java @@ -32,17 +32,19 @@ public class HLLGetUnionCountOperation extends HLLOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.HLL_UNION_COUNT, - required = true, - allowableValues = OperationTypes.HLL_UNION_COUNT + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.HLL_UNION_COUNT} ) - final public static String type = OperationTypes.HLL_UNION_COUNT; + public final String type = OperationTypes.HLL_UNION_COUNT; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final List values; @JsonCreator - public HLLGetUnionCountOperation(@JsonProperty("binName") String binName, - @JsonProperty("values") List values) { + public HLLGetUnionCountOperation( + @JsonProperty("binName") String binName, + @JsonProperty("values") List values + ) { super(binName); this.values = values; } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLGetUnionOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLGetUnionOperation.java index 3d561883..9c512e6f 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLGetUnionOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLGetUnionOperation.java @@ -32,16 +32,19 @@ public class HLLGetUnionOperation extends HLLOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.HLL_UNION, - required = true, - allowableValues = OperationTypes.HLL_UNION + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.HLL_UNION} ) - final public static String type = OperationTypes.HLL_UNION; + public final String type = OperationTypes.HLL_UNION; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final List values; @JsonCreator - public HLLGetUnionOperation(@JsonProperty("binName") String binName, @JsonProperty("values") List values) { + public HLLGetUnionOperation( + @JsonProperty("binName") String binName, + @JsonProperty("values") List values + ) { super(binName); this.values = values; } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLInitOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLInitOperation.java index 301d244d..2e05dead 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLInitOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLInitOperation.java @@ -30,19 +30,22 @@ public class HLLInitOperation extends HLLOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.HLL_INIT, - required = true, - allowableValues = OperationTypes.HLL_INIT + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.HLL_INIT} ) - final public static String type = OperationTypes.HLL_INIT; + public final String type = OperationTypes.HLL_INIT; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int indexBitCount; private Integer minHashBitCount; @JsonCreator - public HLLInitOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "indexBitCount", required = true) int indexBitCount) { + public HLLInitOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @Schema(name = "indexBitCount", requiredMode = Schema.RequiredMode.REQUIRED) int indexBitCount + ) { super(binName); this.indexBitCount = indexBitCount; } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLOperation.java index 0960f13f..cb411737 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLOperation.java @@ -21,44 +21,40 @@ import io.swagger.v3.oas.annotations.media.Schema; @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") -@JsonSubTypes( - { - @JsonSubTypes.Type(value = HLLInitOperation.class, name = OperationTypes.HLL_INIT), - @JsonSubTypes.Type(value = HLLAddOperation.class, name = OperationTypes.HLL_ADD), - @JsonSubTypes.Type(value = HLLSetUnionOperation.class, name = OperationTypes.HLL_SET_UNION), - @JsonSubTypes.Type(value = HLLRefreshCountOperation.class, name = OperationTypes.HLL_SET_COUNT), - @JsonSubTypes.Type(value = HLLFoldOperation.class, name = OperationTypes.HLL_FOLD), - @JsonSubTypes.Type(value = HLLGetCountOperation.class, name = OperationTypes.HLL_COUNT), - @JsonSubTypes.Type(value = HLLGetUnionOperation.class, name = OperationTypes.HLL_UNION), - @JsonSubTypes.Type(value = HLLGetUnionCountOperation.class, name = OperationTypes.HLL_UNION_COUNT), - @JsonSubTypes.Type( - value = HLLGetIntersectionCountOperation.class, name = OperationTypes.HLL_INTERSECT_COUNT - ), - @JsonSubTypes.Type(value = HLLGetSimilarityOperation.class, name = OperationTypes.HLL_SIMILARITY), - @JsonSubTypes.Type(value = HLLDescribeOperation.class, name = OperationTypes.HLL_DESCRIBE), - } -) +@JsonSubTypes({ + @JsonSubTypes.Type(value = HLLInitOperation.class, name = OperationTypes.HLL_INIT), + @JsonSubTypes.Type(value = HLLAddOperation.class, name = OperationTypes.HLL_ADD), + @JsonSubTypes.Type(value = HLLSetUnionOperation.class, name = OperationTypes.HLL_SET_UNION), + @JsonSubTypes.Type(value = HLLRefreshCountOperation.class, name = OperationTypes.HLL_SET_COUNT), + @JsonSubTypes.Type(value = HLLFoldOperation.class, name = OperationTypes.HLL_FOLD), + @JsonSubTypes.Type(value = HLLGetCountOperation.class, name = OperationTypes.HLL_COUNT), + @JsonSubTypes.Type(value = HLLGetUnionOperation.class, name = OperationTypes.HLL_UNION), + @JsonSubTypes.Type(value = HLLGetUnionCountOperation.class, name = OperationTypes.HLL_UNION_COUNT), + @JsonSubTypes.Type(value = HLLGetIntersectionCountOperation.class, name = OperationTypes.HLL_INTERSECT_COUNT), + @JsonSubTypes.Type(value = HLLGetSimilarityOperation.class, name = OperationTypes.HLL_SIMILARITY), + @JsonSubTypes.Type(value = HLLDescribeOperation.class, name = OperationTypes.HLL_DESCRIBE), +}) @Schema( - description = "The base type for describing all HLL operations. Should not be used directly.", oneOf = { - HLLInitOperation.class, - HLLAddOperation.class, - HLLSetUnionOperation.class, - HLLRefreshCountOperation.class, - HLLFoldOperation.class, - HLLGetCountOperation.class, - HLLGetUnionOperation.class, - HLLGetUnionCountOperation.class, - HLLGetIntersectionCountOperation.class, - HLLGetSimilarityOperation.class, - HLLDescribeOperation.class -} + description = "The base type for describing all HLL operations. Should not be used directly.", + oneOf = { + HLLInitOperation.class, + HLLAddOperation.class, + HLLSetUnionOperation.class, + HLLRefreshCountOperation.class, + HLLFoldOperation.class, + HLLGetCountOperation.class, + HLLGetUnionOperation.class, + HLLGetUnionCountOperation.class, + HLLGetIntersectionCountOperation.class, + HLLGetSimilarityOperation.class, + HLLDescribeOperation.class + } ) -abstract public class HLLOperation extends Operation { - @Schema(required = true) +public abstract class HLLOperation extends Operation { + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) protected String binName; protected HLLOperation(String binName) { this.binName = binName; } } - diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLRefreshCountOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLRefreshCountOperation.java index 322ea7f5..a06043d7 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLRefreshCountOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLRefreshCountOperation.java @@ -29,13 +29,16 @@ public class HLLRefreshCountOperation extends HLLOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.HLL_SET_COUNT, - required = true, - allowableValues = OperationTypes.HLL_SET_UNION + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.HLL_SET_UNION} ) - final public static String type = OperationTypes.HLL_SET_UNION; + public final String type = OperationTypes.HLL_SET_UNION; @JsonCreator - public HLLRefreshCountOperation(@JsonProperty(value = "binName", required = true) String binName) { + public HLLRefreshCountOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName + ) { super(binName); } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLSetUnionOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLSetUnionOperation.java index 447a36aa..cf056989 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLSetUnionOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/HLLSetUnionOperation.java @@ -33,16 +33,19 @@ public class HLLSetUnionOperation extends HLLOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.HLL_SET_UNION, - required = true, - allowableValues = OperationTypes.HLL_SET_UNION + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.HLL_SET_UNION} ) - final public static String type = OperationTypes.HLL_SET_UNION; + public final String type = OperationTypes.HLL_SET_UNION; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final List values; @JsonCreator - public HLLSetUnionOperation(@JsonProperty("binName") String binName, @JsonProperty("values") List values) { + public HLLSetUnionOperation( + @JsonProperty("binName") String binName, + @JsonProperty("values") List values + ) { super(binName); this.values = values; } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListAppendItemsOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListAppendItemsOperation.java index 62fd9ea9..1fc9240c 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListAppendItemsOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListAppendItemsOperation.java @@ -36,20 +36,22 @@ public class ListAppendItemsOperation extends ListOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.LIST_APPEND_ITEMS, - required = true, - allowableValues = OperationTypes.LIST_APPEND_ITEMS + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.LIST_APPEND_ITEMS} ) - final public static String type = OperationTypes.LIST_APPEND_ITEMS; + public final String type = OperationTypes.LIST_APPEND_ITEMS; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final List values; // TODO, this probably needs an intermediate type private ListPolicy listPolicy; @JsonCreator - public ListAppendItemsOperation(@JsonProperty("binName") String binName, - @JsonProperty("values") List values) { + public ListAppendItemsOperation( + @JsonProperty("binName") String binName, + @JsonProperty("values") List values + ) { super(binName); this.values = values; } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListAppendOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListAppendOperation.java index e843fd2e..b0dc8df9 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListAppendOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListAppendOperation.java @@ -31,20 +31,24 @@ public class ListAppendOperation extends ListOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.LIST_APPEND, - required = true, - allowableValues = OperationTypes.LIST_APPEND + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.LIST_APPEND} ) - final public static String type = OperationTypes.LIST_APPEND; + public final String type = OperationTypes.LIST_APPEND; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final Object value; // TODO, this probably needs an intermediate type private ListPolicy listPolicy; @JsonCreator - public ListAppendOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "value", required = true) Object value) { + public ListAppendOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "value") + @Schema(name = "value", requiredMode = Schema.RequiredMode.REQUIRED) Object value + ) { super(binName); this.value = value; } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListClearOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListClearOperation.java index a8912052..854437b8 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListClearOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListClearOperation.java @@ -30,13 +30,16 @@ public class ListClearOperation extends ListOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.LIST_CLEAR, - required = true, - allowableValues = OperationTypes.LIST_CLEAR + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.LIST_CLEAR} ) - final public static String type = OperationTypes.LIST_CLEAR; + public final String type = OperationTypes.LIST_CLEAR; @JsonCreator - public ListClearOperation(@JsonProperty(value = "binName", required = true) String binName) { + public ListClearOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName + ) { super(binName); } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListCreateOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListCreateOperation.java index 115ae5fe..802cd53c 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListCreateOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListCreateOperation.java @@ -31,19 +31,23 @@ public class ListCreateOperation extends ListOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.LIST_CREATE, - required = true, - allowableValues = OperationTypes.LIST_CREATE + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.LIST_CREATE} ) - final public static String type = OperationTypes.LIST_CREATE; + public final String type = OperationTypes.LIST_CREATE; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final ListOrder order; private boolean pad; @JsonCreator - public ListCreateOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "order", required = true) ListOrder order) { + public ListCreateOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "order") + @Schema(name = "order", requiredMode = Schema.RequiredMode.REQUIRED) ListOrder order + ) { super(binName); this.order = order; } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListGetByIndexOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListGetByIndexOperation.java index db11ec48..3e71741f 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListGetByIndexOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListGetByIndexOperation.java @@ -30,24 +30,28 @@ public class ListGetByIndexOperation extends ListOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.LIST_GET_BY_INDEX, - required = true, - allowableValues = OperationTypes.LIST_GET_BY_INDEX + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.LIST_GET_BY_INDEX} ) - final public static String type = OperationTypes.LIST_GET_BY_INDEX; + public final String type = OperationTypes.LIST_GET_BY_INDEX; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int index; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final ListReturnType listReturnType; private boolean inverted; @JsonCreator - public ListGetByIndexOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "index", required = true) int index, @JsonProperty( - value = "listReturnType", required = true - ) ListReturnType listReturnType) { + public ListGetByIndexOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "index") + @Schema(name = "index", requiredMode = Schema.RequiredMode.REQUIRED) int index, + @JsonProperty(value = "listReturnType") + @Schema(name = "listReturnType", requiredMode = Schema.RequiredMode.REQUIRED) ListReturnType listReturnType + ) { super(binName); this.index = index; this.listReturnType = listReturnType; @@ -64,6 +68,7 @@ public void setInverted(boolean inverted) { @Override public com.aerospike.client.Operation toOperation() { com.aerospike.client.cdt.CTX[] asCTX = getASCTX(); - return com.aerospike.client.cdt.ListOperation.getByIndex(binName, index, listReturnType.toListReturnType(inverted), asCTX); + return com.aerospike.client.cdt.ListOperation.getByIndex(binName, index, + listReturnType.toListReturnType(inverted), asCTX); } } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListGetByIndexRangeOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListGetByIndexRangeOperation.java index 31bde5bc..bb630652 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListGetByIndexRangeOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListGetByIndexRangeOperation.java @@ -30,15 +30,15 @@ public class ListGetByIndexRangeOperation extends ListOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.LIST_GET_BY_INDEX_RANGE, - required = true, - allowableValues = OperationTypes.LIST_GET_BY_INDEX_RANGE + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.LIST_GET_BY_INDEX_RANGE} ) - final public static String type = OperationTypes.LIST_GET_BY_INDEX_RANGE; + public final String type = OperationTypes.LIST_GET_BY_INDEX_RANGE; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int index; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final ListReturnType listReturnType; private boolean inverted; @@ -46,10 +46,13 @@ public class ListGetByIndexRangeOperation extends ListOperation { private Integer count; @JsonCreator - public ListGetByIndexRangeOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "index", required = true) int index, @JsonProperty( - value = "listReturnType", required = true - ) ListReturnType listReturnType) { + public ListGetByIndexRangeOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "index") + @Schema(name = "index", requiredMode = Schema.RequiredMode.REQUIRED) int index, + @JsonProperty(value = "listReturnType", required = true) ListReturnType listReturnType + ) { super(binName); this.index = index; this.listReturnType = listReturnType; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListGetByRankOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListGetByRankOperation.java index 696b66b1..a6726436 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListGetByRankOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListGetByRankOperation.java @@ -30,24 +30,27 @@ public class ListGetByRankOperation extends ListOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.LIST_GET_BY_RANK, - required = true, - allowableValues = OperationTypes.LIST_GET_BY_RANK + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.LIST_GET_BY_RANK} ) - final public static String type = OperationTypes.LIST_GET_BY_RANK; + public final String type = OperationTypes.LIST_GET_BY_RANK; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int rank; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final ListReturnType listReturnType; private boolean inverted; @JsonCreator - public ListGetByRankOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "rank", required = true) int rank, @JsonProperty( - value = "listReturnType", required = true - ) ListReturnType listReturnType) { + public ListGetByRankOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "rank") + @Schema(name = "rank", requiredMode = Schema.RequiredMode.REQUIRED) int rank, + @JsonProperty(value = "listReturnType", required = true) ListReturnType listReturnType + ) { super(binName); this.rank = rank; this.listReturnType = listReturnType; @@ -64,6 +67,7 @@ public void setInverted(boolean inverted) { @Override public com.aerospike.client.Operation toOperation() { com.aerospike.client.cdt.CTX[] asCTX = getASCTX(); - return com.aerospike.client.cdt.ListOperation.getByRank(binName, rank, listReturnType.toListReturnType(inverted), asCTX); + return com.aerospike.client.cdt.ListOperation.getByRank(binName, rank, + listReturnType.toListReturnType(inverted), asCTX); } } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListGetByRankRangeOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListGetByRankRangeOperation.java index e8a8ab47..f669d007 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListGetByRankRangeOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListGetByRankRangeOperation.java @@ -30,25 +30,28 @@ public class ListGetByRankRangeOperation extends ListOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.LIST_GET_BY_RANK_RANGE, - required = true, - allowableValues = OperationTypes.LIST_GET_BY_RANK_RANGE + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.LIST_GET_BY_RANK_RANGE} ) - final public static String type = OperationTypes.LIST_GET_BY_RANK_RANGE; + public final String type = OperationTypes.LIST_GET_BY_RANK_RANGE; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int rank; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final ListReturnType listReturnType; private boolean inverted; private Integer count; @JsonCreator - public ListGetByRankRangeOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "rank", required = true) int rank, @JsonProperty( - value = "listReturnType", required = true - ) ListReturnType listReturnType) { + public ListGetByRankRangeOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "rank") + @Schema(name = "rank", requiredMode = Schema.RequiredMode.REQUIRED) int rank, + @JsonProperty(value = "listReturnType", required = true) ListReturnType listReturnType + ) { super(binName); this.rank = rank; this.listReturnType = listReturnType; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListGetByValueListOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListGetByValueListOperation.java index 4e8100e2..4a73bac9 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListGetByValueListOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListGetByValueListOperation.java @@ -33,23 +33,25 @@ public class ListGetByValueListOperation extends ListOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.LIST_GET_BY_VALUE_LIST, - required = true, - allowableValues = OperationTypes.LIST_GET_BY_VALUE_LIST + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.LIST_GET_BY_VALUE_LIST} ) - final public static String type = OperationTypes.LIST_GET_BY_VALUE_LIST; + public final String type = OperationTypes.LIST_GET_BY_VALUE_LIST; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final ListReturnType listReturnType; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final List values; private boolean inverted; @JsonCreator - public ListGetByValueListOperation(@JsonProperty("binName") String binName, - @JsonProperty("listReturnType") ListReturnType listReturnType, - @JsonProperty("values") List values) { + public ListGetByValueListOperation( + @JsonProperty("binName") String binName, + @JsonProperty("listReturnType") ListReturnType listReturnType, + @JsonProperty("values") List values + ) { super(binName); this.listReturnType = listReturnType; this.values = values; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListGetByValueOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListGetByValueOperation.java index 336e110c..5c57dba9 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListGetByValueOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListGetByValueOperation.java @@ -31,24 +31,27 @@ public class ListGetByValueOperation extends ListOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.LIST_GET_BY_VALUE, - required = true, - allowableValues = OperationTypes.LIST_GET_BY_VALUE + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.LIST_GET_BY_VALUE} ) - final public static String type = OperationTypes.LIST_GET_BY_VALUE; + public final String type = OperationTypes.LIST_GET_BY_VALUE; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final Object value; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final ListReturnType listReturnType; private boolean inverted; @JsonCreator - public ListGetByValueOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "value", required = true) Object value, @JsonProperty( - value = "listReturnType", required = true - ) ListReturnType listReturnType) { + public ListGetByValueOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "value") + @Schema(name = "value", requiredMode = Schema.RequiredMode.REQUIRED) Object value, + @JsonProperty(value = "listReturnType", required = true) ListReturnType listReturnType + ) { super(binName); this.value = value; this.listReturnType = listReturnType; @@ -67,6 +70,7 @@ public void setInverted(boolean inverted) { public com.aerospike.client.Operation toOperation() { com.aerospike.client.cdt.CTX[] asCTX = getASCTX(); - return com.aerospike.client.cdt.ListOperation.getByValue(binName, Value.get(value), listReturnType.toListReturnType(inverted), asCTX); + return com.aerospike.client.cdt.ListOperation.getByValue(binName, Value.get(value), + listReturnType.toListReturnType(inverted), asCTX); } } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListGetByValueRangeOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListGetByValueRangeOperation.java index 0ccb6f3c..4fdb7143 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListGetByValueRangeOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListGetByValueRangeOperation.java @@ -33,12 +33,12 @@ public class ListGetByValueRangeOperation extends ListOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.LIST_GET_BY_VALUE_RANGE, - required = true, - allowableValues = OperationTypes.LIST_GET_BY_VALUE_RANGE + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.LIST_GET_BY_VALUE_RANGE} ) - final public static String type = OperationTypes.LIST_GET_BY_VALUE_RANGE; + public final String type = OperationTypes.LIST_GET_BY_VALUE_RANGE; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final ListReturnType listReturnType; private boolean inverted; @@ -48,9 +48,11 @@ public class ListGetByValueRangeOperation extends ListOperation { private Object valueEnd; @JsonCreator - public ListGetByValueRangeOperation(@JsonProperty(value = "binName", required = true) String binName, @JsonProperty( - value = "listReturnType", required = true - ) ListReturnType listReturnType) { + public ListGetByValueRangeOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "listReturnType", required = true) ListReturnType listReturnType + ) { super(binName); this.listReturnType = listReturnType; inverted = false; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListGetByValueRelativeRankRangeOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListGetByValueRelativeRankRangeOperation.java index e5a5bbd4..4eaebbf6 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListGetByValueRelativeRankRangeOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListGetByValueRelativeRankRangeOperation.java @@ -31,18 +31,18 @@ public class ListGetByValueRelativeRankRangeOperation extends ListOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.LIST_GET_BY_VALUE_RELATIVE_RANK_RANGE, - required = true, - allowableValues = OperationTypes.LIST_GET_BY_VALUE_RELATIVE_RANK_RANGE + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.LIST_GET_BY_VALUE_RELATIVE_RANK_RANGE} ) - final public static String type = OperationTypes.LIST_GET_BY_VALUE_RELATIVE_RANK_RANGE; + public final String type = OperationTypes.LIST_GET_BY_VALUE_RELATIVE_RANK_RANGE; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int rank; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final Object value; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final ListReturnType listReturnType; private boolean inverted; @@ -50,9 +50,11 @@ public class ListGetByValueRelativeRankRangeOperation extends ListOperation { private Integer count; @JsonCreator - public ListGetByValueRelativeRankRangeOperation(@JsonProperty("binName") String binName, - @JsonProperty("rank") int rank, @JsonProperty("value") Object value, - @JsonProperty("listReturnType") ListReturnType listReturnType) { + public ListGetByValueRelativeRankRangeOperation( + @JsonProperty("binName") String binName, + @JsonProperty("rank") int rank, @JsonProperty("value") Object value, + @JsonProperty("listReturnType") ListReturnType listReturnType + ) { super(binName); this.rank = rank; this.value = value; @@ -89,4 +91,3 @@ public com.aerospike.client.Operation toOperation() { count, intMapReturnType, asCTX); } } - diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListGetOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListGetOperation.java index 6083075a..30af858d 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListGetOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListGetOperation.java @@ -30,17 +30,21 @@ public class ListGetOperation extends ListOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.LIST_GET, - required = true, - allowableValues = OperationTypes.LIST_GET + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.LIST_GET} ) - final public static String type = OperationTypes.LIST_GET; + public final String type = OperationTypes.LIST_GET; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int index; @JsonCreator - public ListGetOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "index", required = true) int index) { + public ListGetOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "index") + @Schema(name = "index", requiredMode = Schema.RequiredMode.REQUIRED) int index + ) { super(binName); this.index = index; } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListGetRangeOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListGetRangeOperation.java index 2b218347..2dbc846e 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListGetRangeOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListGetRangeOperation.java @@ -30,19 +30,23 @@ public class ListGetRangeOperation extends ListOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.LIST_GET_RANGE, - required = true, - allowableValues = OperationTypes.LIST_GET_RANGE + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.LIST_GET_RANGE} ) - final public static String type = OperationTypes.LIST_GET_RANGE; + public final String type = OperationTypes.LIST_GET_RANGE; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int index; private Integer count; @JsonCreator - public ListGetRangeOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "index", required = true) int index) { + public ListGetRangeOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "index") + @Schema(name = "index", requiredMode = Schema.RequiredMode.REQUIRED) int index + ) { super(binName); this.index = index; } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListIncrementOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListIncrementOperation.java index 8e6fe6c5..057433a6 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListIncrementOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListIncrementOperation.java @@ -31,23 +31,28 @@ public class ListIncrementOperation extends ListOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.LIST_INCREMENT, - required = true, - allowableValues = OperationTypes.LIST_INCREMENT + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.LIST_INCREMENT} ) - final public static String type = OperationTypes.LIST_INCREMENT; + public final String type = OperationTypes.LIST_INCREMENT; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int index; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final Number incr; private ListPolicy listPolicy; @JsonCreator - public ListIncrementOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "index", required = true) int index, - @JsonProperty(value = "incr", required = true) Number incr) { + public ListIncrementOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "index") + @Schema(name = "index", requiredMode = Schema.RequiredMode.REQUIRED) int index, + @JsonProperty(value = "incr") + @Schema(name = "incr", requiredMode = Schema.RequiredMode.REQUIRED) Number incr + ) { super(binName); this.index = index; this.incr = incr; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListInsertItemsOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListInsertItemsOperation.java index 80bc10f2..f93494aa 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListInsertItemsOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListInsertItemsOperation.java @@ -33,22 +33,25 @@ public class ListInsertItemsOperation extends ListOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.LIST_INSERT_ITEMS, - required = true, - allowableValues = OperationTypes.LIST_INSERT_ITEMS + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.LIST_INSERT_ITEMS} ) - final public static String type = OperationTypes.LIST_INSERT_ITEMS; + public final String type = OperationTypes.LIST_INSERT_ITEMS; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int index; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final List values; private ListPolicy listPolicy; @JsonCreator - public ListInsertItemsOperation(@JsonProperty("binName") String binName, @JsonProperty("index") int index, - @JsonProperty("values") List values) { + public ListInsertItemsOperation( + @JsonProperty("binName") String binName, + @JsonProperty("index") int index, + @JsonProperty("values") List values + ) { super(binName); this.index = index; this.values = values; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListInsertOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListInsertOperation.java index 33810016..e89eae50 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListInsertOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListInsertOperation.java @@ -31,23 +31,28 @@ public class ListInsertOperation extends ListOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.LIST_INSERT, - required = true, - allowableValues = OperationTypes.LIST_INSERT + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.LIST_INSERT} ) - final public static String type = OperationTypes.LIST_INSERT; + public final String type = OperationTypes.LIST_INSERT; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int index; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final Object value; private ListPolicy listPolicy; @JsonCreator - public ListInsertOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "index", required = true) int index, - @JsonProperty(value = "value", required = true) Object value) { + public ListInsertOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "index") + @Schema(name = "index", requiredMode = Schema.RequiredMode.REQUIRED) int index, + @JsonProperty(value = "value") + @Schema(name = "value", requiredMode = Schema.RequiredMode.REQUIRED) Object value + ) { super(binName); this.index = index; this.value = value; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListOperation.java index ad264c1d..92e3e55a 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListOperation.java @@ -28,128 +28,104 @@ import java.util.Optional; @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") -@JsonSubTypes( - { - @JsonSubTypes.Type( - value = ListAppendOperation.class, name = OperationTypes.LIST_APPEND - ), @JsonSubTypes.Type( - value = ListAppendItemsOperation.class, name = OperationTypes.LIST_APPEND_ITEMS - ), @JsonSubTypes.Type( - value = ListCreateOperation.class, name = OperationTypes.LIST_CREATE - ), @JsonSubTypes.Type( - value = ListClearOperation.class, name = OperationTypes.LIST_CLEAR - ), @JsonSubTypes.Type( - value = ListGetOperation.class, name = OperationTypes.LIST_GET - ), @JsonSubTypes.Type( - value = ListGetByIndexOperation.class, name = OperationTypes.LIST_GET_BY_INDEX - ), @JsonSubTypes.Type( - value = ListGetByIndexRangeOperation.class, name = OperationTypes.LIST_GET_BY_INDEX_RANGE - ), @JsonSubTypes.Type( - value = ListGetByRankOperation.class, name = OperationTypes.LIST_GET_BY_RANK - ), @JsonSubTypes.Type( - value = ListGetByRankRangeOperation.class, name = OperationTypes.LIST_GET_BY_RANK_RANGE - ), @JsonSubTypes.Type( +@JsonSubTypes({ + @JsonSubTypes.Type(value = ListAppendOperation.class, name = OperationTypes.LIST_APPEND), + @JsonSubTypes.Type(value = ListAppendItemsOperation.class, name = OperationTypes.LIST_APPEND_ITEMS), + @JsonSubTypes.Type(value = ListCreateOperation.class, name = OperationTypes.LIST_CREATE), + @JsonSubTypes.Type(value = ListClearOperation.class, name = OperationTypes.LIST_CLEAR), + @JsonSubTypes.Type(value = ListGetOperation.class, name = OperationTypes.LIST_GET), + @JsonSubTypes.Type(value = ListGetByIndexOperation.class, name = OperationTypes.LIST_GET_BY_INDEX), + @JsonSubTypes.Type(value = ListGetByIndexRangeOperation.class, name = OperationTypes.LIST_GET_BY_INDEX_RANGE), + @JsonSubTypes.Type(value = ListGetByRankOperation.class, name = OperationTypes.LIST_GET_BY_RANK), + @JsonSubTypes.Type(value = ListGetByRankRangeOperation.class, name = OperationTypes.LIST_GET_BY_RANK_RANGE), + @JsonSubTypes.Type( value = ListGetByValueRelativeRankRangeOperation.class, - name = OperationTypes.LIST_GET_BY_VALUE_RELATIVE_RANK_RANGE - ), @JsonSubTypes.Type( - value = ListGetByValueOperation.class, name = OperationTypes.LIST_GET_BY_VALUE - ), @JsonSubTypes.Type( - value = ListGetByValueRangeOperation.class, name = OperationTypes.LIST_GET_BY_VALUE_RANGE - ), @JsonSubTypes.Type( - value = ListGetByValueListOperation.class, name = OperationTypes.LIST_GET_BY_VALUE_LIST - ), @JsonSubTypes.Type( - value = ListGetRangeOperation.class, name = OperationTypes.LIST_GET_RANGE - ), @JsonSubTypes.Type( - value = ListIncrementOperation.class, name = OperationTypes.LIST_INCREMENT - ), @JsonSubTypes.Type( - value = ListInsertOperation.class, name = OperationTypes.LIST_INSERT - ), @JsonSubTypes.Type( - value = ListInsertItemsOperation.class, name = OperationTypes.LIST_INSERT_ITEMS - ), @JsonSubTypes.Type( - value = ListPopOperation.class, name = OperationTypes.LIST_POP - ), @JsonSubTypes.Type( - value = ListPopRangeOperation.class, name = OperationTypes.LIST_POP_RANGE - ), @JsonSubTypes.Type( - value = ListRemoveOperation.class, name = OperationTypes.LIST_REMOVE - ), @JsonSubTypes.Type( - value = ListRemoveByIndexOperation.class, name = OperationTypes.LIST_REMOVE_BY_INDEX - ), @JsonSubTypes.Type( - value = ListRemoveByIndexRangeOperation.class, name = OperationTypes.LIST_REMOVE_BY_INDEX_RANGE - ), @JsonSubTypes.Type( - value = ListRemoveByRankOperation.class, name = OperationTypes.LIST_REMOVE_BY_RANK - ), @JsonSubTypes.Type( - value = ListRemoveByRankRangeOperation.class, name = OperationTypes.LIST_REMOVE_BY_RANK_RANGE - ), @JsonSubTypes.Type( + name = OperationTypes.LIST_GET_BY_VALUE_RELATIVE_RANK_RANGE), + @JsonSubTypes.Type(value = ListGetByValueOperation.class, name = OperationTypes.LIST_GET_BY_VALUE), + @JsonSubTypes.Type(value = ListGetByValueRangeOperation.class, name = OperationTypes.LIST_GET_BY_VALUE_RANGE), + @JsonSubTypes.Type(value = ListGetByValueListOperation.class, name = OperationTypes.LIST_GET_BY_VALUE_LIST), + @JsonSubTypes.Type(value = ListGetRangeOperation.class, name = OperationTypes.LIST_GET_RANGE), + @JsonSubTypes.Type(value = ListIncrementOperation.class, name = OperationTypes.LIST_INCREMENT), + @JsonSubTypes.Type(value = ListInsertOperation.class, name = OperationTypes.LIST_INSERT), + @JsonSubTypes.Type(value = ListInsertItemsOperation.class, name = OperationTypes.LIST_INSERT_ITEMS), + @JsonSubTypes.Type(value = ListPopOperation.class, name = OperationTypes.LIST_POP), + @JsonSubTypes.Type(value = ListPopRangeOperation.class, name = OperationTypes.LIST_POP_RANGE), + @JsonSubTypes.Type(value = ListRemoveOperation.class, name = OperationTypes.LIST_REMOVE), + @JsonSubTypes.Type(value = ListRemoveByIndexOperation.class, name = OperationTypes.LIST_REMOVE_BY_INDEX), + @JsonSubTypes.Type( + value = ListRemoveByIndexRangeOperation.class, + name = OperationTypes.LIST_REMOVE_BY_INDEX_RANGE), + @JsonSubTypes.Type(value = ListRemoveByRankOperation.class, name = OperationTypes.LIST_REMOVE_BY_RANK), + @JsonSubTypes.Type( + value = ListRemoveByRankRangeOperation.class, + name = OperationTypes.LIST_REMOVE_BY_RANK_RANGE), + @JsonSubTypes.Type( value = ListRemoveByValueRelativeRankRangeOperation.class, - name = OperationTypes.LIST_REMOVE_BY_VALUE_RELATIVE_RANK_RANGE - ), @JsonSubTypes.Type( - value = ListRemoveByValueOperation.class, name = OperationTypes.LIST_REMOVE_BY_VALUE - ), @JsonSubTypes.Type( - value = ListRemoveByValueRangeOperation.class, name = OperationTypes.LIST_REMOVE_BY_VALUE_RANGE - ), @JsonSubTypes.Type( - value = ListRemoveByValueListOperation.class, name = OperationTypes.LIST_REMOVE_BY_VALUE_LIST - ), @JsonSubTypes.Type( - value = ListRemoveRangeOperation.class, name = OperationTypes.LIST_REMOVE_RANGE - ), @JsonSubTypes.Type( - value = ListSetOperation.class, name = OperationTypes.LIST_SET - ), @JsonSubTypes.Type( - value = ListSetOrderOperation.class, name = OperationTypes.LIST_SET_ORDER - ), @JsonSubTypes.Type( - value = ListSizeOperation.class, name = OperationTypes.LIST_SIZE - ), @JsonSubTypes.Type( - value = ListSortOperation.class, name = OperationTypes.LIST_SORT - ), @JsonSubTypes.Type( - value = ListTrimOperation.class, name = OperationTypes.LIST_TRIM - ), - } -) + name = OperationTypes.LIST_REMOVE_BY_VALUE_RELATIVE_RANK_RANGE), + @JsonSubTypes.Type(value = ListRemoveByValueOperation.class, name = OperationTypes.LIST_REMOVE_BY_VALUE), + @JsonSubTypes.Type( + value = ListRemoveByValueRangeOperation.class, + name = OperationTypes.LIST_REMOVE_BY_VALUE_RANGE), + @JsonSubTypes.Type( + value = ListRemoveByValueListOperation.class, + name = OperationTypes.LIST_REMOVE_BY_VALUE_LIST), + @JsonSubTypes.Type(value = ListRemoveRangeOperation.class, name = OperationTypes.LIST_REMOVE_RANGE), + @JsonSubTypes.Type(value = ListSetOperation.class, name = OperationTypes.LIST_SET), + @JsonSubTypes.Type(value = ListSetOrderOperation.class, name = OperationTypes.LIST_SET_ORDER), + @JsonSubTypes.Type(value = ListSizeOperation.class, name = OperationTypes.LIST_SIZE), + @JsonSubTypes.Type(value = ListSortOperation.class, name = OperationTypes.LIST_SORT), + @JsonSubTypes.Type(value = ListTrimOperation.class, name = OperationTypes.LIST_TRIM), +}) @Schema( - description = "The base type for describing all cdt list operations. Should not be used directly.", oneOf = { - ListAppendOperation.class, - ListAppendItemsOperation.class, - ListCreateOperation.class, - ListClearOperation.class, - ListGetOperation.class, - ListGetByIndexOperation.class, - ListGetByIndexRangeOperation.class, - ListGetByRankOperation.class, - ListGetByRankRangeOperation.class, - ListGetByValueRelativeRankRangeOperation.class, - ListGetByValueOperation.class, - ListGetByValueRangeOperation.class, - ListGetByValueListOperation.class, - ListGetRangeOperation.class, - ListIncrementOperation.class, - ListInsertOperation.class, - ListInsertItemsOperation.class, - ListPopOperation.class, - ListPopRangeOperation.class, - ListRemoveOperation.class, - ListRemoveByIndexOperation.class, - ListRemoveByIndexRangeOperation.class, - ListRemoveByRankOperation.class, - ListRemoveByRankRangeOperation.class, - ListRemoveByValueRelativeRankRangeOperation.class, - ListRemoveByValueOperation.class, - ListRemoveByValueRangeOperation.class, - ListRemoveByValueListOperation.class, - ListRemoveRangeOperation.class, - ListSetOperation.class, - ListSetOrderOperation.class, - ListSizeOperation.class, - ListSortOperation.class, - ListTrimOperation.class, - -} + description = "The base type for describing all cdt list operations. Should not be used directly.", + oneOf = { + ListAppendOperation.class, + ListAppendItemsOperation.class, + ListCreateOperation.class, + ListClearOperation.class, + ListGetOperation.class, + ListGetByIndexOperation.class, + ListGetByIndexRangeOperation.class, + ListGetByRankOperation.class, + ListGetByRankRangeOperation.class, + ListGetByValueRelativeRankRangeOperation.class, + ListGetByValueOperation.class, + ListGetByValueRangeOperation.class, + ListGetByValueListOperation.class, + ListGetRangeOperation.class, + ListIncrementOperation.class, + ListInsertOperation.class, + ListInsertItemsOperation.class, + ListPopOperation.class, + ListPopRangeOperation.class, + ListRemoveOperation.class, + ListRemoveByIndexOperation.class, + ListRemoveByIndexRangeOperation.class, + ListRemoveByRankOperation.class, + ListRemoveByRankRangeOperation.class, + ListRemoveByValueRelativeRankRangeOperation.class, + ListRemoveByValueOperation.class, + ListRemoveByValueRangeOperation.class, + ListRemoveByValueListOperation.class, + ListRemoveRangeOperation.class, + ListSetOperation.class, + ListSetOrderOperation.class, + ListSizeOperation.class, + ListSortOperation.class, + ListTrimOperation.class, + } ) -abstract public class ListOperation extends Operation { - @Schema(required = true) +public abstract class ListOperation extends Operation { + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) protected String binName; protected List ctx; @JsonCreator - protected ListOperation(@JsonProperty(value = "binName", required = true) String binName) { + protected ListOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName + ) { this.binName = binName; } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListPolicy.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListPolicy.java index 20b620d9..81748684 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListPolicy.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListPolicy.java @@ -45,7 +45,7 @@ public void setWriteFlags(List writeFlags) { } public com.aerospike.client.cdt.ListPolicy toListPolicy() { - if (order == null && (writeFlags == null || writeFlags.size() == 0)) { + if (order == null && (writeFlags == null || writeFlags.isEmpty())) { return com.aerospike.client.cdt.ListPolicy.Default; } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListPopOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListPopOperation.java index 72484a7d..a8e06997 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListPopOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListPopOperation.java @@ -30,17 +30,21 @@ public class ListPopOperation extends ListOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.LIST_POP, - required = true, - allowableValues = OperationTypes.LIST_POP + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.LIST_POP} ) - final public static String type = OperationTypes.LIST_POP; + public final String type = OperationTypes.LIST_POP; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int index; @JsonCreator - public ListPopOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "index", required = true) int index) { + public ListPopOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "index") + @Schema(name = "index", requiredMode = Schema.RequiredMode.REQUIRED) int index + ) { super(binName); this.index = index; } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListPopRangeOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListPopRangeOperation.java index 00d67836..89150ffd 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListPopRangeOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListPopRangeOperation.java @@ -30,19 +30,23 @@ public class ListPopRangeOperation extends ListOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.LIST_POP_RANGE, - required = true, - allowableValues = OperationTypes.LIST_POP_RANGE + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.LIST_POP_RANGE} ) - final public static String type = OperationTypes.LIST_POP_RANGE; + public final String type = OperationTypes.LIST_POP_RANGE; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int index; private Integer count; @JsonCreator - public ListPopRangeOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "index", required = true) int index) { + public ListPopRangeOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "index") + @Schema(name = "index", requiredMode = Schema.RequiredMode.REQUIRED) int index + ) { super(binName); this.index = index; } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListRemoveByIndexOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListRemoveByIndexOperation.java index 4ca42d5a..d1d66b4f 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListRemoveByIndexOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListRemoveByIndexOperation.java @@ -30,24 +30,27 @@ public class ListRemoveByIndexOperation extends ListOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.LIST_REMOVE_BY_INDEX, - required = true, - allowableValues = OperationTypes.LIST_REMOVE_BY_INDEX + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.LIST_REMOVE_BY_INDEX} ) - final public static String type = OperationTypes.LIST_REMOVE_BY_INDEX; + public final String type = OperationTypes.LIST_REMOVE_BY_INDEX; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int index; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final ListReturnType listReturnType; private boolean inverted; @JsonCreator - public ListRemoveByIndexOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "index", required = true) int index, @JsonProperty( - value = "listReturnType", required = true - ) ListReturnType listReturnType) { + public ListRemoveByIndexOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "index") + @Schema(name = "index", requiredMode = Schema.RequiredMode.REQUIRED) int index, + @JsonProperty(value = "listReturnType", required = true) ListReturnType listReturnType + ) { super(binName); this.index = index; this.listReturnType = listReturnType; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListRemoveByIndexRangeOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListRemoveByIndexRangeOperation.java index 7d1fcfac..45890dd1 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListRemoveByIndexRangeOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListRemoveByIndexRangeOperation.java @@ -30,15 +30,15 @@ public class ListRemoveByIndexRangeOperation extends ListOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.LIST_REMOVE_BY_INDEX_RANGE, - required = true, - allowableValues = OperationTypes.LIST_REMOVE_BY_INDEX_RANGE + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.LIST_REMOVE_BY_INDEX_RANGE} ) - final public static String type = OperationTypes.LIST_REMOVE_BY_INDEX_RANGE; + public final String type = OperationTypes.LIST_REMOVE_BY_INDEX_RANGE; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int index; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final ListReturnType listReturnType; private boolean inverted; @@ -46,10 +46,13 @@ public class ListRemoveByIndexRangeOperation extends ListOperation { private Integer count; @JsonCreator - public ListRemoveByIndexRangeOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "index", required = true) int index, @JsonProperty( - value = "listReturnType", required = true - ) ListReturnType listReturnType) { + public ListRemoveByIndexRangeOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "index") + @Schema(name = "index", requiredMode = Schema.RequiredMode.REQUIRED) int index, + @JsonProperty(value = "listReturnType", required = true) ListReturnType listReturnType + ) { super(binName); this.index = index; this.listReturnType = listReturnType; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListRemoveByRankOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListRemoveByRankOperation.java index ef61bf33..35201947 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListRemoveByRankOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListRemoveByRankOperation.java @@ -30,24 +30,28 @@ public class ListRemoveByRankOperation extends ListOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.LIST_REMOVE_BY_RANK, - required = true, - allowableValues = OperationTypes.LIST_REMOVE_BY_RANK + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.LIST_REMOVE_BY_RANK} ) - final public static String type = OperationTypes.LIST_REMOVE_BY_RANK; + public final String type = OperationTypes.LIST_REMOVE_BY_RANK; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int rank; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final ListReturnType listReturnType; private boolean inverted; @JsonCreator - public ListRemoveByRankOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "rank", required = true) int rank, @JsonProperty( - value = "listReturnType", required = true - ) ListReturnType listReturnType) { + public ListRemoveByRankOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "rank") + @Schema(name = "rank", requiredMode = Schema.RequiredMode.REQUIRED) int rank, + @JsonProperty(value = "listReturnType") + @Schema(name = "listReturnType", requiredMode = Schema.RequiredMode.REQUIRED) ListReturnType listReturnType + ) { super(binName); this.rank = rank; this.listReturnType = listReturnType; @@ -65,6 +69,7 @@ public void setInverted(boolean inverted) { public com.aerospike.client.Operation toOperation() { com.aerospike.client.cdt.CTX[] asCTX = getASCTX(); - return com.aerospike.client.cdt.ListOperation.removeByRank(binName, rank, listReturnType.toListReturnType(inverted), asCTX); + return com.aerospike.client.cdt.ListOperation.removeByRank(binName, rank, + listReturnType.toListReturnType(inverted), asCTX); } } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListRemoveByRankRangeOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListRemoveByRankRangeOperation.java index 342580a3..6fc65a66 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListRemoveByRankRangeOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListRemoveByRankRangeOperation.java @@ -30,31 +30,33 @@ public class ListRemoveByRankRangeOperation extends ListOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.LIST_REMOVE_BY_RANK_RANGE, - required = true, - allowableValues = OperationTypes.LIST_REMOVE_BY_RANK_RANGE + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.LIST_REMOVE_BY_RANK_RANGE} ) - final public static String type = OperationTypes.LIST_REMOVE_BY_RANK_RANGE; + public final String type = OperationTypes.LIST_REMOVE_BY_RANK_RANGE; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int rank; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final ListReturnType listReturnType; private boolean inverted; + private Integer count; @JsonCreator - public ListRemoveByRankRangeOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "rank", required = true) int rank, @JsonProperty( - value = "listReturnType", required = true - ) ListReturnType listReturnType) { + public ListRemoveByRankRangeOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "rank") + @Schema(name = "rank", requiredMode = Schema.RequiredMode.REQUIRED) int rank, + @JsonProperty(value = "listReturnType", required = true) ListReturnType listReturnType + ) { super(binName); this.rank = rank; this.listReturnType = listReturnType; } - private Integer count; - public Integer getCount() { return count; } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListRemoveByValueListOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListRemoveByValueListOperation.java index aef702e3..4b108c49 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListRemoveByValueListOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListRemoveByValueListOperation.java @@ -33,23 +33,25 @@ public class ListRemoveByValueListOperation extends ListOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.LIST_REMOVE_BY_VALUE_LIST, - required = true, - allowableValues = OperationTypes.LIST_REMOVE_BY_VALUE_LIST + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.LIST_REMOVE_BY_VALUE_LIST} ) - final public static String type = OperationTypes.LIST_REMOVE_BY_VALUE_LIST; + public final String type = OperationTypes.LIST_REMOVE_BY_VALUE_LIST; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final List values; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final ListReturnType listReturnType; private boolean inverted; @JsonCreator - public ListRemoveByValueListOperation(@JsonProperty("binName") String binName, - @JsonProperty("values") List values, - @JsonProperty("listReturnType") ListReturnType listReturnType) { + public ListRemoveByValueListOperation( + @JsonProperty("binName") String binName, + @JsonProperty("values") List values, + @JsonProperty("listReturnType") ListReturnType listReturnType + ) { super(binName); this.values = values; this.listReturnType = listReturnType; @@ -68,6 +70,7 @@ public com.aerospike.client.Operation toOperation() { List asVals = values.stream().map(Value::get).toList(); com.aerospike.client.cdt.CTX[] asCTX = getASCTX(); - return com.aerospike.client.cdt.ListOperation.removeByValueList(binName, asVals, listReturnType.toListReturnType(inverted), asCTX); + return com.aerospike.client.cdt.ListOperation.removeByValueList(binName, asVals, + listReturnType.toListReturnType(inverted), asCTX); } } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListRemoveByValueOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListRemoveByValueOperation.java index 0083c29d..26a2d1e2 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListRemoveByValueOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListRemoveByValueOperation.java @@ -35,24 +35,27 @@ public class ListRemoveByValueOperation extends ListOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.LIST_REMOVE_BY_VALUE, - required = true, - allowableValues = OperationTypes.LIST_REMOVE_BY_VALUE + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.LIST_REMOVE_BY_VALUE} ) - final public static String type = OperationTypes.LIST_REMOVE_BY_VALUE; + public final String type = OperationTypes.LIST_REMOVE_BY_VALUE; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final Object value; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final ListReturnType listReturnType; private boolean inverted; @JsonCreator - public ListRemoveByValueOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "value", required = true) Object value, @JsonProperty( - value = "listReturnType", required = true - ) ListReturnType listReturnType) { + public ListRemoveByValueOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "value") + @Schema(name = "value", requiredMode = Schema.RequiredMode.REQUIRED) Object value, + @JsonProperty(value = "listReturnType", required = true) ListReturnType listReturnType + ) { super(binName); this.value = value; this.listReturnType = listReturnType; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListRemoveByValueRangeOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListRemoveByValueRangeOperation.java index 2bf27a05..81fc5e05 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListRemoveByValueRangeOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListRemoveByValueRangeOperation.java @@ -31,12 +31,12 @@ public class ListRemoveByValueRangeOperation extends ListOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.LIST_REMOVE_BY_VALUE_RANGE, - required = true, - allowableValues = OperationTypes.LIST_REMOVE_BY_VALUE_RANGE + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.LIST_REMOVE_BY_VALUE_RANGE} ) - final public static String type = OperationTypes.LIST_REMOVE_BY_VALUE_RANGE; + public final String type = OperationTypes.LIST_REMOVE_BY_VALUE_RANGE; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final ListReturnType listReturnType; private boolean inverted; @@ -46,10 +46,11 @@ public class ListRemoveByValueRangeOperation extends ListOperation { private Object valueEnd; @JsonCreator - public ListRemoveByValueRangeOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty( - value = "listReturnType", required = true - ) ListReturnType listReturnType) { + public ListRemoveByValueRangeOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "listReturnType", required = true) ListReturnType listReturnType + ) { super(binName); this.listReturnType = listReturnType; } @@ -92,6 +93,7 @@ public com.aerospike.client.Operation toOperation() { end = Value.get(valueEnd); } - return com.aerospike.client.cdt.ListOperation.removeByValueRange(binName, begin, end, listReturnType.toListReturnType(inverted), asCTX); + return com.aerospike.client.cdt.ListOperation.removeByValueRange(binName, begin, end, + listReturnType.toListReturnType(inverted), asCTX); } } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListRemoveByValueRelativeRankRangeOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListRemoveByValueRelativeRankRangeOperation.java index df02e9fd..6c416998 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListRemoveByValueRelativeRankRangeOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListRemoveByValueRelativeRankRangeOperation.java @@ -31,18 +31,18 @@ public class ListRemoveByValueRelativeRankRangeOperation extends ListOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.LIST_REMOVE_BY_VALUE_RELATIVE_RANK_RANGE, - required = true, - allowableValues = OperationTypes.LIST_REMOVE_BY_VALUE_RELATIVE_RANK_RANGE + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.LIST_REMOVE_BY_VALUE_RELATIVE_RANK_RANGE} ) - final public static String type = OperationTypes.LIST_REMOVE_BY_VALUE_RELATIVE_RANK_RANGE; + public final String type = OperationTypes.LIST_REMOVE_BY_VALUE_RELATIVE_RANK_RANGE; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int rank; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final Object value; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final ListReturnType listReturnType; private boolean inverted; @@ -50,10 +50,12 @@ public class ListRemoveByValueRelativeRankRangeOperation extends ListOperation { private Integer count; @JsonCreator - public ListRemoveByValueRelativeRankRangeOperation(@JsonProperty("binName") String binName, - @JsonProperty("rank") int rank, - @JsonProperty("value") Object value, - @JsonProperty("listReturnType") ListReturnType listReturnType) { + public ListRemoveByValueRelativeRankRangeOperation( + @JsonProperty("binName") String binName, + @JsonProperty("rank") int rank, + @JsonProperty("value") Object value, + @JsonProperty("listReturnType") ListReturnType listReturnType + ) { super(binName); this.rank = rank; this.value = value; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListRemoveOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListRemoveOperation.java index 4e4c3164..87a6af2d 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListRemoveOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListRemoveOperation.java @@ -30,17 +30,21 @@ public class ListRemoveOperation extends ListOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.LIST_REMOVE, - required = true, - allowableValues = OperationTypes.LIST_REMOVE + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.LIST_REMOVE} ) - final public static String type = OperationTypes.LIST_REMOVE; + public final String type = OperationTypes.LIST_REMOVE; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int index; @JsonCreator - public ListRemoveOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "index", required = true) int index) { + public ListRemoveOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "index") + @Schema(name = "index", requiredMode = Schema.RequiredMode.REQUIRED) int index + ) { super(binName); this.index = index; } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListRemoveRangeOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListRemoveRangeOperation.java index 9d578e6d..0a52f4e0 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListRemoveRangeOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListRemoveRangeOperation.java @@ -30,19 +30,23 @@ public class ListRemoveRangeOperation extends ListOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.LIST_REMOVE_RANGE, - required = true, - allowableValues = OperationTypes.LIST_REMOVE_RANGE + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.LIST_REMOVE_RANGE} ) - final public static String type = OperationTypes.LIST_REMOVE_RANGE; + public final String type = OperationTypes.LIST_REMOVE_RANGE; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int index; private Integer count; @JsonCreator - public ListRemoveRangeOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "index", required = true) Integer index) { + public ListRemoveRangeOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "index") + @Schema(name = "index", requiredMode = Schema.RequiredMode.REQUIRED) Integer index + ) { super(binName); this.index = index; } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListSetOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListSetOperation.java index 55cefbc5..f13601db 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListSetOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListSetOperation.java @@ -31,23 +31,28 @@ public class ListSetOperation extends ListOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.LIST_SET, - required = true, - allowableValues = OperationTypes.LIST_SET + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.LIST_SET} ) - final public static String type = OperationTypes.LIST_SET; + public final String type = OperationTypes.LIST_SET; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int index; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final Object value; private ListPolicy listPolicy; @JsonCreator - public ListSetOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "index", required = true) int index, - @JsonProperty(value = "value", required = true) Object value) { + public ListSetOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "index") + @Schema(name = "index", requiredMode = Schema.RequiredMode.REQUIRED) int index, + @JsonProperty(value = "value") + @Schema(name = "value", requiredMode = Schema.RequiredMode.REQUIRED) Object value + ) { super(binName); this.index = index; this.value = value; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListSetOrderOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListSetOrderOperation.java index b9b2fec6..534a7c58 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListSetOrderOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListSetOrderOperation.java @@ -31,17 +31,20 @@ public class ListSetOrderOperation extends ListOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.LIST_SET_ORDER, - required = true, - allowableValues = OperationTypes.LIST_SET_ORDER + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.LIST_SET_ORDER} ) - final public static String type = OperationTypes.LIST_SET_ORDER; + public final String type = OperationTypes.LIST_SET_ORDER; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final ListOrder listOrder; @JsonCreator - public ListSetOrderOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "listOrder", required = true) ListOrder listOrder) { + public ListSetOrderOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @Schema(name = "listOrder", requiredMode = Schema.RequiredMode.REQUIRED) ListOrder listOrder + ) { super(binName); this.listOrder = listOrder; } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListSizeOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListSizeOperation.java index 0c7eae5b..2be33834 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListSizeOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListSizeOperation.java @@ -30,13 +30,16 @@ public class ListSizeOperation extends ListOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.LIST_SIZE, - required = true, - allowableValues = OperationTypes.LIST_SIZE + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.LIST_SIZE} ) - final public static String type = OperationTypes.LIST_SIZE; + public final String type = OperationTypes.LIST_SIZE; @JsonCreator - public ListSizeOperation(@JsonProperty(value = "binName", required = true) String binName) { + public ListSizeOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName + ) { super(binName); } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListSortOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListSortOperation.java index 4d099ec4..fb7ceb36 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListSortOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListSortOperation.java @@ -33,15 +33,18 @@ public class ListSortOperation extends ListOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.LIST_SORT, - required = true, - allowableValues = OperationTypes.LIST_SORT + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.LIST_SORT} ) - final public static String type = OperationTypes.LIST_SORT; + public final String type = OperationTypes.LIST_SORT; private List sortFlags; @JsonCreator - public ListSortOperation(@JsonProperty(value = "binName", required = true) String binName) { + public ListSortOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName + ) { super(binName); } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListTrimOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListTrimOperation.java index 1874634a..be909af2 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/ListTrimOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/ListTrimOperation.java @@ -30,21 +30,26 @@ public class ListTrimOperation extends ListOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.LIST_TRIM, - required = true, - allowableValues = OperationTypes.LIST_TRIM + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.LIST_TRIM} ) - final public static String type = OperationTypes.LIST_TRIM; + public final String type = OperationTypes.LIST_TRIM; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int index; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int count; @JsonCreator - public ListTrimOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "index", required = true) int index, - @JsonProperty(value = "count", required = true) int count) { + public ListTrimOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "index") + @Schema(name = "index", requiredMode = Schema.RequiredMode.REQUIRED) int index, + @JsonProperty(value = "count") + @Schema(name = "count", requiredMode = Schema.RequiredMode.REQUIRED) int count + ) { super(binName); this.index = index; this.count = count; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapClearOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapClearOperation.java index 7e71af4f..a30a7788 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapClearOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapClearOperation.java @@ -30,13 +30,16 @@ public class MapClearOperation extends MapOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.MAP_CLEAR, - required = true, - allowableValues = OperationTypes.MAP_CLEAR + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.MAP_CLEAR} ) - final public static String type = OperationTypes.MAP_CLEAR; + public final String type = OperationTypes.MAP_CLEAR; @JsonCreator - public MapClearOperation(@JsonProperty(value = "binName", required = true) String binName) { + public MapClearOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName + ) { super(binName); } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapCreateOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapCreateOperation.java index 9fea1210..730f5ab2 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapCreateOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapCreateOperation.java @@ -31,17 +31,20 @@ public class MapCreateOperation extends MapOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.MAP_CREATE, - required = true, - allowableValues = OperationTypes.MAP_CREATE + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.MAP_CREATE} ) - final public static String type = OperationTypes.MAP_CREATE; + public final String type = OperationTypes.MAP_CREATE; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final MapOrder mapOrder; @JsonCreator - public MapCreateOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "mapOrder", required = true) MapOrder mapOrder) { + public MapCreateOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @Schema(name = "mapOrder", requiredMode = Schema.RequiredMode.REQUIRED) MapOrder mapOrder + ) { super(binName); this.mapOrder = mapOrder; } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByIndexOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByIndexOperation.java index 436b8c83..56e4e442 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByIndexOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByIndexOperation.java @@ -30,23 +30,27 @@ public class MapGetByIndexOperation extends MapOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.MAP_GET_BY_INDEX, - required = true, - allowableValues = OperationTypes.MAP_GET_BY_INDEX + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.MAP_GET_BY_INDEX} ) - final public static String type = OperationTypes.MAP_GET_BY_INDEX; + public final String type = OperationTypes.MAP_GET_BY_INDEX; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int index; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final MapReturnType mapReturnType; private boolean inverted; @JsonCreator - public MapGetByIndexOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "index", required = true) int index, - @JsonProperty(value = "mapReturnType", required = true) MapReturnType mapReturnType) { + public MapGetByIndexOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "index") + @Schema(name = "index", requiredMode = Schema.RequiredMode.REQUIRED) int index, + @Schema(name = "mapReturnType", requiredMode = Schema.RequiredMode.REQUIRED) MapReturnType mapReturnType + ) { super(binName); this.index = index; this.mapReturnType = mapReturnType; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByIndexRangeOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByIndexRangeOperation.java index 72f1efba..bc28321f 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByIndexRangeOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByIndexRangeOperation.java @@ -30,15 +30,15 @@ public class MapGetByIndexRangeOperation extends MapOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.MAP_GET_BY_INDEX_RANGE, - required = true, - allowableValues = OperationTypes.MAP_GET_BY_INDEX_RANGE + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.MAP_GET_BY_INDEX_RANGE} ) - final public static String type = OperationTypes.MAP_GET_BY_INDEX_RANGE; + public final String type = OperationTypes.MAP_GET_BY_INDEX_RANGE; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int index; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final MapReturnType mapReturnType; private boolean inverted; @@ -46,10 +46,13 @@ public class MapGetByIndexRangeOperation extends MapOperation { private Integer count; @JsonCreator - public MapGetByIndexRangeOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "index", required = true) int index, @JsonProperty( - value = "mapReturnType", required = true - ) MapReturnType mapReturnType) { + public MapGetByIndexRangeOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "index") + @Schema(name = "index", requiredMode = Schema.RequiredMode.REQUIRED) int index, + @JsonProperty(value = "mapReturnType", required = true) MapReturnType mapReturnType + ) { super(binName); this.index = index; this.mapReturnType = mapReturnType; @@ -83,4 +86,3 @@ public com.aerospike.client.Operation toOperation() { return com.aerospike.client.cdt.MapOperation.getByIndexRange(binName, index, count, intMapReturnType, asCTX); } } - diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByKeyListOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByKeyListOperation.java index 735e3a86..71bec42b 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByKeyListOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByKeyListOperation.java @@ -33,22 +33,25 @@ public class MapGetByKeyListOperation extends MapOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.MAP_GET_BY_KEY_LIST, - required = true, - allowableValues = OperationTypes.MAP_GET_BY_KEY_LIST + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.MAP_GET_BY_KEY_LIST} ) - final public static String type = OperationTypes.MAP_GET_BY_KEY_LIST; + public final String type = OperationTypes.MAP_GET_BY_KEY_LIST; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final List keys; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final MapReturnType mapReturnType; private boolean inverted; @JsonCreator - public MapGetByKeyListOperation(@JsonProperty("binName") String binName, @JsonProperty("keys") List keys, - @JsonProperty("mapReturnType") MapReturnType mapReturnType) { + public MapGetByKeyListOperation( + @JsonProperty("binName") String binName, + @JsonProperty("keys") List keys, + @JsonProperty("mapReturnType") MapReturnType mapReturnType + ) { super(binName); this.keys = keys; this.mapReturnType = mapReturnType; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByKeyOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByKeyOperation.java index 6362b143..9091d3a1 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByKeyOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByKeyOperation.java @@ -31,23 +31,27 @@ public class MapGetByKeyOperation extends MapOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.MAP_GET_BY_KEY, - required = true, - allowableValues = OperationTypes.MAP_GET_BY_KEY + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.MAP_GET_BY_KEY} ) - final public static String type = OperationTypes.MAP_GET_BY_KEY; + public final String type = OperationTypes.MAP_GET_BY_KEY; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final Object key; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final MapReturnType mapReturnType; private boolean inverted; @JsonCreator - public MapGetByKeyOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "key", required = true) Object key, - @JsonProperty(value = "mapReturnType", required = true) MapReturnType mapReturnType) { + public MapGetByKeyOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "key") + @Schema(name = "key", requiredMode = Schema.RequiredMode.REQUIRED) Object key, + @Schema(name = "mapReturnType", requiredMode = Schema.RequiredMode.REQUIRED) MapReturnType mapReturnType + ) { super(binName); this.key = key; this.mapReturnType = mapReturnType; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByKeyRangeOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByKeyRangeOperation.java index 4de3571e..abb55115 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByKeyRangeOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByKeyRangeOperation.java @@ -31,12 +31,12 @@ public class MapGetByKeyRangeOperation extends MapOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.MAP_GET_BY_KEY_RANGE, - required = true, - allowableValues = OperationTypes.MAP_GET_BY_KEY_RANGE + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.MAP_GET_BY_KEY_RANGE} ) - final public static String type = OperationTypes.MAP_GET_BY_KEY_RANGE; + public final String type = OperationTypes.MAP_GET_BY_KEY_RANGE; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final MapReturnType mapReturnType; private boolean inverted; @@ -45,9 +45,11 @@ public class MapGetByKeyRangeOperation extends MapOperation { private Object keyEnd; @JsonCreator - public MapGetByKeyRangeOperation(@JsonProperty(value = "binName", required = true) String binName, @JsonProperty( - value = "mapReturnType", required = true - ) MapReturnType mapReturnType) { + public MapGetByKeyRangeOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "mapReturnType", required = true) MapReturnType mapReturnType + ) { super(binName); this.mapReturnType = mapReturnType; inverted = false; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByKeyRelativeIndexRange.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByKeyRelativeIndexRange.java index 3228ab18..5bdc4033 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByKeyRelativeIndexRange.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByKeyRelativeIndexRange.java @@ -31,18 +31,18 @@ public class MapGetByKeyRelativeIndexRange extends MapOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.MAP_GET_BY_KEY_RELATIVE_INDEX_RANGE, - required = true, - allowableValues = OperationTypes.MAP_GET_BY_KEY_RELATIVE_INDEX_RANGE + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.MAP_GET_BY_KEY_RELATIVE_INDEX_RANGE} ) - final public static String type = OperationTypes.MAP_GET_BY_KEY_RELATIVE_INDEX_RANGE; + public final String type = OperationTypes.MAP_GET_BY_KEY_RELATIVE_INDEX_RANGE; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int index; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final Object value; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final MapReturnType mapReturnType; private boolean inverted; @@ -50,11 +50,15 @@ public class MapGetByKeyRelativeIndexRange extends MapOperation { private Integer count; @JsonCreator - public MapGetByKeyRelativeIndexRange(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "index", required = true) int index, - @JsonProperty(value = "value", required = true) Object value, @JsonProperty( - value = "mapReturnType", required = true - ) MapReturnType mapReturnType) { + public MapGetByKeyRelativeIndexRange( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "index") + @Schema(name = "index", requiredMode = Schema.RequiredMode.REQUIRED) int index, + @JsonProperty(value = "value") + @Schema(name = "value", requiredMode = Schema.RequiredMode.REQUIRED) Object value, + @JsonProperty(value = "mapReturnType", required = true) MapReturnType mapReturnType + ) { super(binName); this.index = index; this.value = value; @@ -91,4 +95,3 @@ public com.aerospike.client.Operation toOperation() { intMapReturnType, asCTX); } } - diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByRankOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByRankOperation.java index 215ca226..52ffb7fa 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByRankOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByRankOperation.java @@ -30,23 +30,27 @@ public class MapGetByRankOperation extends MapOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.MAP_GET_BY_RANK, - required = true, - allowableValues = OperationTypes.MAP_GET_BY_RANK + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.MAP_GET_BY_RANK} ) - final public static String type = OperationTypes.MAP_GET_BY_RANK; + public final String type = OperationTypes.MAP_GET_BY_RANK; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int rank; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final MapReturnType mapReturnType; private boolean inverted; @JsonCreator - public MapGetByRankOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "rank", required = true) int rank, - @JsonProperty(value = "mapReturnType", required = true) MapReturnType mapReturnType) { + public MapGetByRankOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "rank") + @Schema(name = "rank", requiredMode = Schema.RequiredMode.REQUIRED) int rank, + @Schema(name = "mapReturnType", requiredMode = Schema.RequiredMode.REQUIRED) MapReturnType mapReturnType + ) { super(binName); this.rank = rank; this.mapReturnType = mapReturnType; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByRankRangeOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByRankRangeOperation.java index 107b7489..56f3d222 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByRankRangeOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByRankRangeOperation.java @@ -30,15 +30,15 @@ public class MapGetByRankRangeOperation extends MapOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.MAP_GET_BY_RANK_RANGE, - required = true, - allowableValues = OperationTypes.MAP_GET_BY_RANK_RANGE + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.MAP_GET_BY_RANK_RANGE} ) - final public static String type = OperationTypes.MAP_GET_BY_RANK_RANGE; + public final String type = OperationTypes.MAP_GET_BY_RANK_RANGE; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final MapReturnType mapReturnType; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int rank; private Integer count; @@ -46,9 +46,14 @@ public class MapGetByRankRangeOperation extends MapOperation { private boolean inverted; @JsonCreator - public MapGetByRankRangeOperation(@JsonProperty(value = "binName", required = true) String binName, @JsonProperty( - value = "mapReturnType", required = true - ) MapReturnType mapReturnType, @JsonProperty(value = "rank", required = true) int rank) { + public MapGetByRankRangeOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "mapReturnType") + @Schema(name = "mapReturnType", requiredMode = Schema.RequiredMode.REQUIRED) MapReturnType mapReturnType, + @JsonProperty(value = "rank") + @Schema(name = "rank", requiredMode = Schema.RequiredMode.REQUIRED) int rank + ) { super(binName); this.mapReturnType = mapReturnType; this.rank = rank; @@ -66,14 +71,14 @@ public boolean getInverted() { return inverted; } - public void setInverted(boolean inverted) { - this.inverted = inverted; - } - public boolean isInverted() { return inverted; } + public void setInverted(boolean inverted) { + this.inverted = inverted; + } + @Override public com.aerospike.client.Operation toOperation() { com.aerospike.client.cdt.CTX[] asCTX = getASCTX(); diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByValueListOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByValueListOperation.java index eecb1142..510f873e 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByValueListOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByValueListOperation.java @@ -33,23 +33,25 @@ public class MapGetByValueListOperation extends MapOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.MAP_GET_BY_VALUE_LIST, - required = true, - allowableValues = OperationTypes.MAP_GET_BY_VALUE_LIST + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.MAP_GET_BY_VALUE_LIST} ) - final public static String type = OperationTypes.MAP_GET_BY_VALUE_LIST; + public final String type = OperationTypes.MAP_GET_BY_VALUE_LIST; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final List values; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final MapReturnType mapReturnType; private boolean inverted; @JsonCreator - public MapGetByValueListOperation(@JsonProperty("binName") String binName, - @JsonProperty("values") List values, - @JsonProperty("mapReturnType") MapReturnType mapReturnType) { + public MapGetByValueListOperation( + @JsonProperty("binName") String binName, + @JsonProperty("values") List values, + @JsonProperty("mapReturnType") MapReturnType mapReturnType + ) { super(binName); this.values = values; this.mapReturnType = mapReturnType; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByValueOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByValueOperation.java index 47de7330..04accd10 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByValueOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByValueOperation.java @@ -31,23 +31,27 @@ public class MapGetByValueOperation extends MapOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.MAP_GET_BY_VALUE, - required = true, - allowableValues = OperationTypes.MAP_GET_BY_VALUE + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.MAP_GET_BY_VALUE} ) - final public static String type = OperationTypes.MAP_GET_BY_VALUE; + public final String type = OperationTypes.MAP_GET_BY_VALUE; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final Object value; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final MapReturnType mapReturnType; private boolean inverted; @JsonCreator - public MapGetByValueOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "value", required = true) Object value, - @JsonProperty(value = "mapReturnType", required = true) MapReturnType mapReturnType) { + public MapGetByValueOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "value") + @Schema(name = "value", requiredMode = Schema.RequiredMode.REQUIRED) Object value, + @Schema(name = "mapReturnType", requiredMode = Schema.RequiredMode.REQUIRED) MapReturnType mapReturnType + ) { super(binName); this.value = value; this.mapReturnType = mapReturnType; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByValueRangeOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByValueRangeOperation.java index 47a35b64..711a5f22 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByValueRangeOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByValueRangeOperation.java @@ -31,12 +31,12 @@ public class MapGetByValueRangeOperation extends MapOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.MAP_GET_BY_VALUE_RANGE, - required = true, - allowableValues = OperationTypes.MAP_GET_BY_VALUE_RANGE + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.MAP_GET_BY_VALUE_RANGE} ) - final public static String type = OperationTypes.MAP_GET_BY_VALUE_RANGE; + public final String type = OperationTypes.MAP_GET_BY_VALUE_RANGE; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final MapReturnType mapReturnType; private boolean inverted; @@ -46,9 +46,11 @@ public class MapGetByValueRangeOperation extends MapOperation { private Object valueEnd; @JsonCreator - public MapGetByValueRangeOperation(@JsonProperty(value = "binName", required = true) String binName, @JsonProperty( - value = "mapReturnType", required = true - ) MapReturnType mapReturnType) { + public MapGetByValueRangeOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "mapReturnType", required = true) MapReturnType mapReturnType + ) { super(binName); this.mapReturnType = mapReturnType; } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByValueRelativeRankRangeOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByValueRelativeRankRangeOperation.java index a8807f97..1c3a2f7d 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByValueRelativeRankRangeOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapGetByValueRelativeRankRangeOperation.java @@ -31,18 +31,18 @@ public class MapGetByValueRelativeRankRangeOperation extends MapOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.MAP_GET_BY_VALUE_RELATIVE_RANK_RANGE, - required = true, - allowableValues = OperationTypes.MAP_GET_BY_VALUE_RELATIVE_RANK_RANGE + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.MAP_GET_BY_VALUE_RELATIVE_RANK_RANGE} ) - final public static String type = OperationTypes.MAP_GET_BY_VALUE_RELATIVE_RANK_RANGE; + public final String type = OperationTypes.MAP_GET_BY_VALUE_RELATIVE_RANK_RANGE; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int rank; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final Object value; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final MapReturnType mapReturnType; private boolean inverted; @@ -50,9 +50,12 @@ public class MapGetByValueRelativeRankRangeOperation extends MapOperation { private Integer count; @JsonCreator - public MapGetByValueRelativeRankRangeOperation(@JsonProperty("binName") String binName, - @JsonProperty("rank") int rank, @JsonProperty("value") Object value, - @JsonProperty("mapReturnType") MapReturnType mapReturnType) { + public MapGetByValueRelativeRankRangeOperation( + @JsonProperty("binName") String binName, + @JsonProperty("rank") int rank, + @JsonProperty("value") Object value, + @JsonProperty("mapReturnType") MapReturnType mapReturnType + ) { super(binName); this.rank = rank; this.value = value; @@ -89,4 +92,3 @@ public com.aerospike.client.Operation toOperation() { intMapReturnType, asCTX); } } - diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapIncrementOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapIncrementOperation.java index a9f98406..ab7d4f53 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapIncrementOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapIncrementOperation.java @@ -31,23 +31,28 @@ public class MapIncrementOperation extends MapOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.MAP_INCREMENT, - required = true, - allowableValues = OperationTypes.MAP_INCREMENT + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.MAP_INCREMENT} ) - final public static String type = OperationTypes.MAP_INCREMENT; + public final String type = OperationTypes.MAP_INCREMENT; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final Number incr; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final Object key; private MapPolicy mapPolicy; @JsonCreator - public MapIncrementOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "incr", required = true) Number incr, - @JsonProperty(value = "key", required = true) Object key) { + public MapIncrementOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "incr") + @Schema(name = "incr", requiredMode = Schema.RequiredMode.REQUIRED) Number incr, + @JsonProperty(value = "key") + @Schema(name = "key", requiredMode = Schema.RequiredMode.REQUIRED) Object key + ) { super(binName); this.incr = incr; this.key = key; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapOperation.java index 471181eb..33388ac2 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapOperation.java @@ -28,117 +28,100 @@ import java.util.Optional; @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") -@JsonSubTypes( - { - @JsonSubTypes.Type( - value = MapCreateOperation.class, name = OperationTypes.MAP_CREATE - ), @JsonSubTypes.Type( - value = MapClearOperation.class, name = OperationTypes.MAP_CLEAR - ), @JsonSubTypes.Type( - value = MapGetByIndexOperation.class, name = OperationTypes.MAP_GET_BY_INDEX - ), @JsonSubTypes.Type( - value = MapGetByIndexRangeOperation.class, name = OperationTypes.MAP_GET_BY_INDEX_RANGE - ), @JsonSubTypes.Type( - value = MapGetByKeyOperation.class, name = OperationTypes.MAP_GET_BY_KEY - ), @JsonSubTypes.Type( - value = MapGetByKeyListOperation.class, name = OperationTypes.MAP_GET_BY_KEY_LIST - ), @JsonSubTypes.Type( - value = MapGetByKeyRangeOperation.class, name = OperationTypes.MAP_GET_BY_KEY_RANGE - ), @JsonSubTypes.Type( - value = MapGetByRankOperation.class, name = OperationTypes.MAP_GET_BY_RANK - ), @JsonSubTypes.Type( - value = MapGetByRankRangeOperation.class, name = OperationTypes.MAP_GET_BY_RANK_RANGE - ), @JsonSubTypes.Type( - value = MapGetByValueOperation.class, name = OperationTypes.MAP_GET_BY_VALUE - ), @JsonSubTypes.Type( - value = MapGetByValueRangeOperation.class, name = OperationTypes.MAP_GET_BY_VALUE_RANGE - ), @JsonSubTypes.Type( - value = MapGetByValueListOperation.class, name = OperationTypes.MAP_GET_BY_VALUE_LIST - ), @JsonSubTypes.Type( +@JsonSubTypes({ + @JsonSubTypes.Type(value = MapCreateOperation.class, name = OperationTypes.MAP_CREATE), + @JsonSubTypes.Type(value = MapClearOperation.class, name = OperationTypes.MAP_CLEAR), + @JsonSubTypes.Type(value = MapGetByIndexOperation.class, name = OperationTypes.MAP_GET_BY_INDEX), + @JsonSubTypes.Type(value = MapGetByIndexRangeOperation.class, name = OperationTypes.MAP_GET_BY_INDEX_RANGE), + @JsonSubTypes.Type(value = MapGetByKeyOperation.class, name = OperationTypes.MAP_GET_BY_KEY), + @JsonSubTypes.Type(value = MapGetByKeyListOperation.class, name = OperationTypes.MAP_GET_BY_KEY_LIST), + @JsonSubTypes.Type(value = MapGetByKeyRangeOperation.class, name = OperationTypes.MAP_GET_BY_KEY_RANGE), + @JsonSubTypes.Type(value = MapGetByRankOperation.class, name = OperationTypes.MAP_GET_BY_RANK), + @JsonSubTypes.Type(value = MapGetByRankRangeOperation.class, name = OperationTypes.MAP_GET_BY_RANK_RANGE), + @JsonSubTypes.Type(value = MapGetByValueOperation.class, name = OperationTypes.MAP_GET_BY_VALUE), + @JsonSubTypes.Type(value = MapGetByValueRangeOperation.class, name = OperationTypes.MAP_GET_BY_VALUE_RANGE), + @JsonSubTypes.Type(value = MapGetByValueListOperation.class, name = OperationTypes.MAP_GET_BY_VALUE_LIST), + @JsonSubTypes.Type( value = MapGetByValueRelativeRankRangeOperation.class, - name = OperationTypes.MAP_GET_BY_VALUE_RELATIVE_RANK_RANGE - ), @JsonSubTypes.Type( - value = MapGetByKeyRelativeIndexRange.class, name = OperationTypes.MAP_GET_BY_KEY_RELATIVE_INDEX_RANGE - ), @JsonSubTypes.Type( - value = MapIncrementOperation.class, name = OperationTypes.MAP_INCREMENT - ), @JsonSubTypes.Type( - value = MapPutOperation.class, name = OperationTypes.MAP_PUT - ), @JsonSubTypes.Type( - value = MapPutItemsOperation.class, name = OperationTypes.MAP_PUT_ITEMS - ), @JsonSubTypes.Type( - value = MapRemoveByIndexOperation.class, name = OperationTypes.MAP_REMOVE_BY_INDEX - ), @JsonSubTypes.Type( - value = MapRemoveByIndexRangeOperation.class, name = OperationTypes.MAP_REMOVE_BY_INDEX_RANGE - ), @JsonSubTypes.Type( - value = MapRemoveByKeyOperation.class, name = OperationTypes.MAP_REMOVE_BY_KEY - ), @JsonSubTypes.Type( - value = MapRemoveByKeyRangeOperation.class, name = OperationTypes.MAP_REMOVE_BY_KEY_RANGE - ), @JsonSubTypes.Type( - value = MapRemoveByRankOperation.class, name = OperationTypes.MAP_REMOVE_BY_RANK - ), @JsonSubTypes.Type( - value = MapRemoveByRankRangeOperation.class, name = OperationTypes.MAP_REMOVE_BY_RANK_RANGE - ), @JsonSubTypes.Type( - value = MapRemoveByValueOperation.class, name = OperationTypes.MAP_REMOVE_BY_VALUE - ), @JsonSubTypes.Type( - value = MapRemoveByValueRangeOperation.class, name = OperationTypes.MAP_REMOVE_BY_VALUE_RANGE - ), @JsonSubTypes.Type( - value = MapRemoveByValueListOperation.class, name = OperationTypes.MAP_REMOVE_BY_VALUE_LIST - ), @JsonSubTypes.Type( + name = OperationTypes.MAP_GET_BY_VALUE_RELATIVE_RANK_RANGE), + @JsonSubTypes.Type( + value = MapGetByKeyRelativeIndexRange.class, + name = OperationTypes.MAP_GET_BY_KEY_RELATIVE_INDEX_RANGE), + @JsonSubTypes.Type(value = MapIncrementOperation.class, name = OperationTypes.MAP_INCREMENT), + @JsonSubTypes.Type(value = MapPutOperation.class, name = OperationTypes.MAP_PUT), + @JsonSubTypes.Type(value = MapPutItemsOperation.class, name = OperationTypes.MAP_PUT_ITEMS), + @JsonSubTypes.Type(value = MapRemoveByIndexOperation.class, name = OperationTypes.MAP_REMOVE_BY_INDEX), + @JsonSubTypes.Type( + value = MapRemoveByIndexRangeOperation.class, + name = OperationTypes.MAP_REMOVE_BY_INDEX_RANGE), + @JsonSubTypes.Type(value = MapRemoveByKeyOperation.class, name = OperationTypes.MAP_REMOVE_BY_KEY), + @JsonSubTypes.Type(value = MapRemoveByKeyRangeOperation.class, name = OperationTypes.MAP_REMOVE_BY_KEY_RANGE), + @JsonSubTypes.Type(value = MapRemoveByRankOperation.class, name = OperationTypes.MAP_REMOVE_BY_RANK), + @JsonSubTypes.Type( + value = MapRemoveByRankRangeOperation.class, + name = OperationTypes.MAP_REMOVE_BY_RANK_RANGE), + @JsonSubTypes.Type(value = MapRemoveByValueOperation.class, name = OperationTypes.MAP_REMOVE_BY_VALUE), + @JsonSubTypes.Type( + value = MapRemoveByValueRangeOperation.class, + name = OperationTypes.MAP_REMOVE_BY_VALUE_RANGE), + @JsonSubTypes.Type( + value = MapRemoveByValueListOperation.class, + name = OperationTypes.MAP_REMOVE_BY_VALUE_LIST), + @JsonSubTypes.Type( value = MapRemoveByKeyRelativeIndexRange.class, - name = OperationTypes.MAP_REMOVE_BY_KEY_RELATIVE_INDEX_RANGE - ), @JsonSubTypes.Type( + name = OperationTypes.MAP_REMOVE_BY_KEY_RELATIVE_INDEX_RANGE), + @JsonSubTypes.Type( value = MapRemoveByValueRelativeRankRange.class, - name = OperationTypes.MAP_REMOVE_BY_VALUE_RELATIVE_RANK_RANGE - ), @JsonSubTypes.Type( - value = MapSetPolicyOperation.class, name = OperationTypes.MAP_SET_POLICY - ), @JsonSubTypes.Type( - value = MapSizeOperation.class, name = OperationTypes.MAP_SIZE - ), - } -) + name = OperationTypes.MAP_REMOVE_BY_VALUE_RELATIVE_RANK_RANGE), + @JsonSubTypes.Type(value = MapSetPolicyOperation.class, name = OperationTypes.MAP_SET_POLICY), + @JsonSubTypes.Type(value = MapSizeOperation.class, name = OperationTypes.MAP_SIZE), +}) @Schema( - description = "The base type for describing all cdt map operations. Should not be used directly.", oneOf = { - - MapCreateOperation.class, - MapClearOperation.class, - MapGetByIndexOperation.class, - MapGetByIndexRangeOperation.class, - MapGetByKeyOperation.class, - MapGetByKeyListOperation.class, - MapGetByKeyRangeOperation.class, - MapGetByRankOperation.class, - MapGetByRankRangeOperation.class, - MapGetByValueOperation.class, - MapGetByValueRangeOperation.class, - MapGetByValueListOperation.class, - MapGetByValueRelativeRankRangeOperation.class, - MapGetByKeyRelativeIndexRange.class, - MapIncrementOperation.class, - MapPutOperation.class, - MapPutItemsOperation.class, - MapRemoveByIndexOperation.class, - MapRemoveByIndexRangeOperation.class, - MapRemoveByKeyOperation.class, - MapRemoveByKeyRangeOperation.class, - MapRemoveByRankOperation.class, - MapRemoveByRankRangeOperation.class, - MapRemoveByValueOperation.class, - MapRemoveByValueRangeOperation.class, - MapRemoveByValueListOperation.class, - MapRemoveByValueRelativeRankRange.class, - MapSetPolicyOperation.class, - MapSizeOperation.class, -} + description = "The base type for describing all cdt map operations. Should not be used directly.", + oneOf = { + MapCreateOperation.class, + MapClearOperation.class, + MapGetByIndexOperation.class, + MapGetByIndexRangeOperation.class, + MapGetByKeyOperation.class, + MapGetByKeyListOperation.class, + MapGetByKeyRangeOperation.class, + MapGetByRankOperation.class, + MapGetByRankRangeOperation.class, + MapGetByValueOperation.class, + MapGetByValueRangeOperation.class, + MapGetByValueListOperation.class, + MapGetByValueRelativeRankRangeOperation.class, + MapGetByKeyRelativeIndexRange.class, + MapIncrementOperation.class, + MapPutOperation.class, + MapPutItemsOperation.class, + MapRemoveByIndexOperation.class, + MapRemoveByIndexRangeOperation.class, + MapRemoveByKeyOperation.class, + MapRemoveByKeyRangeOperation.class, + MapRemoveByRankOperation.class, + MapRemoveByRankRangeOperation.class, + MapRemoveByValueOperation.class, + MapRemoveByValueRangeOperation.class, + MapRemoveByValueListOperation.class, + MapRemoveByValueRelativeRankRange.class, + MapSetPolicyOperation.class, + MapSizeOperation.class, + } ) -abstract public class MapOperation extends Operation { +public abstract class MapOperation extends Operation { - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) protected String binName; protected List ctx; @JsonCreator - protected MapOperation(@JsonProperty(value = "binName", required = true) String binName) { + protected MapOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName + ) { this.binName = binName; } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapPolicy.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapPolicy.java index 46fdfbbd..70830123 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapPolicy.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapPolicy.java @@ -46,7 +46,7 @@ public void setWriteFlags(List writeFlags) { } public com.aerospike.client.cdt.MapPolicy toMapPolicy() { - if (order == null && (writeFlags == null || writeFlags.size() == 0)) { + if (order == null && (writeFlags == null || writeFlags.isEmpty())) { return com.aerospike.client.cdt.MapPolicy.Default; } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapPutItemsOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapPutItemsOperation.java index 1733b929..3d82689e 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapPutItemsOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapPutItemsOperation.java @@ -34,18 +34,21 @@ public class MapPutItemsOperation extends MapOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.MAP_PUT_ITEMS, - required = true, - allowableValues = OperationTypes.MAP_PUT_ITEMS + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.MAP_PUT_ITEMS} ) - final public static String type = OperationTypes.MAP_PUT_ITEMS; + public final String type = OperationTypes.MAP_PUT_ITEMS; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final Map map; private MapPolicy mapPolicy; @JsonCreator - public MapPutItemsOperation(@JsonProperty("binName") String binName, @JsonProperty("map") Map map) { + public MapPutItemsOperation( + @JsonProperty("binName") String binName, + @JsonProperty("map") Map map + ) { super(binName); this.map = map; } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapPutOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapPutOperation.java index 20305bec..17ae034a 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapPutOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapPutOperation.java @@ -31,23 +31,28 @@ public class MapPutOperation extends MapOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.MAP_PUT, - required = true, - allowableValues = OperationTypes.MAP_PUT + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.MAP_PUT} ) - final public static String type = OperationTypes.MAP_PUT; + public final String type = OperationTypes.MAP_PUT; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final Object key; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final Object value; private MapPolicy mapPolicy; @JsonCreator - public MapPutOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "key", required = true) Object key, - @JsonProperty(value = "value", required = true) Object value) { + public MapPutOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "key") + @Schema(name = "key", requiredMode = Schema.RequiredMode.REQUIRED) Object key, + @JsonProperty(value = "value") + @Schema(name = "value", requiredMode = Schema.RequiredMode.REQUIRED) Object value + ) { super(binName); this.key = key; this.value = value; @@ -72,6 +77,7 @@ public com.aerospike.client.Operation toOperation() { asMapPolicy = mapPolicy.toMapPolicy(); } - return com.aerospike.client.cdt.MapOperation.put(asMapPolicy, binName, Value.get(key), Value.get(value), asCTX); + return com.aerospike.client.cdt.MapOperation.put(asMapPolicy, binName, + Value.get(key), Value.get(value), asCTX); } } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByIndexOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByIndexOperation.java index bf4091ab..3ff246a7 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByIndexOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByIndexOperation.java @@ -30,24 +30,27 @@ public class MapRemoveByIndexOperation extends MapOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.MAP_REMOVE_BY_INDEX, - required = true, - allowableValues = OperationTypes.MAP_REMOVE_BY_INDEX + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.MAP_REMOVE_BY_INDEX} ) - final public static String type = OperationTypes.MAP_REMOVE_BY_INDEX; + public final String type = OperationTypes.MAP_REMOVE_BY_INDEX; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int index; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final MapReturnType mapReturnType; private boolean inverted; @JsonCreator - public MapRemoveByIndexOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "index", required = true) int index, @JsonProperty( - value = "mapReturnType", required = true - ) MapReturnType mapReturnType) { + public MapRemoveByIndexOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "index") + @Schema(name = "index", requiredMode = Schema.RequiredMode.REQUIRED) int index, + @JsonProperty(value = "mapReturnType", required = true) MapReturnType mapReturnType + ) { super(binName); this.index = index; this.mapReturnType = mapReturnType; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByIndexRangeOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByIndexRangeOperation.java index e7d17b67..b923461d 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByIndexRangeOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByIndexRangeOperation.java @@ -30,15 +30,15 @@ public class MapRemoveByIndexRangeOperation extends MapOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.MAP_REMOVE_BY_INDEX_RANGE, - required = true, - allowableValues = OperationTypes.MAP_REMOVE_BY_INDEX_RANGE + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.MAP_REMOVE_BY_INDEX_RANGE} ) - final public static String type = OperationTypes.MAP_REMOVE_BY_INDEX_RANGE; + public final String type = OperationTypes.MAP_REMOVE_BY_INDEX_RANGE; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int index; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final MapReturnType mapReturnType; private boolean inverted; @@ -46,10 +46,14 @@ public class MapRemoveByIndexRangeOperation extends MapOperation { private Integer count; @JsonCreator - public MapRemoveByIndexRangeOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "index", required = true) int index, @JsonProperty( - value = "mapReturnType", required = true - ) MapReturnType mapReturnType) { + public MapRemoveByIndexRangeOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "index") + @Schema(name = "index", requiredMode = Schema.RequiredMode.REQUIRED) int index, + @JsonProperty(value = "mapReturnType") + @Schema(name = "mapReturnType", requiredMode = Schema.RequiredMode.REQUIRED) MapReturnType mapReturnType + ) { super(binName); this.index = index; this.mapReturnType = mapReturnType; @@ -77,9 +81,11 @@ public com.aerospike.client.Operation toOperation() { int intMapReturnType = mapReturnType.toMapReturnType(inverted); if (count == null) { - return com.aerospike.client.cdt.MapOperation.removeByIndexRange(binName, index, intMapReturnType, asCTX); + return com.aerospike.client.cdt.MapOperation.removeByIndexRange(binName, + index, intMapReturnType, asCTX); } - return com.aerospike.client.cdt.MapOperation.removeByIndexRange(binName, index, count, intMapReturnType, asCTX); + return com.aerospike.client.cdt.MapOperation.removeByIndexRange(binName, + index, count, intMapReturnType, asCTX); } } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByKeyOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByKeyOperation.java index c3c9f94f..921cab1c 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByKeyOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByKeyOperation.java @@ -31,24 +31,27 @@ public class MapRemoveByKeyOperation extends MapOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.MAP_REMOVE_BY_KEY, - required = true, - allowableValues = OperationTypes.MAP_REMOVE_BY_KEY + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.MAP_REMOVE_BY_KEY} ) - final public static String type = OperationTypes.MAP_REMOVE_BY_KEY; + public final String type = OperationTypes.MAP_REMOVE_BY_KEY; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final Object key; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final MapReturnType mapReturnType; private boolean inverted = false; @JsonCreator - public MapRemoveByKeyOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "key", required = true) Object key, @JsonProperty( - value = "mapReturnType", required = true - ) MapReturnType mapReturnType) { + public MapRemoveByKeyOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "key") + @Schema(name = "key", requiredMode = Schema.RequiredMode.REQUIRED) Object key, + @JsonProperty(value = "mapReturnType", required = true) MapReturnType mapReturnType + ) { super(binName); this.key = key; this.mapReturnType = mapReturnType; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByKeyRangeOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByKeyRangeOperation.java index 0eacbe7f..890d2ece 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByKeyRangeOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByKeyRangeOperation.java @@ -31,12 +31,12 @@ public class MapRemoveByKeyRangeOperation extends MapOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.MAP_REMOVE_BY_KEY_RANGE, - required = true, - allowableValues = OperationTypes.MAP_REMOVE_BY_KEY_RANGE + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.MAP_REMOVE_BY_KEY_RANGE} ) - final public static String type = OperationTypes.MAP_REMOVE_BY_KEY_RANGE; + public final String type = OperationTypes.MAP_REMOVE_BY_KEY_RANGE; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final MapReturnType mapReturnType; private boolean inverted; @@ -46,9 +46,11 @@ public class MapRemoveByKeyRangeOperation extends MapOperation { private Object keyEnd; @JsonCreator - public MapRemoveByKeyRangeOperation(@JsonProperty(value = "binName", required = true) String binName, @JsonProperty( - value = "mapReturnType", required = true - ) MapReturnType mapReturnType) { + public MapRemoveByKeyRangeOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "mapReturnType", required = true) MapReturnType mapReturnType + ) { super(binName); this.mapReturnType = mapReturnType; inverted = false; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByKeyRelativeIndexRange.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByKeyRelativeIndexRange.java index e37800f1..57246bdc 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByKeyRelativeIndexRange.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByKeyRelativeIndexRange.java @@ -31,18 +31,18 @@ public class MapRemoveByKeyRelativeIndexRange extends MapOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.MAP_REMOVE_BY_KEY_RELATIVE_INDEX_RANGE, - required = true, - allowableValues = OperationTypes.MAP_REMOVE_BY_KEY_RELATIVE_INDEX_RANGE + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.MAP_REMOVE_BY_KEY_RELATIVE_INDEX_RANGE} ) - final public static String type = OperationTypes.MAP_REMOVE_BY_KEY_RELATIVE_INDEX_RANGE; + public final String type = OperationTypes.MAP_REMOVE_BY_KEY_RELATIVE_INDEX_RANGE; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int index; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final Object value; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final MapReturnType mapReturnType; private boolean inverted; @@ -50,11 +50,15 @@ public class MapRemoveByKeyRelativeIndexRange extends MapOperation { private Integer count; @JsonCreator - public MapRemoveByKeyRelativeIndexRange(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "index", required = true) int index, - @JsonProperty(value = "value", required = true) Object value, @JsonProperty( - value = "mapReturnType", required = true - ) MapReturnType mapReturnType) { + public MapRemoveByKeyRelativeIndexRange( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "index") + @Schema(name = "index", requiredMode = Schema.RequiredMode.REQUIRED) int index, + @JsonProperty(value = "value") + @Schema(name = "value", requiredMode = Schema.RequiredMode.REQUIRED) Object value, + @JsonProperty(value = "mapReturnType", required = true) MapReturnType mapReturnType + ) { super(binName); this.index = index; this.value = value; @@ -84,11 +88,11 @@ public com.aerospike.client.Operation toOperation() { int intMapReturnType = mapReturnType.toMapReturnType(inverted); if (count == null) { - return com.aerospike.client.cdt.MapOperation.removeByKeyRelativeIndexRange(binName, Value.get(value), index, - intMapReturnType, asCTX); + return com.aerospike.client.cdt.MapOperation.removeByKeyRelativeIndexRange(binName, + Value.get(value), index, intMapReturnType, asCTX); } - return com.aerospike.client.cdt.MapOperation.removeByKeyRelativeIndexRange(binName, Value.get(value), index, - count, intMapReturnType, asCTX); + return com.aerospike.client.cdt.MapOperation.removeByKeyRelativeIndexRange(binName, + Value.get(value), index, count, intMapReturnType, asCTX); } } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByRankOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByRankOperation.java index a8fdc886..e79d5b4d 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByRankOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByRankOperation.java @@ -30,24 +30,27 @@ public class MapRemoveByRankOperation extends MapOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.MAP_REMOVE_BY_RANK, - required = true, - allowableValues = OperationTypes.MAP_REMOVE_BY_RANK + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.MAP_REMOVE_BY_RANK} ) - final public static String type = OperationTypes.MAP_REMOVE_BY_RANK; + public final String type = OperationTypes.MAP_REMOVE_BY_RANK; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int rank; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final MapReturnType mapReturnType; private boolean inverted; @JsonCreator - public MapRemoveByRankOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "rank", required = true) int rank, @JsonProperty( - value = "mapReturnType", required = true - ) MapReturnType mapReturnType) { + public MapRemoveByRankOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "rank") + @Schema(name = "rank", requiredMode = Schema.RequiredMode.REQUIRED) int rank, + @JsonProperty(value = "mapReturnType", required = true) MapReturnType mapReturnType + ) { super(binName); this.rank = rank; this.mapReturnType = mapReturnType; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByRankRangeOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByRankRangeOperation.java index 81f2d5a3..c3c95483 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByRankRangeOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByRankRangeOperation.java @@ -30,15 +30,15 @@ public class MapRemoveByRankRangeOperation extends MapOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.MAP_REMOVE_BY_RANK_RANGE, - required = true, - allowableValues = OperationTypes.MAP_REMOVE_BY_RANK_RANGE + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.MAP_REMOVE_BY_RANK_RANGE} ) - final public static String type = OperationTypes.MAP_REMOVE_BY_RANK_RANGE; + public final String type = OperationTypes.MAP_REMOVE_BY_RANK_RANGE; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int rank; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final MapReturnType mapReturnType; private boolean inverted = false; @@ -46,10 +46,13 @@ public class MapRemoveByRankRangeOperation extends MapOperation { private Integer count; @JsonCreator - public MapRemoveByRankRangeOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "rank", required = true) int rank, @JsonProperty( - value = "mapReturnType", required = true - ) MapReturnType mapReturnType) { + public MapRemoveByRankRangeOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "rank") + @Schema(name = "rank", requiredMode = Schema.RequiredMode.REQUIRED) int rank, + @JsonProperty(value = "mapReturnType", required = true) MapReturnType mapReturnType + ) { super(binName); this.rank = rank; this.mapReturnType = mapReturnType; @@ -77,9 +80,11 @@ public com.aerospike.client.Operation toOperation() { int inMapReturnType = mapReturnType.toMapReturnType(inverted); if (count == null) { - return com.aerospike.client.cdt.MapOperation.removeByRankRange(binName, rank, inMapReturnType, asCTX); + return com.aerospike.client.cdt.MapOperation.removeByRankRange(binName, + rank, inMapReturnType, asCTX); } - return com.aerospike.client.cdt.MapOperation.removeByRankRange(binName, rank, count, inMapReturnType, asCTX); + return com.aerospike.client.cdt.MapOperation.removeByRankRange(binName, + rank, count, inMapReturnType, asCTX); } } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByValueListOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByValueListOperation.java index e8fedaed..e4f0c7f8 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByValueListOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByValueListOperation.java @@ -33,23 +33,25 @@ public class MapRemoveByValueListOperation extends MapOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.MAP_REMOVE_BY_VALUE_LIST, - required = true, - allowableValues = OperationTypes.MAP_REMOVE_BY_VALUE_LIST + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.MAP_REMOVE_BY_VALUE_LIST} ) - final public static String type = OperationTypes.MAP_REMOVE_BY_VALUE_LIST; + public final String type = OperationTypes.MAP_REMOVE_BY_VALUE_LIST; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final List values; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final MapReturnType mapReturnType; private boolean inverted; @JsonCreator - public MapRemoveByValueListOperation(@JsonProperty("binName") String binName, - @JsonProperty("values") List values, - @JsonProperty("mapReturnType") MapReturnType mapReturnType) { + public MapRemoveByValueListOperation( + @JsonProperty("binName") String binName, + @JsonProperty("values") List values, + @JsonProperty("mapReturnType") MapReturnType mapReturnType + ) { super(binName); this.values = values; this.mapReturnType = mapReturnType; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByValueOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByValueOperation.java index 2d4d6dfc..1782335a 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByValueOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByValueOperation.java @@ -31,24 +31,27 @@ public class MapRemoveByValueOperation extends MapOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.MAP_REMOVE_BY_VALUE, - required = true, - allowableValues = OperationTypes.MAP_REMOVE_BY_VALUE + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.MAP_REMOVE_BY_VALUE} ) - final public static String type = OperationTypes.MAP_REMOVE_BY_VALUE; + public final String type = OperationTypes.MAP_REMOVE_BY_VALUE; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final Object value; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final MapReturnType mapReturnType; private boolean inverted = false; @JsonCreator - public MapRemoveByValueOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "value", required = true) Object value, @JsonProperty( - value = "mapReturnType", required = true - ) MapReturnType mapReturnType) { + public MapRemoveByValueOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "value") + @Schema(name = "value", requiredMode = Schema.RequiredMode.REQUIRED) Object value, + @JsonProperty(value = "mapReturnType", required = true) MapReturnType mapReturnType + ) { super(binName); this.value = value; this.mapReturnType = mapReturnType; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByValueRangeOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByValueRangeOperation.java index 12710be3..9046428d 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByValueRangeOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByValueRangeOperation.java @@ -31,12 +31,12 @@ public class MapRemoveByValueRangeOperation extends MapOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.MAP_REMOVE_BY_VALUE_RANGE, - required = true, - allowableValues = OperationTypes.MAP_REMOVE_BY_VALUE_RANGE + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.MAP_REMOVE_BY_VALUE_RANGE} ) - final public static String type = OperationTypes.MAP_REMOVE_BY_VALUE_RANGE; + public final String type = OperationTypes.MAP_REMOVE_BY_VALUE_RANGE; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final MapReturnType mapReturnType; private boolean inverted; @@ -46,10 +46,11 @@ public class MapRemoveByValueRangeOperation extends MapOperation { private Object valueEnd; @JsonCreator - public MapRemoveByValueRangeOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty( - value = "mapReturnType", required = true - ) MapReturnType mapReturnType) { + public MapRemoveByValueRangeOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "mapReturnType", required = true) MapReturnType mapReturnType + ) { super(binName); this.mapReturnType = mapReturnType; inverted = false; diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByValueRelativeRankRange.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByValueRelativeRankRange.java index 37ed4e29..4051c3a0 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByValueRelativeRankRange.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapRemoveByValueRelativeRankRange.java @@ -31,18 +31,18 @@ public class MapRemoveByValueRelativeRankRange extends MapOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.MAP_REMOVE_BY_VALUE_RELATIVE_RANK_RANGE, - required = true, - allowableValues = OperationTypes.MAP_REMOVE_BY_VALUE_RELATIVE_RANK_RANGE + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.MAP_REMOVE_BY_VALUE_RELATIVE_RANK_RANGE} ) - final public static String type = OperationTypes.MAP_REMOVE_BY_VALUE_RELATIVE_RANK_RANGE; + public final String type = OperationTypes.MAP_REMOVE_BY_VALUE_RELATIVE_RANK_RANGE; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final int rank; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final Object value; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final MapReturnType mapReturnType; private boolean inverted = false; @@ -50,12 +50,15 @@ public class MapRemoveByValueRelativeRankRange extends MapOperation { private Integer count; @JsonCreator - public MapRemoveByValueRelativeRankRange(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "rank", required = true) int rank, - @JsonProperty(value = "value", required = true) Object value, - @JsonProperty( - value = "mapReturnType", required = true - ) MapReturnType mapReturnType) { + public MapRemoveByValueRelativeRankRange( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "rank") + @Schema(name = "rank", requiredMode = Schema.RequiredMode.REQUIRED) int rank, + @JsonProperty(value = "value") + @Schema(name = "value", requiredMode = Schema.RequiredMode.REQUIRED) Object value, + @JsonProperty(value = "mapReturnType", required = true) MapReturnType mapReturnType + ) { super(binName); this.rank = rank; this.value = value; @@ -83,11 +86,11 @@ public com.aerospike.client.Operation toOperation() { com.aerospike.client.cdt.CTX[] asCTX = getASCTX(); if (count == null) { - return com.aerospike.client.cdt.MapOperation.removeByValueRelativeRankRange(binName, Value.get(value), rank, - mapReturnType.toMapReturnType(inverted), asCTX); + return com.aerospike.client.cdt.MapOperation.removeByValueRelativeRankRange(binName, + Value.get(value), rank, mapReturnType.toMapReturnType(inverted), asCTX); } - return com.aerospike.client.cdt.MapOperation.removeByValueRelativeRankRange(binName, Value.get(value), rank, - count, mapReturnType.toMapReturnType(inverted), asCTX); + return com.aerospike.client.cdt.MapOperation.removeByValueRelativeRankRange(binName, + Value.get(value), rank, count, mapReturnType.toMapReturnType(inverted), asCTX); } } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapSetPolicyOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapSetPolicyOperation.java index 195a9e0b..00b7e528 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapSetPolicyOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapSetPolicyOperation.java @@ -30,17 +30,20 @@ public class MapSetPolicyOperation extends MapOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.MAP_SET_POLICY, - required = true, - allowableValues = OperationTypes.MAP_SET_POLICY + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.MAP_SET_POLICY} ) - final public static String type = OperationTypes.MAP_SET_POLICY; + public final String type = OperationTypes.MAP_SET_POLICY; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final MapPolicy mapPolicy; @JsonCreator - public MapSetPolicyOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "mapPolicy", required = true) MapPolicy mapPolicy) { + public MapSetPolicyOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @Schema(name = "mapPolicy", requiredMode = Schema.RequiredMode.REQUIRED) MapPolicy mapPolicy + ) { super(binName); this.mapPolicy = mapPolicy; } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapSizeOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapSizeOperation.java index e5e0bfb7..7de2f4cf 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapSizeOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapSizeOperation.java @@ -30,13 +30,16 @@ public class MapSizeOperation extends MapOperation { @Schema( description = "The type of operation. It is always " + OperationTypes.MAP_SIZE, - required = true, - allowableValues = OperationTypes.MAP_SIZE + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.MAP_SIZE} ) - final public static String type = OperationTypes.MAP_SIZE; + public final String type = OperationTypes.MAP_SIZE; @JsonCreator - public MapSizeOperation(@JsonProperty(value = "binName", required = true) String binName) { + public MapSizeOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName + ) { super(binName); } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapWriteFlag.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapWriteFlag.java index 79ecccd6..93d940dd 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/MapWriteFlag.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/MapWriteFlag.java @@ -56,4 +56,3 @@ public enum MapWriteFlag { this.flag = flag; } } - diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/OperateResponseRecordBody.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/OperateResponseRecordBody.java index db3ac057..fbea2fd7 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/OperateResponseRecordBody.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/OperateResponseRecordBody.java @@ -17,4 +17,3 @@ public void setRecord(RestClientRecord record) { this.record = record; } } - diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/Operation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/Operation.java index 1095f9af..0cd74274 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/Operation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/Operation.java @@ -21,42 +21,24 @@ import io.swagger.v3.oas.annotations.media.Schema; @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") -@JsonSubTypes( - { - @JsonSubTypes.Type( - value = AddOperation.class, name = OperationTypes.ADD - ), @JsonSubTypes.Type( - value = PrependOperation.class, name = OperationTypes.PREPEND - ), @JsonSubTypes.Type( - value = AppendOperation.class, name = OperationTypes.APPEND - ), @JsonSubTypes.Type( - value = GetOperation.class, name = OperationTypes.GET - ), @JsonSubTypes.Type( - value = ReadOperation.class, name = OperationTypes.READ - ), @JsonSubTypes.Type( - value = GetHeaderOperation.class, name = OperationTypes.GET_HEADER - ), @JsonSubTypes.Type( - value = TouchOperation.class, name = OperationTypes.TOUCH - ), @JsonSubTypes.Type( - value = PutOperation.class, name = OperationTypes.PUT - ), @JsonSubTypes.Type( - value = DeleteOperation.class, name = OperationTypes.DELETE - ), @JsonSubTypes.Type( - value = ListOperation.class - ), @JsonSubTypes.Type( - value = MapOperation.class - ), @JsonSubTypes.Type( - value = BitOperation.class - ), @JsonSubTypes.Type( - value = HLLOperation.class - ), - } -) +@JsonSubTypes({ + @JsonSubTypes.Type(value = AddOperation.class, name = OperationTypes.ADD), + @JsonSubTypes.Type(value = PrependOperation.class, name = OperationTypes.PREPEND), + @JsonSubTypes.Type(value = AppendOperation.class, name = OperationTypes.APPEND), + @JsonSubTypes.Type(value = GetOperation.class, name = OperationTypes.GET), + @JsonSubTypes.Type(value = ReadOperation.class, name = OperationTypes.READ), + @JsonSubTypes.Type(value = GetHeaderOperation.class, name = OperationTypes.GET_HEADER), + @JsonSubTypes.Type(value = TouchOperation.class, name = OperationTypes.TOUCH), + @JsonSubTypes.Type(value = PutOperation.class, name = OperationTypes.PUT), + @JsonSubTypes.Type(value = DeleteOperation.class, name = OperationTypes.DELETE), + @JsonSubTypes.Type(value = ListOperation.class), + @JsonSubTypes.Type(value = MapOperation.class), + @JsonSubTypes.Type(value = BitOperation.class), + @JsonSubTypes.Type(value = HLLOperation.class), +}) @Schema( description = "The base type for describing all operations. Should not be used directly." ) -abstract public class Operation { - abstract public com.aerospike.client.Operation toOperation(); +public abstract class Operation { + public abstract com.aerospike.client.Operation toOperation(); } - - diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/PrependOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/PrependOperation.java index dfc4be05..ca455d52 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/PrependOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/PrependOperation.java @@ -31,20 +31,24 @@ public class PrependOperation extends Operation { @Schema( description = "The type of operation. It is always " + OperationTypes.PREPEND, - required = true, - allowableValues = OperationTypes.PREPEND + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.PREPEND} ) - final public static String type = OperationTypes.PREPEND; + public final String type = OperationTypes.PREPEND; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final String binName; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final String value; @JsonCreator - public PrependOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "value", required = true) String value) { + public PrependOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "value") + @Schema(name = "value", requiredMode = Schema.RequiredMode.REQUIRED) String value + ) { this.binName = binName; this.value = value; } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/PutOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/PutOperation.java index 135e5bde..b789b59c 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/PutOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/PutOperation.java @@ -32,20 +32,24 @@ public class PutOperation extends Operation { @Schema( description = "The type of operation. It is always " + OperationTypes.PUT, - required = true, - allowableValues = OperationTypes.PUT + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.PUT} ) - final public static String type = OperationTypes.PUT; + public final String type = OperationTypes.PUT; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final String binName; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final Object value; @JsonCreator - public PutOperation(@JsonProperty(value = "binName", required = true) String binName, - @JsonProperty(value = "value", required = true) Object value) { + public PutOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName, + @JsonProperty(value = "value") + @Schema(name = "value", requiredMode = Schema.RequiredMode.REQUIRED) Object value + ) { this.binName = binName; this.value = value; } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/ReadOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/ReadOperation.java index ac36af59..ceb01cd7 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/ReadOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/ReadOperation.java @@ -29,15 +29,18 @@ public class ReadOperation extends Operation { @Schema( description = "The type of operation. It is always " + OperationTypes.READ, - required = true, - allowableValues = OperationTypes.READ + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.READ} ) - final public static String type = OperationTypes.READ; + public final String type = OperationTypes.READ; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) private final String binName; - public ReadOperation(@JsonProperty(value = "binName", required = true) String binName) { + public ReadOperation( + @JsonProperty(value = "binName") + @Schema(name = "binName", requiredMode = Schema.RequiredMode.REQUIRED) String binName + ) { this.binName = binName; } diff --git a/src/main/java/com/aerospike/restclient/domain/operationmodels/TouchOperation.java b/src/main/java/com/aerospike/restclient/domain/operationmodels/TouchOperation.java index 140e713b..4ef59a93 100644 --- a/src/main/java/com/aerospike/restclient/domain/operationmodels/TouchOperation.java +++ b/src/main/java/com/aerospike/restclient/domain/operationmodels/TouchOperation.java @@ -28,10 +28,10 @@ public class TouchOperation extends Operation { @Schema( description = "The type of operation. It is always " + OperationTypes.TOUCH, - required = true, - allowableValues = OperationTypes.TOUCH + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {OperationTypes.TOUCH} ) - final public static String type = OperationTypes.TOUCH; + public final String type = OperationTypes.TOUCH; @Override public com.aerospike.client.Operation toOperation() { diff --git a/src/main/java/com/aerospike/restclient/domain/querymodels/QueryContainsLongFilter.java b/src/main/java/com/aerospike/restclient/domain/querymodels/QueryContainsLongFilter.java index 42012d40..7f074ff7 100644 --- a/src/main/java/com/aerospike/restclient/domain/querymodels/QueryContainsLongFilter.java +++ b/src/main/java/com/aerospike/restclient/domain/querymodels/QueryContainsLongFilter.java @@ -32,12 +32,11 @@ public class QueryContainsLongFilter extends QueryFilter { @Schema( description = "The type of query filter this object represents. It is always " + AerospikeAPIConstants.QueryFilterTypes.CONTAINS_LONG, - required = true, - allowableValues = AerospikeAPIConstants.QueryFilterTypes.CONTAINS_LONG + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {AerospikeAPIConstants.QueryFilterTypes.CONTAINS_LONG} ) - final public static String type = AerospikeAPIConstants.QueryFilterTypes.CONTAINS_LONG; - - @Schema(required = true) + public final String type = AerospikeAPIConstants.QueryFilterTypes.CONTAINS_LONG; + @JsonProperty(required = true) public Long value; diff --git a/src/main/java/com/aerospike/restclient/domain/querymodels/QueryContainsStringFilter.java b/src/main/java/com/aerospike/restclient/domain/querymodels/QueryContainsStringFilter.java index f66d10e3..140fc6c7 100644 --- a/src/main/java/com/aerospike/restclient/domain/querymodels/QueryContainsStringFilter.java +++ b/src/main/java/com/aerospike/restclient/domain/querymodels/QueryContainsStringFilter.java @@ -31,12 +31,12 @@ public class QueryContainsStringFilter extends QueryFilter { @Schema( description = "The type of query filter this object represents. It is always " + AerospikeAPIConstants.QueryFilterTypes.CONTAINS_STRING, - required = true, - allowableValues = AerospikeAPIConstants.QueryFilterTypes.CONTAINS_STRING + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {AerospikeAPIConstants.QueryFilterTypes.CONTAINS_STRING} ) - final public static String type = AerospikeAPIConstants.QueryFilterTypes.CONTAINS_STRING; + public final String type = AerospikeAPIConstants.QueryFilterTypes.CONTAINS_STRING; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) public String value; @ASRestClientSchemas.IndexCollectionType @@ -51,6 +51,3 @@ public Filter toFilter() { return Filter.contains(binName, collectionType, value, asCTX); } } - - - diff --git a/src/main/java/com/aerospike/restclient/domain/querymodels/QueryEqualLongFilter.java b/src/main/java/com/aerospike/restclient/domain/querymodels/QueryEqualLongFilter.java index 2dcbe6b8..5dde4992 100644 --- a/src/main/java/com/aerospike/restclient/domain/querymodels/QueryEqualLongFilter.java +++ b/src/main/java/com/aerospike/restclient/domain/querymodels/QueryEqualLongFilter.java @@ -30,12 +30,12 @@ public class QueryEqualLongFilter extends QueryFilter { @Schema( description = "The type of query filter this object represents. It is always " + AerospikeAPIConstants.QueryFilterTypes.EQUAL_LONG, - required = true, - allowableValues = AerospikeAPIConstants.QueryFilterTypes.EQUAL_LONG + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {AerospikeAPIConstants.QueryFilterTypes.EQUAL_LONG} ) - final public static String type = AerospikeAPIConstants.QueryFilterTypes.EQUAL_LONG; + public final String type = AerospikeAPIConstants.QueryFilterTypes.EQUAL_LONG; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) public Long value; public QueryEqualLongFilter() { @@ -47,4 +47,3 @@ public Filter toFilter() { return Filter.equal(binName, value, asCTX); } } - diff --git a/src/main/java/com/aerospike/restclient/domain/querymodels/QueryEqualsStringFilter.java b/src/main/java/com/aerospike/restclient/domain/querymodels/QueryEqualsStringFilter.java index 4c50e270..a9f8cf5c 100644 --- a/src/main/java/com/aerospike/restclient/domain/querymodels/QueryEqualsStringFilter.java +++ b/src/main/java/com/aerospike/restclient/domain/querymodels/QueryEqualsStringFilter.java @@ -29,12 +29,12 @@ public class QueryEqualsStringFilter extends QueryFilter { @Schema( description = "The type of query filter this object represents. It is always " + AerospikeAPIConstants.QueryFilterTypes.EQUAL_STRING, - required = true, - allowableValues = AerospikeAPIConstants.QueryFilterTypes.EQUAL_STRING + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {AerospikeAPIConstants.QueryFilterTypes.EQUAL_STRING} ) - final public static String type = AerospikeAPIConstants.QueryFilterTypes.EQUAL_STRING; + public final String type = AerospikeAPIConstants.QueryFilterTypes.EQUAL_STRING; - @Schema(required = true) + @Schema(requiredMode = Schema.RequiredMode.REQUIRED) public String value; public QueryEqualsStringFilter() { @@ -46,4 +46,3 @@ public Filter toFilter() { return Filter.equal(binName, value, asCTX); } } - diff --git a/src/main/java/com/aerospike/restclient/domain/querymodels/QueryFilter.java b/src/main/java/com/aerospike/restclient/domain/querymodels/QueryFilter.java index e7e96477..f578434c 100644 --- a/src/main/java/com/aerospike/restclient/domain/querymodels/QueryFilter.java +++ b/src/main/java/com/aerospike/restclient/domain/querymodels/QueryFilter.java @@ -28,38 +28,36 @@ import java.util.List; @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type") -@JsonSubTypes( - { - @JsonSubTypes.Type( - value = QueryEqualsStringFilter.class, - name = AerospikeAPIConstants.QueryFilterTypes.EQUAL_STRING - ), - @JsonSubTypes.Type( - value = QueryEqualLongFilter.class, name = AerospikeAPIConstants.QueryFilterTypes.EQUAL_LONG - ), - @JsonSubTypes.Type(value = QueryRangeFilter.class, name = AerospikeAPIConstants.QueryFilterTypes.RANGE), - @JsonSubTypes.Type( - value = QueryContainsStringFilter.class, - name = AerospikeAPIConstants.QueryFilterTypes.CONTAINS_STRING - ), - @JsonSubTypes.Type( - value = QueryContainsLongFilter.class, - name = AerospikeAPIConstants.QueryFilterTypes.CONTAINS_LONG - ), - @JsonSubTypes.Type( - value = QueryGeoWithinPolygonFilter.class, - name = AerospikeAPIConstants.QueryFilterTypes.GEOWITHIN_REGION - ), - @JsonSubTypes.Type( - value = QueryGeoWithinRadiusFilter.class, - name = AerospikeAPIConstants.QueryFilterTypes.GEOWITHIN_RADIUS - ), - @JsonSubTypes.Type( - value = QueryGeoContainsPointFilter.class, - name = AerospikeAPIConstants.QueryFilterTypes.GEOCONTAINS_POINT - ), - } -) +@JsonSubTypes({ + @JsonSubTypes.Type( + value = QueryEqualsStringFilter.class, + name = AerospikeAPIConstants.QueryFilterTypes.EQUAL_STRING + ), + @JsonSubTypes.Type( + value = QueryEqualLongFilter.class, name = AerospikeAPIConstants.QueryFilterTypes.EQUAL_LONG + ), + @JsonSubTypes.Type(value = QueryRangeFilter.class, name = AerospikeAPIConstants.QueryFilterTypes.RANGE), + @JsonSubTypes.Type( + value = QueryContainsStringFilter.class, + name = AerospikeAPIConstants.QueryFilterTypes.CONTAINS_STRING + ), + @JsonSubTypes.Type( + value = QueryContainsLongFilter.class, + name = AerospikeAPIConstants.QueryFilterTypes.CONTAINS_LONG + ), + @JsonSubTypes.Type( + value = QueryGeoWithinPolygonFilter.class, + name = AerospikeAPIConstants.QueryFilterTypes.GEOWITHIN_REGION + ), + @JsonSubTypes.Type( + value = QueryGeoWithinRadiusFilter.class, + name = AerospikeAPIConstants.QueryFilterTypes.GEOWITHIN_RADIUS + ), + @JsonSubTypes.Type( + value = QueryGeoContainsPointFilter.class, + name = AerospikeAPIConstants.QueryFilterTypes.GEOCONTAINS_POINT + ), +}) @Schema( description = "QueryFilter base type. Only allowed on bin which has a secondary index defined.", oneOf = { @@ -74,8 +72,8 @@ }, externalDocs = @ExternalDocumentation(url = "https://javadoc.io/doc/com.aerospike/aerospike-client/" + AerospikeAPIConstants.AS_CLIENT_VERSION + "/com/aerospike/client/query/Filter.html") ) -abstract public class QueryFilter { - @Schema(description = "The bin for which a secondary-index is defined.", required = true) +public abstract class QueryFilter { + @Schema(description = "The bin for which a secondary-index is defined.", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty(required = true) public String binName; @@ -85,7 +83,7 @@ abstract public class QueryFilter { ) public List ctx; - abstract public Filter toFilter(); + public abstract Filter toFilter(); protected com.aerospike.client.cdt.CTX[] getCTXArray() { com.aerospike.client.cdt.CTX[] asCTX = null; @@ -97,4 +95,3 @@ protected com.aerospike.client.cdt.CTX[] getCTXArray() { return asCTX; } } - diff --git a/src/main/java/com/aerospike/restclient/domain/querymodels/QueryGeoContainsPointFilter.java b/src/main/java/com/aerospike/restclient/domain/querymodels/QueryGeoContainsPointFilter.java index 621af1c9..9535932b 100644 --- a/src/main/java/com/aerospike/restclient/domain/querymodels/QueryGeoContainsPointFilter.java +++ b/src/main/java/com/aerospike/restclient/domain/querymodels/QueryGeoContainsPointFilter.java @@ -32,12 +32,12 @@ public class QueryGeoContainsPointFilter extends QueryFilter { @Schema( description = "The type of query filter this object represents. It is always " + AerospikeAPIConstants.QueryFilterTypes.GEOCONTAINS_POINT, - required = true, - allowableValues = AerospikeAPIConstants.QueryFilterTypes.GEOCONTAINS_POINT + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {AerospikeAPIConstants.QueryFilterTypes.GEOCONTAINS_POINT} ) - final public static String type = AerospikeAPIConstants.QueryFilterTypes.GEOCONTAINS_POINT; + public final String type = AerospikeAPIConstants.QueryFilterTypes.GEOCONTAINS_POINT; - @Schema(description = "Longitude and Latitude of a point", required = true) + @Schema(description = "Longitude and Latitude of a point", requiredMode = Schema.RequiredMode.REQUIRED) public LngLat point; @ASRestClientSchemas.IndexCollectionType diff --git a/src/main/java/com/aerospike/restclient/domain/querymodels/QueryGeoWithinPolygonFilter.java b/src/main/java/com/aerospike/restclient/domain/querymodels/QueryGeoWithinPolygonFilter.java index 2352d102..1704f714 100644 --- a/src/main/java/com/aerospike/restclient/domain/querymodels/QueryGeoWithinPolygonFilter.java +++ b/src/main/java/com/aerospike/restclient/domain/querymodels/QueryGeoWithinPolygonFilter.java @@ -34,12 +34,12 @@ public class QueryGeoWithinPolygonFilter extends QueryFilter { @Schema( description = "The type of query filter this object represents. It is always " + AerospikeAPIConstants.QueryFilterTypes.GEOWITHIN_REGION, - required = true, + requiredMode = Schema.RequiredMode.REQUIRED, allowableValues = {AerospikeAPIConstants.QueryFilterTypes.GEOWITHIN_REGION} ) - final public static String type = AerospikeAPIConstants.QueryFilterTypes.GEOWITHIN_REGION; + public final String type = AerospikeAPIConstants.QueryFilterTypes.GEOWITHIN_REGION; - @Schema(description = "Array of longitude and latitude describing a region.", required = true) + @Schema(description = "Array of longitude and latitude describing a region.", requiredMode = Schema.RequiredMode.REQUIRED) public List polygon; @ASRestClientSchemas.IndexCollectionType @@ -54,5 +54,3 @@ public Filter toFilter() { getCTXArray()); } } - - diff --git a/src/main/java/com/aerospike/restclient/domain/querymodels/QueryGeoWithinRadiusFilter.java b/src/main/java/com/aerospike/restclient/domain/querymodels/QueryGeoWithinRadiusFilter.java index 10b9a845..4e6fddef 100644 --- a/src/main/java/com/aerospike/restclient/domain/querymodels/QueryGeoWithinRadiusFilter.java +++ b/src/main/java/com/aerospike/restclient/domain/querymodels/QueryGeoWithinRadiusFilter.java @@ -31,12 +31,12 @@ public class QueryGeoWithinRadiusFilter extends QueryFilter { @Schema( description = "The type of query filter this object represents. It is always " + AerospikeAPIConstants.QueryFilterTypes.GEOWITHIN_RADIUS, - required = true, - allowableValues = AerospikeAPIConstants.QueryFilterTypes.GEOWITHIN_RADIUS + requiredMode = Schema.RequiredMode.REQUIRED, + allowableValues = {AerospikeAPIConstants.QueryFilterTypes.GEOWITHIN_RADIUS} ) - final public static String type = AerospikeAPIConstants.QueryFilterTypes.GEOWITHIN_RADIUS; + public final String type = AerospikeAPIConstants.QueryFilterTypes.GEOWITHIN_RADIUS; - @Schema(description = "Array of longitude, latitude, and radius describing a circle.", required = true) + @Schema(description = "Array of longitude, latitude, and radius describing a circle.", requiredMode = Schema.RequiredMode.REQUIRED) public LngLatRad circle; @ASRestClientSchemas.IndexCollectionType @@ -51,4 +51,3 @@ public Filter toFilter() { circle.radius, getCTXArray()); } } - diff --git a/src/main/java/com/aerospike/restclient/domain/querymodels/QueryRangeFilter.java b/src/main/java/com/aerospike/restclient/domain/querymodels/QueryRangeFilter.java index d717e434..d055685a 100644 --- a/src/main/java/com/aerospike/restclient/domain/querymodels/QueryRangeFilter.java +++ b/src/main/java/com/aerospike/restclient/domain/querymodels/QueryRangeFilter.java @@ -31,14 +31,14 @@ public class QueryRangeFilter extends QueryFilter { @Schema( description = "The type of query filter this object represents. It is always " + AerospikeAPIConstants.QueryFilterTypes.RANGE, - required = true, - allowableValues = AerospikeAPIConstants.QueryFilterTypes.RANGE + allowableValues = {AerospikeAPIConstants.QueryFilterTypes.RANGE} ) - final public static String type = AerospikeAPIConstants.QueryFilterTypes.RANGE; - @Schema(description = "Filter begin value inclusive.", required = true) + public final String type = AerospikeAPIConstants.QueryFilterTypes.RANGE; + + @Schema(description = "Filter begin value inclusive.", requiredMode = Schema.RequiredMode.REQUIRED) public long begin; - @Schema(description = "Filter end value inclusive.", required = true) + @Schema(description = "Filter end value inclusive.", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty(required = true) public long end; @@ -53,4 +53,3 @@ public Filter toFilter() { return Filter.range(binName, collectionType, begin, end, getCTXArray()); } } - diff --git a/src/main/java/com/aerospike/restclient/domain/querymodels/QueryResponseBody.java b/src/main/java/com/aerospike/restclient/domain/querymodels/QueryResponseBody.java index c03ad543..9ebd4b48 100644 --- a/src/main/java/com/aerospike/restclient/domain/querymodels/QueryResponseBody.java +++ b/src/main/java/com/aerospike/restclient/domain/querymodels/QueryResponseBody.java @@ -27,7 +27,7 @@ @Schema(description = "Body of query response.") public class QueryResponseBody { - @Schema(description = "Records returned from query.", required = true) + @Schema(description = "Records returned from query.", requiredMode = Schema.RequiredMode.REQUIRED) @JsonProperty(required = true) private final List records; diff --git a/src/main/java/com/aerospike/restclient/util/annotations/ASRestClientOperateReadQueryParams.java b/src/main/java/com/aerospike/restclient/util/annotations/ASRestClientOperateReadQueryParams.java index 46d76351..54a37652 100644 --- a/src/main/java/com/aerospike/restclient/util/annotations/ASRestClientOperateReadQueryParams.java +++ b/src/main/java/com/aerospike/restclient/util/annotations/ASRestClientOperateReadQueryParams.java @@ -54,7 +54,7 @@ ), @Parameter( name = AerospikeAPIConstants.RECORD_KEY, description = APIDescriptors.RECORD_KEY_NOTES, - array = @ArraySchema(schema = @Schema(type = "string", required = true)), + array = @ArraySchema(schema = @Schema(type = "string", requiredMode = Schema.RequiredMode.REQUIRED)), required = true, in = ParameterIn.QUERY ) diff --git a/src/main/java/com/aerospike/restclient/util/annotations/ASRestDocumentPolicyQueryParams.java b/src/main/java/com/aerospike/restclient/util/annotations/ASRestDocumentPolicyQueryParams.java index 959b443b..ad4608fc 100644 --- a/src/main/java/com/aerospike/restclient/util/annotations/ASRestDocumentPolicyQueryParams.java +++ b/src/main/java/com/aerospike/restclient/util/annotations/ASRestDocumentPolicyQueryParams.java @@ -35,13 +35,13 @@ @Parameter( name = AerospikeAPIConstants.JSON_PATH, description = APIDescriptors.JSON_PATH_NOTES, - schema = @Schema(type = "string", required = true), + schema = @Schema(type = "string", requiredMode = Schema.RequiredMode.REQUIRED), required = true, in = ParameterIn.QUERY ), @Parameter( name = AerospikeAPIConstants.RECORD_BINS, description = APIDescriptors.JSON_PATH_BINS_NOTES, - array = @ArraySchema(schema = @Schema(type = "string", required = true)), + array = @ArraySchema(schema = @Schema(type = "string", requiredMode = Schema.RequiredMode.REQUIRED)), required = true, in = ParameterIn.QUERY ), diff --git a/src/main/java/com/aerospike/restclient/util/annotations/ASRestDocumentWritePolicyQueryParams.java b/src/main/java/com/aerospike/restclient/util/annotations/ASRestDocumentWritePolicyQueryParams.java index 758addb9..58bc9b9d 100644 --- a/src/main/java/com/aerospike/restclient/util/annotations/ASRestDocumentWritePolicyQueryParams.java +++ b/src/main/java/com/aerospike/restclient/util/annotations/ASRestDocumentWritePolicyQueryParams.java @@ -38,13 +38,13 @@ @Parameter( name = AerospikeAPIConstants.JSON_PATH, description = APIDescriptors.JSON_PATH_NOTES, - schema = @Schema(type = "string", required = true), + schema = @Schema(type = "string", requiredMode = Schema.RequiredMode.REQUIRED), required = true, in = ParameterIn.QUERY ), @Parameter( name = AerospikeAPIConstants.RECORD_BINS, description = APIDescriptors.JSON_PATH_BINS_NOTES, - array = @ArraySchema(schema = @Schema(type = "string", required = true)), + array = @ArraySchema(schema = @Schema(type = "string", requiredMode = Schema.RequiredMode.REQUIRED)), required = true, in = ParameterIn.QUERY ),