From 386c218c1d7c98e5e946737bdd441fe580b4f993 Mon Sep 17 00:00:00 2001 From: TATSUNO Yasuhiro Date: Fri, 27 Jan 2023 10:47:26 +0900 Subject: [PATCH] Replace Guava's Objects util with JDK's equivalents --- .../java/com/treasuredata/client/model/TDColumn.java | 8 ++++---- .../com/treasuredata/client/model/TDDatabase.java | 6 +++--- .../java/com/treasuredata/client/model/TDTable.java | 10 +++++----- .../client/model/TDTableDistribution.java | 12 ++++++------ 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/main/java/com/treasuredata/client/model/TDColumn.java b/src/main/java/com/treasuredata/client/model/TDColumn.java index 1a7fd0a7..5c47770a 100644 --- a/src/main/java/com/treasuredata/client/model/TDColumn.java +++ b/src/main/java/com/treasuredata/client/model/TDColumn.java @@ -22,7 +22,6 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.RuntimeJsonMappingException; -import com.google.common.base.Objects; import org.json.simple.JSONArray; import org.json.simple.parser.JSONParser; import org.json.simple.parser.ParseException; @@ -33,6 +32,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.Objects; import static java.nio.charset.StandardCharsets.UTF_8; import static java.util.Objects.requireNonNull; @@ -169,15 +169,15 @@ public boolean equals(Object obj) return false; } TDColumn other = (TDColumn) obj; - return Objects.equal(this.name, other.name) && - Objects.equal(type, other.type) && + return Objects.equals(this.name, other.name) && + Objects.equals(type, other.type) && Arrays.equals(key, other.key); } @Override public int hashCode() { - return Objects.hashCode(name, type, Arrays.hashCode(key)); + return Objects.hash(name, type, Arrays.hashCode(key)); } @Override diff --git a/src/main/java/com/treasuredata/client/model/TDDatabase.java b/src/main/java/com/treasuredata/client/model/TDDatabase.java index 6f84ec7c..059c7ee6 100644 --- a/src/main/java/com/treasuredata/client/model/TDDatabase.java +++ b/src/main/java/com/treasuredata/client/model/TDDatabase.java @@ -20,8 +20,8 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.base.Objects; +import java.util.Objects; import java.util.Optional; @JsonCollectionRootName(value = "databases") @@ -112,12 +112,12 @@ public boolean equals(Object obj) return false; } TDDatabase other = (TDDatabase) obj; - return Objects.equal(this.name, other.name); + return Objects.equals(this.name, other.name); } @Override public int hashCode() { - return Objects.hashCode(name); + return Objects.hash(name); } } diff --git a/src/main/java/com/treasuredata/client/model/TDTable.java b/src/main/java/com/treasuredata/client/model/TDTable.java index 2fc33182..e18005d6 100644 --- a/src/main/java/com/treasuredata/client/model/TDTable.java +++ b/src/main/java/com/treasuredata/client/model/TDTable.java @@ -20,9 +20,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.base.Objects; import java.util.List; +import java.util.Objects; import java.util.stream.Collectors; public class TDTable @@ -136,15 +136,15 @@ public boolean equals(Object obj) return false; } TDTable other = (TDTable) obj; - return Objects.equal(this.name, other.name) && - Objects.equal(this.type, other.type) && - Objects.equal(this.columns, other.columns); + return Objects.equals(this.name, other.name) && + Objects.equals(this.type, other.type) && + Objects.equals(this.columns, other.columns); } @Override public int hashCode() { - return Objects.hashCode(name, type, columns); + return Objects.hash(name, type, columns); } @Override diff --git a/src/main/java/com/treasuredata/client/model/TDTableDistribution.java b/src/main/java/com/treasuredata/client/model/TDTableDistribution.java index d00c6384..5b23ed41 100644 --- a/src/main/java/com/treasuredata/client/model/TDTableDistribution.java +++ b/src/main/java/com/treasuredata/client/model/TDTableDistribution.java @@ -2,9 +2,9 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.common.base.Objects; import java.util.List; +import java.util.Objects; /** * TDTableDistribution provides the information about custom partitioning of the table. @@ -72,16 +72,16 @@ public boolean equals(Object obj) return false; } TDTableDistribution other = (TDTableDistribution) obj; - return Objects.equal(this.userTableId, other.userTableId) && - Objects.equal(this.bucketCount, other.bucketCount) && - Objects.equal(this.partitionFunction, other.partitionFunction) && - Objects.equal(this.columns, other.columns); + return Objects.equals(this.userTableId, other.userTableId) && + Objects.equals(this.bucketCount, other.bucketCount) && + Objects.equals(this.partitionFunction, other.partitionFunction) && + Objects.equals(this.columns, other.columns); } @Override public int hashCode() { - return Objects.hashCode(userTableId, bucketCount, partitionFunction); + return Objects.hash(userTableId, bucketCount, partitionFunction); } @Override