From f3a5d9952e4ee1d450549c7a3e4fe76fd6c5998e Mon Sep 17 00:00:00 2001 From: Otavio Santana Date: Sat, 11 Nov 2023 07:31:21 +0000 Subject: [PATCH] refactor: update exploring pattern Signed-off-by: Otavio Santana --- .../jnosql/communication/column/DefaultColumnDeleteQuery.java | 3 +-- .../jnosql/communication/column/DefaultColumnQuery.java | 3 +-- .../java/org/eclipse/jnosql/communication/DefaultValue.java | 3 +-- .../communication/document/DefaultDocumentDeleteQuery.java | 3 +-- .../jnosql/communication/document/DefaultDocumentQuery.java | 3 +-- .../eclipse/jnosql/communication/document/DocumentEntity.java | 3 +-- .../jnosql/communication/query/ConditionQueryValue.java | 3 +-- .../jnosql/communication/query/DefaultArrayQueryValue.java | 3 +-- .../eclipse/jnosql/communication/query/DefaultFunction.java | 3 +-- .../eclipse/jnosql/communication/query/DefaultQueryValue.java | 3 +-- .../eclipse/jnosql/communication/query/DefaultSelectQuery.java | 3 +-- .../org/eclipse/jnosql/communication/query/DeleteQuery.java | 3 +-- .../eclipse/jnosql/communication/query/FunctionQueryValue.java | 3 +-- .../java/org/eclipse/jnosql/communication/query/GetQuery.java | 3 +-- .../org/eclipse/jnosql/communication/query/InsertQuery.java | 3 +-- .../eclipse/jnosql/communication/query/NumberQueryValue.java | 3 +-- .../eclipse/jnosql/communication/query/StringQueryValue.java | 3 +-- .../org/eclipse/jnosql/communication/query/UpdateQuery.java | 3 +-- .../java/org/eclipse/jnosql/communication/query/Where.java | 3 +-- .../jnosql/communication/query/method/MethodArrayValue.java | 3 +-- .../communication/query/method/MethodParamQueryValue.java | 3 +-- 21 files changed, 21 insertions(+), 42 deletions(-) diff --git a/jnosql-communication/jnosql-communication-column/src/main/java/org/eclipse/jnosql/communication/column/DefaultColumnDeleteQuery.java b/jnosql-communication/jnosql-communication-column/src/main/java/org/eclipse/jnosql/communication/column/DefaultColumnDeleteQuery.java index 2fc2a1023..7467130df 100644 --- a/jnosql-communication/jnosql-communication-column/src/main/java/org/eclipse/jnosql/communication/column/DefaultColumnDeleteQuery.java +++ b/jnosql-communication/jnosql-communication-column/src/main/java/org/eclipse/jnosql/communication/column/DefaultColumnDeleteQuery.java @@ -62,10 +62,9 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (!(o instanceof ColumnDeleteQuery)) { + if (!(o instanceof ColumnDeleteQuery that)) { return false; } - ColumnDeleteQuery that = (ColumnDeleteQuery) o; return Objects.equals(columnFamily, that.name()) && Objects.equals(condition, that.condition().orElse(null)) && Objects.equals(columns, that.columns()); diff --git a/jnosql-communication/jnosql-communication-column/src/main/java/org/eclipse/jnosql/communication/column/DefaultColumnQuery.java b/jnosql-communication/jnosql-communication-column/src/main/java/org/eclipse/jnosql/communication/column/DefaultColumnQuery.java index 3b595d3f3..008a71cfd 100644 --- a/jnosql-communication/jnosql-communication-column/src/main/java/org/eclipse/jnosql/communication/column/DefaultColumnQuery.java +++ b/jnosql-communication/jnosql-communication-column/src/main/java/org/eclipse/jnosql/communication/column/DefaultColumnQuery.java @@ -91,10 +91,9 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (!(o instanceof ColumnQuery)) { + if (!(o instanceof ColumnQuery that)) { return false; } - ColumnQuery that = (ColumnQuery) o; return maxResults == that.limit() && firstResult == that.skip() && Objects.equals(columnFamily, that.name()) && diff --git a/jnosql-communication/jnosql-communication-core/src/main/java/org/eclipse/jnosql/communication/DefaultValue.java b/jnosql-communication/jnosql-communication-core/src/main/java/org/eclipse/jnosql/communication/DefaultValue.java index a995a98c0..454077481 100644 --- a/jnosql-communication/jnosql-communication-core/src/main/java/org/eclipse/jnosql/communication/DefaultValue.java +++ b/jnosql-communication/jnosql-communication-core/src/main/java/org/eclipse/jnosql/communication/DefaultValue.java @@ -66,10 +66,9 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (!(o instanceof Value)) { + if (!(o instanceof Value that)) { return false; } - Value that = (Value) o; return Objects.equals(value, that.get()); } diff --git a/jnosql-communication/jnosql-communication-document/src/main/java/org/eclipse/jnosql/communication/document/DefaultDocumentDeleteQuery.java b/jnosql-communication/jnosql-communication-document/src/main/java/org/eclipse/jnosql/communication/document/DefaultDocumentDeleteQuery.java index 0fc1bc992..d1936c468 100644 --- a/jnosql-communication/jnosql-communication-document/src/main/java/org/eclipse/jnosql/communication/document/DefaultDocumentDeleteQuery.java +++ b/jnosql-communication/jnosql-communication-document/src/main/java/org/eclipse/jnosql/communication/document/DefaultDocumentDeleteQuery.java @@ -62,10 +62,9 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (!(o instanceof DocumentDeleteQuery)) { + if (!(o instanceof DocumentDeleteQuery that)) { return false; } - DocumentDeleteQuery that = (DocumentDeleteQuery) o; return Objects.equals(documentCollection, that.name()) && Objects.equals(condition, that.condition().orElse(null)) && Objects.equals(documents, that.documents()); diff --git a/jnosql-communication/jnosql-communication-document/src/main/java/org/eclipse/jnosql/communication/document/DefaultDocumentQuery.java b/jnosql-communication/jnosql-communication-document/src/main/java/org/eclipse/jnosql/communication/document/DefaultDocumentQuery.java index 5d0db8cdb..64b776559 100644 --- a/jnosql-communication/jnosql-communication-document/src/main/java/org/eclipse/jnosql/communication/document/DefaultDocumentQuery.java +++ b/jnosql-communication/jnosql-communication-document/src/main/java/org/eclipse/jnosql/communication/document/DefaultDocumentQuery.java @@ -87,10 +87,9 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (!(o instanceof DocumentQuery)) { + if (!(o instanceof DocumentQuery that)) { return false; } - DocumentQuery that = (DocumentQuery) o; return limit == that.limit() && skip == that.skip() && Objects.equals(documentCollection, that.name()) && diff --git a/jnosql-communication/jnosql-communication-document/src/main/java/org/eclipse/jnosql/communication/document/DocumentEntity.java b/jnosql-communication/jnosql-communication-document/src/main/java/org/eclipse/jnosql/communication/document/DocumentEntity.java index cf10e97a9..e7ba8792b 100644 --- a/jnosql-communication/jnosql-communication-document/src/main/java/org/eclipse/jnosql/communication/document/DocumentEntity.java +++ b/jnosql-communication/jnosql-communication-document/src/main/java/org/eclipse/jnosql/communication/document/DocumentEntity.java @@ -289,10 +289,9 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (!(o instanceof DocumentEntity)) { + if (!(o instanceof DocumentEntity that)) { return false; } - DocumentEntity that = (DocumentEntity) o; return Objects.equals(this.documents().stream().sorted(comparing(Document::name)).collect(toList()), that.documents().stream().sorted(comparing(Document::name)).collect(toList())) && Objects.equals(name, that.name()); diff --git a/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/ConditionQueryValue.java b/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/ConditionQueryValue.java index 39b1f8dc4..b0fad1f1a 100644 --- a/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/ConditionQueryValue.java +++ b/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/ConditionQueryValue.java @@ -40,10 +40,9 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (!(o instanceof ConditionQueryValue)) { + if (!(o instanceof ConditionQueryValue that)) { return false; } - ConditionQueryValue that = (ConditionQueryValue) o; return Objects.equals(conditions, that.conditions); } diff --git a/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/DefaultArrayQueryValue.java b/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/DefaultArrayQueryValue.java index 2b4672274..a40b938b3 100644 --- a/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/DefaultArrayQueryValue.java +++ b/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/DefaultArrayQueryValue.java @@ -35,10 +35,9 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (!(o instanceof DefaultArrayQueryValue)) { + if (!(o instanceof DefaultArrayQueryValue that)) { return false; } - DefaultArrayQueryValue that = (DefaultArrayQueryValue) o; return Arrays.equals(values, that.values); } diff --git a/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/DefaultFunction.java b/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/DefaultFunction.java index 5f55f17df..20b201aa6 100644 --- a/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/DefaultFunction.java +++ b/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/DefaultFunction.java @@ -41,10 +41,9 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (!(o instanceof DefaultFunction)) { + if (!(o instanceof DefaultFunction that)) { return false; } - DefaultFunction that = (DefaultFunction) o; return Objects.equals(name, that.name) && Arrays.equals(args, that.args); } diff --git a/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/DefaultQueryValue.java b/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/DefaultQueryValue.java index 999c6050a..07f41acd5 100644 --- a/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/DefaultQueryValue.java +++ b/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/DefaultQueryValue.java @@ -36,10 +36,9 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (!(o instanceof DefaultQueryValue)) { + if (!(o instanceof DefaultQueryValue that)) { return false; } - DefaultQueryValue that = (DefaultQueryValue) o; return Objects.equals(value, that.value); } diff --git a/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/DefaultSelectQuery.java b/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/DefaultSelectQuery.java index f6c55a0aa..70e4a9072 100644 --- a/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/DefaultSelectQuery.java +++ b/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/DefaultSelectQuery.java @@ -95,10 +95,9 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (!(o instanceof DefaultSelectQuery)) { + if (!(o instanceof DefaultSelectQuery that)) { return false; } - DefaultSelectQuery that = (DefaultSelectQuery) o; return skip == that.skip && limit == that.limit && Objects.equals(entity, that.entity) && diff --git a/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/DeleteQuery.java b/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/DeleteQuery.java index b7e4fecba..c83d01e99 100644 --- a/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/DeleteQuery.java +++ b/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/DeleteQuery.java @@ -66,10 +66,9 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (!(o instanceof DeleteQuery)) { + if (!(o instanceof DeleteQuery that)) { return false; } - DeleteQuery that = (DeleteQuery) o; return Objects.equals(entity, that.entity) && Objects.equals(fields, that.fields) && Objects.equals(where, that.where); diff --git a/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/FunctionQueryValue.java b/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/FunctionQueryValue.java index a0e5d02ec..77656c285 100644 --- a/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/FunctionQueryValue.java +++ b/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/FunctionQueryValue.java @@ -39,10 +39,9 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (!(o instanceof FunctionQueryValue)) { + if (!(o instanceof FunctionQueryValue that)) { return false; } - FunctionQueryValue that = (FunctionQueryValue) o; return Objects.equals(function, that.function); } diff --git a/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/GetQuery.java b/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/GetQuery.java index 9b1e4a91b..19586dff7 100644 --- a/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/GetQuery.java +++ b/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/GetQuery.java @@ -43,10 +43,9 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (!(o instanceof GetQuery)) { + if (!(o instanceof GetQuery that)) { return false; } - GetQuery that = (GetQuery) o; return Objects.equals(keys, that.keys); } diff --git a/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/InsertQuery.java b/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/InsertQuery.java index 80d703785..19b930190 100644 --- a/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/InsertQuery.java +++ b/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/InsertQuery.java @@ -83,10 +83,9 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (!(o instanceof InsertQuery)) { + if (!(o instanceof InsertQuery that)) { return false; } - InsertQuery that = (InsertQuery) o; return Objects.equals(entity, that.entity) && Objects.equals(duration, that.duration) && Objects.equals(conditions, that.conditions); diff --git a/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/NumberQueryValue.java b/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/NumberQueryValue.java index b4c6570d9..b7e253f67 100644 --- a/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/NumberQueryValue.java +++ b/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/NumberQueryValue.java @@ -38,10 +38,9 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (!(o instanceof NumberQueryValue)) { + if (!(o instanceof NumberQueryValue that)) { return false; } - NumberQueryValue that = (NumberQueryValue) o; return Objects.equals(number, that.number); } diff --git a/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/StringQueryValue.java b/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/StringQueryValue.java index 26e3e5708..259955001 100644 --- a/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/StringQueryValue.java +++ b/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/StringQueryValue.java @@ -36,10 +36,9 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (!(o instanceof StringQueryValue)) { + if (!(o instanceof StringQueryValue that)) { return false; } - StringQueryValue that = (StringQueryValue) o; return Objects.equals(value, that.value); } diff --git a/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/UpdateQuery.java b/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/UpdateQuery.java index 1b78f5627..4baec1013 100644 --- a/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/UpdateQuery.java +++ b/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/UpdateQuery.java @@ -66,10 +66,9 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (!(o instanceof UpdateQuery)) { + if (!(o instanceof UpdateQuery that)) { return false; } - UpdateQuery that = (UpdateQuery) o; return Objects.equals(entity, that.entity) && Objects.equals(conditions, that.conditions); } diff --git a/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/Where.java b/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/Where.java index c39cb338e..3a595fcaa 100644 --- a/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/Where.java +++ b/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/Where.java @@ -41,10 +41,9 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (!(o instanceof Where)) { + if (!(o instanceof Where that)) { return false; } - Where that = (Where) o; return Objects.equals(condition, that.condition); } diff --git a/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/method/MethodArrayValue.java b/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/method/MethodArrayValue.java index 0710658c5..904dfb198 100644 --- a/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/method/MethodArrayValue.java +++ b/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/method/MethodArrayValue.java @@ -35,10 +35,9 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (!(o instanceof MethodArrayValue)) { + if (!(o instanceof MethodArrayValue that)) { return false; } - MethodArrayValue that = (MethodArrayValue) o; return Arrays.equals(values, that.values); } diff --git a/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/method/MethodParamQueryValue.java b/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/method/MethodParamQueryValue.java index 68e997f23..fcea71add 100644 --- a/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/method/MethodParamQueryValue.java +++ b/jnosql-communication/jnosql-communication-query/src/main/java/org/eclipse/jnosql/communication/query/method/MethodParamQueryValue.java @@ -35,10 +35,9 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (!(o instanceof MethodParamQueryValue)) { + if (!(o instanceof MethodParamQueryValue that)) { return false; } - MethodParamQueryValue that = (MethodParamQueryValue) o; return Objects.equals(value, that.value); }