diff --git a/Makefile b/Makefile index bfe65e281..447e1f9f8 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ xdr/Stellar-contract.x \ xdr/Stellar-internal.x \ xdr/Stellar-contract-config-setting.x -XDRGEN_COMMIT=472eac8c5609d310d48bd8eed68aa24d2626df53 +XDRGEN_COMMIT=f0c41458ca0b66b4649b18deddc9f7a11199f1f9 XDRNEXT_COMMIT=e372df9f677961aac04c5a4cc80a3667f310b29f .PHONY: xdr xdr-clean xdr-update diff --git a/src/main/java/org/stellar/sdk/xdr/AccountEntry.java b/src/main/java/org/stellar/sdk/xdr/AccountEntry.java index 03be0dd10..f72f77fe0 100644 --- a/src/main/java/org/stellar/sdk/xdr/AccountEntry.java +++ b/src/main/java/org/stellar/sdk/xdr/AccountEntry.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -198,7 +198,7 @@ public static AccountEntry decode(XdrDataInputStream stream) throws IOException @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.accountID, this.balance, this.seqNum, @@ -218,22 +218,21 @@ public boolean equals(Object object) { } AccountEntry other = (AccountEntry) object; - return Objects.equal(this.accountID, other.accountID) - && Objects.equal(this.balance, other.balance) - && Objects.equal(this.seqNum, other.seqNum) - && Objects.equal(this.numSubEntries, other.numSubEntries) - && Objects.equal(this.inflationDest, other.inflationDest) - && Objects.equal(this.flags, other.flags) - && Objects.equal(this.homeDomain, other.homeDomain) - && Objects.equal(this.thresholds, other.thresholds) + return Objects.equals(this.accountID, other.accountID) + && Objects.equals(this.balance, other.balance) + && Objects.equals(this.seqNum, other.seqNum) + && Objects.equals(this.numSubEntries, other.numSubEntries) + && Objects.equals(this.inflationDest, other.inflationDest) + && Objects.equals(this.flags, other.flags) + && Objects.equals(this.homeDomain, other.homeDomain) + && Objects.equals(this.thresholds, other.thresholds) && Arrays.equals(this.signers, other.signers) - && Objects.equal(this.ext, other.ext); + && Objects.equals(this.ext, other.ext); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -245,8 +244,7 @@ public byte[] toXdrByteArray() throws IOException { } public static AccountEntry fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -413,7 +411,7 @@ public static AccountEntryExt decode(XdrDataInputStream stream) throws IOExcepti @Override public int hashCode() { - return Objects.hashCode(this.v1, this.v); + return Objects.hash(this.v1, this.v); } @Override @@ -423,13 +421,12 @@ public boolean equals(Object object) { } AccountEntryExt other = (AccountEntryExt) object; - return Objects.equal(this.v1, other.v1) && Objects.equal(this.v, other.v); + return Objects.equals(this.v1, other.v1) && Objects.equals(this.v, other.v); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -441,8 +438,7 @@ public byte[] toXdrByteArray() throws IOException { } public static AccountEntryExt fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/AccountEntryExtensionV1.java b/src/main/java/org/stellar/sdk/xdr/AccountEntryExtensionV1.java index fe0ea8027..ee43a5559 100644 --- a/src/main/java/org/stellar/sdk/xdr/AccountEntryExtensionV1.java +++ b/src/main/java/org/stellar/sdk/xdr/AccountEntryExtensionV1.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -71,7 +71,7 @@ public static AccountEntryExtensionV1 decode(XdrDataInputStream stream) throws I @Override public int hashCode() { - return Objects.hashCode(this.liabilities, this.ext); + return Objects.hash(this.liabilities, this.ext); } @Override @@ -81,13 +81,13 @@ public boolean equals(Object object) { } AccountEntryExtensionV1 other = (AccountEntryExtensionV1) object; - return Objects.equal(this.liabilities, other.liabilities) && Objects.equal(this.ext, other.ext); + return Objects.equals(this.liabilities, other.liabilities) + && Objects.equals(this.ext, other.ext); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -99,8 +99,7 @@ public byte[] toXdrByteArray() throws IOException { } public static AccountEntryExtensionV1 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -213,7 +212,7 @@ public static AccountEntryExtensionV1Ext decode(XdrDataInputStream stream) throw @Override public int hashCode() { - return Objects.hashCode(this.v2, this.v); + return Objects.hash(this.v2, this.v); } @Override @@ -223,13 +222,12 @@ public boolean equals(Object object) { } AccountEntryExtensionV1Ext other = (AccountEntryExtensionV1Ext) object; - return Objects.equal(this.v2, other.v2) && Objects.equal(this.v, other.v); + return Objects.equals(this.v2, other.v2) && Objects.equals(this.v, other.v); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -241,8 +239,7 @@ public byte[] toXdrByteArray() throws IOException { } public static AccountEntryExtensionV1Ext fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/AccountEntryExtensionV2.java b/src/main/java/org/stellar/sdk/xdr/AccountEntryExtensionV2.java index 8d4151a4a..1a87cd4e8 100644 --- a/src/main/java/org/stellar/sdk/xdr/AccountEntryExtensionV2.java +++ b/src/main/java/org/stellar/sdk/xdr/AccountEntryExtensionV2.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -107,7 +107,7 @@ public static AccountEntryExtensionV2 decode(XdrDataInputStream stream) throws I @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.numSponsored, this.numSponsoring, Arrays.hashCode(this.signerSponsoringIDs), this.ext); } @@ -118,16 +118,15 @@ public boolean equals(Object object) { } AccountEntryExtensionV2 other = (AccountEntryExtensionV2) object; - return Objects.equal(this.numSponsored, other.numSponsored) - && Objects.equal(this.numSponsoring, other.numSponsoring) + return Objects.equals(this.numSponsored, other.numSponsored) + && Objects.equals(this.numSponsoring, other.numSponsoring) && Arrays.equals(this.signerSponsoringIDs, other.signerSponsoringIDs) - && Objects.equal(this.ext, other.ext); + && Objects.equals(this.ext, other.ext); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -139,8 +138,7 @@ public byte[] toXdrByteArray() throws IOException { } public static AccountEntryExtensionV2 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -267,7 +265,7 @@ public static AccountEntryExtensionV2Ext decode(XdrDataInputStream stream) throw @Override public int hashCode() { - return Objects.hashCode(this.v3, this.v); + return Objects.hash(this.v3, this.v); } @Override @@ -277,13 +275,12 @@ public boolean equals(Object object) { } AccountEntryExtensionV2Ext other = (AccountEntryExtensionV2Ext) object; - return Objects.equal(this.v3, other.v3) && Objects.equal(this.v, other.v); + return Objects.equals(this.v3, other.v3) && Objects.equals(this.v, other.v); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -295,8 +292,7 @@ public byte[] toXdrByteArray() throws IOException { } public static AccountEntryExtensionV2Ext fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/AccountEntryExtensionV3.java b/src/main/java/org/stellar/sdk/xdr/AccountEntryExtensionV3.java index 0affd3ae1..d6c54dca4 100644 --- a/src/main/java/org/stellar/sdk/xdr/AccountEntryExtensionV3.java +++ b/src/main/java/org/stellar/sdk/xdr/AccountEntryExtensionV3.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -82,7 +82,7 @@ public static AccountEntryExtensionV3 decode(XdrDataInputStream stream) throws I @Override public int hashCode() { - return Objects.hashCode(this.ext, this.seqLedger, this.seqTime); + return Objects.hash(this.ext, this.seqLedger, this.seqTime); } @Override @@ -92,15 +92,14 @@ public boolean equals(Object object) { } AccountEntryExtensionV3 other = (AccountEntryExtensionV3) object; - return Objects.equal(this.ext, other.ext) - && Objects.equal(this.seqLedger, other.seqLedger) - && Objects.equal(this.seqTime, other.seqTime); + return Objects.equals(this.ext, other.ext) + && Objects.equals(this.seqLedger, other.seqLedger) + && Objects.equals(this.seqTime, other.seqTime); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -112,8 +111,7 @@ public byte[] toXdrByteArray() throws IOException { } public static AccountEntryExtensionV3 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/AccountFlags.java b/src/main/java/org/stellar/sdk/xdr/AccountFlags.java index a763bf8e8..b1b7bb8fd 100644 --- a/src/main/java/org/stellar/sdk/xdr/AccountFlags.java +++ b/src/main/java/org/stellar/sdk/xdr/AccountFlags.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -73,8 +73,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -86,8 +85,7 @@ public byte[] toXdrByteArray() throws IOException { } public static AccountFlags fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/AccountID.java b/src/main/java/org/stellar/sdk/xdr/AccountID.java index 1dfed5969..554de2924 100644 --- a/src/main/java/org/stellar/sdk/xdr/AccountID.java +++ b/src/main/java/org/stellar/sdk/xdr/AccountID.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -50,7 +50,7 @@ public static AccountID decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.AccountID); + return Objects.hash(this.AccountID); } @Override @@ -60,13 +60,12 @@ public boolean equals(Object object) { } AccountID other = (AccountID) object; - return Objects.equal(this.AccountID, other.AccountID); + return Objects.equals(this.AccountID, other.AccountID); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -78,8 +77,7 @@ public byte[] toXdrByteArray() throws IOException { } public static AccountID fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/AccountMergeResult.java b/src/main/java/org/stellar/sdk/xdr/AccountMergeResult.java index 84564a788..91beb0805 100644 --- a/src/main/java/org/stellar/sdk/xdr/AccountMergeResult.java +++ b/src/main/java/org/stellar/sdk/xdr/AccountMergeResult.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -119,7 +119,7 @@ public static AccountMergeResult decode(XdrDataInputStream stream) throws IOExce @Override public int hashCode() { - return Objects.hashCode(this.sourceAccountBalance, this.code); + return Objects.hash(this.sourceAccountBalance, this.code); } @Override @@ -129,14 +129,13 @@ public boolean equals(Object object) { } AccountMergeResult other = (AccountMergeResult) object; - return Objects.equal(this.sourceAccountBalance, other.sourceAccountBalance) - && Objects.equal(this.code, other.code); + return Objects.equals(this.sourceAccountBalance, other.sourceAccountBalance) + && Objects.equals(this.code, other.code); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -148,8 +147,7 @@ public byte[] toXdrByteArray() throws IOException { } public static AccountMergeResult fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/AccountMergeResultCode.java b/src/main/java/org/stellar/sdk/xdr/AccountMergeResultCode.java index 9400e622c..65222dfb7 100644 --- a/src/main/java/org/stellar/sdk/xdr/AccountMergeResultCode.java +++ b/src/main/java/org/stellar/sdk/xdr/AccountMergeResultCode.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -83,8 +83,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -96,8 +95,7 @@ public byte[] toXdrByteArray() throws IOException { } public static AccountMergeResultCode fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/AllowTrustOp.java b/src/main/java/org/stellar/sdk/xdr/AllowTrustOp.java index c2a66a639..ae10e0d27 100644 --- a/src/main/java/org/stellar/sdk/xdr/AllowTrustOp.java +++ b/src/main/java/org/stellar/sdk/xdr/AllowTrustOp.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -77,7 +77,7 @@ public static AllowTrustOp decode(XdrDataInputStream stream) throws IOException @Override public int hashCode() { - return Objects.hashCode(this.trustor, this.asset, this.authorize); + return Objects.hash(this.trustor, this.asset, this.authorize); } @Override @@ -87,15 +87,14 @@ public boolean equals(Object object) { } AllowTrustOp other = (AllowTrustOp) object; - return Objects.equal(this.trustor, other.trustor) - && Objects.equal(this.asset, other.asset) - && Objects.equal(this.authorize, other.authorize); + return Objects.equals(this.trustor, other.trustor) + && Objects.equals(this.asset, other.asset) + && Objects.equals(this.authorize, other.authorize); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -107,8 +106,7 @@ public byte[] toXdrByteArray() throws IOException { } public static AllowTrustOp fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/AllowTrustResult.java b/src/main/java/org/stellar/sdk/xdr/AllowTrustResult.java index ee87de8c3..a492b1f5f 100644 --- a/src/main/java/org/stellar/sdk/xdr/AllowTrustResult.java +++ b/src/main/java/org/stellar/sdk/xdr/AllowTrustResult.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -97,7 +97,7 @@ public static AllowTrustResult decode(XdrDataInputStream stream) throws IOExcept @Override public int hashCode() { - return Objects.hashCode(this.code); + return Objects.hash(this.code); } @Override @@ -107,13 +107,12 @@ public boolean equals(Object object) { } AllowTrustResult other = (AllowTrustResult) object; - return Objects.equal(this.code, other.code); + return Objects.equals(this.code, other.code); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -125,8 +124,7 @@ public byte[] toXdrByteArray() throws IOException { } public static AllowTrustResult fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/AllowTrustResultCode.java b/src/main/java/org/stellar/sdk/xdr/AllowTrustResultCode.java index 3f33db982..801a1206b 100644 --- a/src/main/java/org/stellar/sdk/xdr/AllowTrustResultCode.java +++ b/src/main/java/org/stellar/sdk/xdr/AllowTrustResultCode.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -80,8 +80,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -93,8 +92,7 @@ public byte[] toXdrByteArray() throws IOException { } public static AllowTrustResultCode fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/AlphaNum12.java b/src/main/java/org/stellar/sdk/xdr/AlphaNum12.java index b86dd0dc2..464a309ba 100644 --- a/src/main/java/org/stellar/sdk/xdr/AlphaNum12.java +++ b/src/main/java/org/stellar/sdk/xdr/AlphaNum12.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -62,7 +62,7 @@ public static AlphaNum12 decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.assetCode, this.issuer); + return Objects.hash(this.assetCode, this.issuer); } @Override @@ -72,14 +72,13 @@ public boolean equals(Object object) { } AlphaNum12 other = (AlphaNum12) object; - return Objects.equal(this.assetCode, other.assetCode) - && Objects.equal(this.issuer, other.issuer); + return Objects.equals(this.assetCode, other.assetCode) + && Objects.equals(this.issuer, other.issuer); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -91,8 +90,7 @@ public byte[] toXdrByteArray() throws IOException { } public static AlphaNum12 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/AlphaNum4.java b/src/main/java/org/stellar/sdk/xdr/AlphaNum4.java index 4d981dd1d..4bed6e0df 100644 --- a/src/main/java/org/stellar/sdk/xdr/AlphaNum4.java +++ b/src/main/java/org/stellar/sdk/xdr/AlphaNum4.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -62,7 +62,7 @@ public static AlphaNum4 decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.assetCode, this.issuer); + return Objects.hash(this.assetCode, this.issuer); } @Override @@ -72,14 +72,13 @@ public boolean equals(Object object) { } AlphaNum4 other = (AlphaNum4) object; - return Objects.equal(this.assetCode, other.assetCode) - && Objects.equal(this.issuer, other.issuer); + return Objects.equals(this.assetCode, other.assetCode) + && Objects.equals(this.issuer, other.issuer); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -91,8 +90,7 @@ public byte[] toXdrByteArray() throws IOException { } public static AlphaNum4 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/Asset.java b/src/main/java/org/stellar/sdk/xdr/Asset.java index 20594ea09..bcb446458 100644 --- a/src/main/java/org/stellar/sdk/xdr/Asset.java +++ b/src/main/java/org/stellar/sdk/xdr/Asset.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -129,7 +129,7 @@ public static Asset decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.alphaNum4, this.alphaNum12, this.type); + return Objects.hash(this.alphaNum4, this.alphaNum12, this.type); } @Override @@ -139,15 +139,14 @@ public boolean equals(Object object) { } Asset other = (Asset) object; - return Objects.equal(this.alphaNum4, other.alphaNum4) - && Objects.equal(this.alphaNum12, other.alphaNum12) - && Objects.equal(this.type, other.type); + return Objects.equals(this.alphaNum4, other.alphaNum4) + && Objects.equals(this.alphaNum12, other.alphaNum12) + && Objects.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -159,8 +158,7 @@ public byte[] toXdrByteArray() throws IOException { } public static Asset fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/AssetCode.java b/src/main/java/org/stellar/sdk/xdr/AssetCode.java index 3f1675d11..641cade63 100644 --- a/src/main/java/org/stellar/sdk/xdr/AssetCode.java +++ b/src/main/java/org/stellar/sdk/xdr/AssetCode.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -123,7 +123,7 @@ public static AssetCode decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.assetCode4, this.assetCode12, this.type); + return Objects.hash(this.assetCode4, this.assetCode12, this.type); } @Override @@ -133,15 +133,14 @@ public boolean equals(Object object) { } AssetCode other = (AssetCode) object; - return Objects.equal(this.assetCode4, other.assetCode4) - && Objects.equal(this.assetCode12, other.assetCode12) - && Objects.equal(this.type, other.type); + return Objects.equals(this.assetCode4, other.assetCode4) + && Objects.equals(this.assetCode12, other.assetCode12) + && Objects.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -153,8 +152,7 @@ public byte[] toXdrByteArray() throws IOException { } public static AssetCode fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/AssetCode12.java b/src/main/java/org/stellar/sdk/xdr/AssetCode12.java index 887725fe2..8a2be4c92 100644 --- a/src/main/java/org/stellar/sdk/xdr/AssetCode12.java +++ b/src/main/java/org/stellar/sdk/xdr/AssetCode12.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; // === xdr source ============================================================ @@ -68,8 +68,7 @@ public boolean equals(Object object) { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -81,8 +80,7 @@ public byte[] toXdrByteArray() throws IOException { } public static AssetCode12 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/AssetCode4.java b/src/main/java/org/stellar/sdk/xdr/AssetCode4.java index 8b8643cff..e83cf0a97 100644 --- a/src/main/java/org/stellar/sdk/xdr/AssetCode4.java +++ b/src/main/java/org/stellar/sdk/xdr/AssetCode4.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; // === xdr source ============================================================ @@ -68,8 +68,7 @@ public boolean equals(Object object) { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -81,8 +80,7 @@ public byte[] toXdrByteArray() throws IOException { } public static AssetCode4 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/AssetType.java b/src/main/java/org/stellar/sdk/xdr/AssetType.java index fafca9365..30771b3f0 100644 --- a/src/main/java/org/stellar/sdk/xdr/AssetType.java +++ b/src/main/java/org/stellar/sdk/xdr/AssetType.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -63,8 +63,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -76,8 +75,7 @@ public byte[] toXdrByteArray() throws IOException { } public static AssetType fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/Auth.java b/src/main/java/org/stellar/sdk/xdr/Auth.java index 42b03842d..ce1ead623 100644 --- a/src/main/java/org/stellar/sdk/xdr/Auth.java +++ b/src/main/java/org/stellar/sdk/xdr/Auth.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -48,7 +48,7 @@ public static Auth decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.flags); + return Objects.hash(this.flags); } @Override @@ -58,13 +58,12 @@ public boolean equals(Object object) { } Auth other = (Auth) object; - return Objects.equal(this.flags, other.flags); + return Objects.equals(this.flags, other.flags); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -76,8 +75,7 @@ public byte[] toXdrByteArray() throws IOException { } public static Auth fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/AuthCert.java b/src/main/java/org/stellar/sdk/xdr/AuthCert.java index 5d5482b8e..1f9db9ebf 100644 --- a/src/main/java/org/stellar/sdk/xdr/AuthCert.java +++ b/src/main/java/org/stellar/sdk/xdr/AuthCert.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -75,7 +75,7 @@ public static AuthCert decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.pubkey, this.expiration, this.sig); + return Objects.hash(this.pubkey, this.expiration, this.sig); } @Override @@ -85,15 +85,14 @@ public boolean equals(Object object) { } AuthCert other = (AuthCert) object; - return Objects.equal(this.pubkey, other.pubkey) - && Objects.equal(this.expiration, other.expiration) - && Objects.equal(this.sig, other.sig); + return Objects.equals(this.pubkey, other.pubkey) + && Objects.equals(this.expiration, other.expiration) + && Objects.equals(this.sig, other.sig); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -105,8 +104,7 @@ public byte[] toXdrByteArray() throws IOException { } public static AuthCert fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/AuthenticatedMessage.java b/src/main/java/org/stellar/sdk/xdr/AuthenticatedMessage.java index 49cff396a..26f50cae2 100644 --- a/src/main/java/org/stellar/sdk/xdr/AuthenticatedMessage.java +++ b/src/main/java/org/stellar/sdk/xdr/AuthenticatedMessage.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -102,7 +102,7 @@ public static AuthenticatedMessage decode(XdrDataInputStream stream) throws IOEx @Override public int hashCode() { - return Objects.hashCode(this.v0, this.v); + return Objects.hash(this.v0, this.v); } @Override @@ -112,13 +112,12 @@ public boolean equals(Object object) { } AuthenticatedMessage other = (AuthenticatedMessage) object; - return Objects.equal(this.v0, other.v0) && Objects.equal(this.v, other.v); + return Objects.equals(this.v0, other.v0) && Objects.equals(this.v, other.v); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -130,8 +129,7 @@ public byte[] toXdrByteArray() throws IOException { } public static AuthenticatedMessage fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -196,7 +194,7 @@ public static AuthenticatedMessageV0 decode(XdrDataInputStream stream) throws IO @Override public int hashCode() { - return Objects.hashCode(this.sequence, this.message, this.mac); + return Objects.hash(this.sequence, this.message, this.mac); } @Override @@ -206,15 +204,14 @@ public boolean equals(Object object) { } AuthenticatedMessageV0 other = (AuthenticatedMessageV0) object; - return Objects.equal(this.sequence, other.sequence) - && Objects.equal(this.message, other.message) - && Objects.equal(this.mac, other.mac); + return Objects.equals(this.sequence, other.sequence) + && Objects.equals(this.message, other.message) + && Objects.equals(this.mac, other.mac); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -226,8 +223,7 @@ public byte[] toXdrByteArray() throws IOException { } public static AuthenticatedMessageV0 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/BeginSponsoringFutureReservesOp.java b/src/main/java/org/stellar/sdk/xdr/BeginSponsoringFutureReservesOp.java index 2213e8288..9c9a7ce01 100644 --- a/src/main/java/org/stellar/sdk/xdr/BeginSponsoringFutureReservesOp.java +++ b/src/main/java/org/stellar/sdk/xdr/BeginSponsoringFutureReservesOp.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -53,7 +53,7 @@ public static BeginSponsoringFutureReservesOp decode(XdrDataInputStream stream) @Override public int hashCode() { - return Objects.hashCode(this.sponsoredID); + return Objects.hash(this.sponsoredID); } @Override @@ -63,13 +63,12 @@ public boolean equals(Object object) { } BeginSponsoringFutureReservesOp other = (BeginSponsoringFutureReservesOp) object; - return Objects.equal(this.sponsoredID, other.sponsoredID); + return Objects.equals(this.sponsoredID, other.sponsoredID); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -81,8 +80,7 @@ public byte[] toXdrByteArray() throws IOException { } public static BeginSponsoringFutureReservesOp fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/BeginSponsoringFutureReservesResult.java b/src/main/java/org/stellar/sdk/xdr/BeginSponsoringFutureReservesResult.java index 0fb172a4d..127dcd520 100644 --- a/src/main/java/org/stellar/sdk/xdr/BeginSponsoringFutureReservesResult.java +++ b/src/main/java/org/stellar/sdk/xdr/BeginSponsoringFutureReservesResult.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -94,7 +94,7 @@ public static BeginSponsoringFutureReservesResult decode(XdrDataInputStream stre @Override public int hashCode() { - return Objects.hashCode(this.code); + return Objects.hash(this.code); } @Override @@ -104,13 +104,12 @@ public boolean equals(Object object) { } BeginSponsoringFutureReservesResult other = (BeginSponsoringFutureReservesResult) object; - return Objects.equal(this.code, other.code); + return Objects.equals(this.code, other.code); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -122,8 +121,7 @@ public byte[] toXdrByteArray() throws IOException { } public static BeginSponsoringFutureReservesResult fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/BeginSponsoringFutureReservesResultCode.java b/src/main/java/org/stellar/sdk/xdr/BeginSponsoringFutureReservesResultCode.java index 96c2e7487..8f9a8a1f3 100644 --- a/src/main/java/org/stellar/sdk/xdr/BeginSponsoringFutureReservesResultCode.java +++ b/src/main/java/org/stellar/sdk/xdr/BeginSponsoringFutureReservesResultCode.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -69,8 +69,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -83,8 +82,7 @@ public byte[] toXdrByteArray() throws IOException { public static BeginSponsoringFutureReservesResultCode fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/BucketEntry.java b/src/main/java/org/stellar/sdk/xdr/BucketEntry.java index 6305c02d8..872c372f4 100644 --- a/src/main/java/org/stellar/sdk/xdr/BucketEntry.java +++ b/src/main/java/org/stellar/sdk/xdr/BucketEntry.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -149,7 +149,7 @@ public static BucketEntry decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.liveEntry, this.deadEntry, this.metaEntry, this.type); + return Objects.hash(this.liveEntry, this.deadEntry, this.metaEntry, this.type); } @Override @@ -159,16 +159,15 @@ public boolean equals(Object object) { } BucketEntry other = (BucketEntry) object; - return Objects.equal(this.liveEntry, other.liveEntry) - && Objects.equal(this.deadEntry, other.deadEntry) - && Objects.equal(this.metaEntry, other.metaEntry) - && Objects.equal(this.type, other.type); + return Objects.equals(this.liveEntry, other.liveEntry) + && Objects.equals(this.deadEntry, other.deadEntry) + && Objects.equals(this.metaEntry, other.metaEntry) + && Objects.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -180,8 +179,7 @@ public byte[] toXdrByteArray() throws IOException { } public static BucketEntry fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/BucketEntryType.java b/src/main/java/org/stellar/sdk/xdr/BucketEntryType.java index 273a4a792..359a29b2b 100644 --- a/src/main/java/org/stellar/sdk/xdr/BucketEntryType.java +++ b/src/main/java/org/stellar/sdk/xdr/BucketEntryType.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -65,8 +65,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -78,8 +77,7 @@ public byte[] toXdrByteArray() throws IOException { } public static BucketEntryType fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/BucketMetadata.java b/src/main/java/org/stellar/sdk/xdr/BucketMetadata.java index 1d2b37bf6..9a0f8eddf 100644 --- a/src/main/java/org/stellar/sdk/xdr/BucketMetadata.java +++ b/src/main/java/org/stellar/sdk/xdr/BucketMetadata.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -70,7 +70,7 @@ public static BucketMetadata decode(XdrDataInputStream stream) throws IOExceptio @Override public int hashCode() { - return Objects.hashCode(this.ledgerVersion, this.ext); + return Objects.hash(this.ledgerVersion, this.ext); } @Override @@ -80,14 +80,13 @@ public boolean equals(Object object) { } BucketMetadata other = (BucketMetadata) object; - return Objects.equal(this.ledgerVersion, other.ledgerVersion) - && Objects.equal(this.ext, other.ext); + return Objects.equals(this.ledgerVersion, other.ledgerVersion) + && Objects.equals(this.ext, other.ext); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -99,8 +98,7 @@ public byte[] toXdrByteArray() throws IOException { } public static BucketMetadata fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -188,7 +186,7 @@ public static BucketMetadataExt decode(XdrDataInputStream stream) throws IOExcep @Override public int hashCode() { - return Objects.hashCode(this.v); + return Objects.hash(this.v); } @Override @@ -198,13 +196,12 @@ public boolean equals(Object object) { } BucketMetadataExt other = (BucketMetadataExt) object; - return Objects.equal(this.v, other.v); + return Objects.equals(this.v, other.v); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -216,8 +213,7 @@ public byte[] toXdrByteArray() throws IOException { } public static BucketMetadataExt fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/BumpFootprintExpirationOp.java b/src/main/java/org/stellar/sdk/xdr/BumpFootprintExpirationOp.java index 2c396ac27..14155f454 100644 --- a/src/main/java/org/stellar/sdk/xdr/BumpFootprintExpirationOp.java +++ b/src/main/java/org/stellar/sdk/xdr/BumpFootprintExpirationOp.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -63,7 +63,7 @@ public static BumpFootprintExpirationOp decode(XdrDataInputStream stream) throws @Override public int hashCode() { - return Objects.hashCode(this.ext, this.ledgersToExpire); + return Objects.hash(this.ext, this.ledgersToExpire); } @Override @@ -73,14 +73,13 @@ public boolean equals(Object object) { } BumpFootprintExpirationOp other = (BumpFootprintExpirationOp) object; - return Objects.equal(this.ext, other.ext) - && Objects.equal(this.ledgersToExpire, other.ledgersToExpire); + return Objects.equals(this.ext, other.ext) + && Objects.equals(this.ledgersToExpire, other.ledgersToExpire); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -92,8 +91,7 @@ public byte[] toXdrByteArray() throws IOException { } public static BumpFootprintExpirationOp fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/BumpFootprintExpirationResult.java b/src/main/java/org/stellar/sdk/xdr/BumpFootprintExpirationResult.java index 38b943184..21267b8b2 100644 --- a/src/main/java/org/stellar/sdk/xdr/BumpFootprintExpirationResult.java +++ b/src/main/java/org/stellar/sdk/xdr/BumpFootprintExpirationResult.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -89,7 +89,7 @@ public static BumpFootprintExpirationResult decode(XdrDataInputStream stream) th @Override public int hashCode() { - return Objects.hashCode(this.code); + return Objects.hash(this.code); } @Override @@ -99,13 +99,12 @@ public boolean equals(Object object) { } BumpFootprintExpirationResult other = (BumpFootprintExpirationResult) object; - return Objects.equal(this.code, other.code); + return Objects.equals(this.code, other.code); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -117,8 +116,7 @@ public byte[] toXdrByteArray() throws IOException { } public static BumpFootprintExpirationResult fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/BumpFootprintExpirationResultCode.java b/src/main/java/org/stellar/sdk/xdr/BumpFootprintExpirationResultCode.java index 15366d027..cc3711b0a 100644 --- a/src/main/java/org/stellar/sdk/xdr/BumpFootprintExpirationResultCode.java +++ b/src/main/java/org/stellar/sdk/xdr/BumpFootprintExpirationResultCode.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -64,8 +64,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -77,8 +76,7 @@ public byte[] toXdrByteArray() throws IOException { } public static BumpFootprintExpirationResultCode fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/BumpSequenceOp.java b/src/main/java/org/stellar/sdk/xdr/BumpSequenceOp.java index 73d3bc385..4602afec0 100644 --- a/src/main/java/org/stellar/sdk/xdr/BumpSequenceOp.java +++ b/src/main/java/org/stellar/sdk/xdr/BumpSequenceOp.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -49,7 +49,7 @@ public static BumpSequenceOp decode(XdrDataInputStream stream) throws IOExceptio @Override public int hashCode() { - return Objects.hashCode(this.bumpTo); + return Objects.hash(this.bumpTo); } @Override @@ -59,13 +59,12 @@ public boolean equals(Object object) { } BumpSequenceOp other = (BumpSequenceOp) object; - return Objects.equal(this.bumpTo, other.bumpTo); + return Objects.equals(this.bumpTo, other.bumpTo); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -77,8 +76,7 @@ public byte[] toXdrByteArray() throws IOException { } public static BumpSequenceOp fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/BumpSequenceResult.java b/src/main/java/org/stellar/sdk/xdr/BumpSequenceResult.java index 9e9dbd2ad..750d061ca 100644 --- a/src/main/java/org/stellar/sdk/xdr/BumpSequenceResult.java +++ b/src/main/java/org/stellar/sdk/xdr/BumpSequenceResult.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -82,7 +82,7 @@ public static BumpSequenceResult decode(XdrDataInputStream stream) throws IOExce @Override public int hashCode() { - return Objects.hashCode(this.code); + return Objects.hash(this.code); } @Override @@ -92,13 +92,12 @@ public boolean equals(Object object) { } BumpSequenceResult other = (BumpSequenceResult) object; - return Objects.equal(this.code, other.code); + return Objects.equals(this.code, other.code); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -110,8 +109,7 @@ public byte[] toXdrByteArray() throws IOException { } public static BumpSequenceResult fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/BumpSequenceResultCode.java b/src/main/java/org/stellar/sdk/xdr/BumpSequenceResultCode.java index a19bf8d67..363656d28 100644 --- a/src/main/java/org/stellar/sdk/xdr/BumpSequenceResultCode.java +++ b/src/main/java/org/stellar/sdk/xdr/BumpSequenceResultCode.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -58,8 +58,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -71,8 +70,7 @@ public byte[] toXdrByteArray() throws IOException { } public static BumpSequenceResultCode fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ChangeTrustAsset.java b/src/main/java/org/stellar/sdk/xdr/ChangeTrustAsset.java index d9bbfa9bf..02e2ff442 100644 --- a/src/main/java/org/stellar/sdk/xdr/ChangeTrustAsset.java +++ b/src/main/java/org/stellar/sdk/xdr/ChangeTrustAsset.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -156,7 +156,7 @@ public static ChangeTrustAsset decode(XdrDataInputStream stream) throws IOExcept @Override public int hashCode() { - return Objects.hashCode(this.alphaNum4, this.alphaNum12, this.liquidityPool, this.type); + return Objects.hash(this.alphaNum4, this.alphaNum12, this.liquidityPool, this.type); } @Override @@ -166,16 +166,15 @@ public boolean equals(Object object) { } ChangeTrustAsset other = (ChangeTrustAsset) object; - return Objects.equal(this.alphaNum4, other.alphaNum4) - && Objects.equal(this.alphaNum12, other.alphaNum12) - && Objects.equal(this.liquidityPool, other.liquidityPool) - && Objects.equal(this.type, other.type); + return Objects.equals(this.alphaNum4, other.alphaNum4) + && Objects.equals(this.alphaNum12, other.alphaNum12) + && Objects.equals(this.liquidityPool, other.liquidityPool) + && Objects.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -187,8 +186,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ChangeTrustAsset fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ChangeTrustOp.java b/src/main/java/org/stellar/sdk/xdr/ChangeTrustOp.java index 2bf7124f2..c4c467d69 100644 --- a/src/main/java/org/stellar/sdk/xdr/ChangeTrustOp.java +++ b/src/main/java/org/stellar/sdk/xdr/ChangeTrustOp.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -64,7 +64,7 @@ public static ChangeTrustOp decode(XdrDataInputStream stream) throws IOException @Override public int hashCode() { - return Objects.hashCode(this.line, this.limit); + return Objects.hash(this.line, this.limit); } @Override @@ -74,13 +74,12 @@ public boolean equals(Object object) { } ChangeTrustOp other = (ChangeTrustOp) object; - return Objects.equal(this.line, other.line) && Objects.equal(this.limit, other.limit); + return Objects.equals(this.line, other.line) && Objects.equals(this.limit, other.limit); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -92,8 +91,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ChangeTrustOp fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ChangeTrustResult.java b/src/main/java/org/stellar/sdk/xdr/ChangeTrustResult.java index 09215f4a3..8a3422f07 100644 --- a/src/main/java/org/stellar/sdk/xdr/ChangeTrustResult.java +++ b/src/main/java/org/stellar/sdk/xdr/ChangeTrustResult.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -103,7 +103,7 @@ public static ChangeTrustResult decode(XdrDataInputStream stream) throws IOExcep @Override public int hashCode() { - return Objects.hashCode(this.code); + return Objects.hash(this.code); } @Override @@ -113,13 +113,12 @@ public boolean equals(Object object) { } ChangeTrustResult other = (ChangeTrustResult) object; - return Objects.equal(this.code, other.code); + return Objects.equals(this.code, other.code); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -131,8 +130,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ChangeTrustResult fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ChangeTrustResultCode.java b/src/main/java/org/stellar/sdk/xdr/ChangeTrustResultCode.java index 97423b061..7a5a9c050 100644 --- a/src/main/java/org/stellar/sdk/xdr/ChangeTrustResultCode.java +++ b/src/main/java/org/stellar/sdk/xdr/ChangeTrustResultCode.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -90,8 +90,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -103,8 +102,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ChangeTrustResultCode fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ClaimAtom.java b/src/main/java/org/stellar/sdk/xdr/ClaimAtom.java index 1ebc0f6dc..fbff8b168 100644 --- a/src/main/java/org/stellar/sdk/xdr/ClaimAtom.java +++ b/src/main/java/org/stellar/sdk/xdr/ClaimAtom.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -145,7 +145,7 @@ public static ClaimAtom decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.v0, this.orderBook, this.liquidityPool, this.type); + return Objects.hash(this.v0, this.orderBook, this.liquidityPool, this.type); } @Override @@ -155,16 +155,15 @@ public boolean equals(Object object) { } ClaimAtom other = (ClaimAtom) object; - return Objects.equal(this.v0, other.v0) - && Objects.equal(this.orderBook, other.orderBook) - && Objects.equal(this.liquidityPool, other.liquidityPool) - && Objects.equal(this.type, other.type); + return Objects.equals(this.v0, other.v0) + && Objects.equals(this.orderBook, other.orderBook) + && Objects.equals(this.liquidityPool, other.liquidityPool) + && Objects.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -176,8 +175,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ClaimAtom fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ClaimAtomType.java b/src/main/java/org/stellar/sdk/xdr/ClaimAtomType.java index 282762069..5a3e4a4a2 100644 --- a/src/main/java/org/stellar/sdk/xdr/ClaimAtomType.java +++ b/src/main/java/org/stellar/sdk/xdr/ClaimAtomType.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -59,8 +59,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -72,8 +71,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ClaimAtomType fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ClaimClaimableBalanceOp.java b/src/main/java/org/stellar/sdk/xdr/ClaimClaimableBalanceOp.java index 86bccbc3c..d05b01927 100644 --- a/src/main/java/org/stellar/sdk/xdr/ClaimClaimableBalanceOp.java +++ b/src/main/java/org/stellar/sdk/xdr/ClaimClaimableBalanceOp.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -50,7 +50,7 @@ public static ClaimClaimableBalanceOp decode(XdrDataInputStream stream) throws I @Override public int hashCode() { - return Objects.hashCode(this.balanceID); + return Objects.hash(this.balanceID); } @Override @@ -60,13 +60,12 @@ public boolean equals(Object object) { } ClaimClaimableBalanceOp other = (ClaimClaimableBalanceOp) object; - return Objects.equal(this.balanceID, other.balanceID); + return Objects.equals(this.balanceID, other.balanceID); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -78,8 +77,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ClaimClaimableBalanceOp fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ClaimClaimableBalanceResult.java b/src/main/java/org/stellar/sdk/xdr/ClaimClaimableBalanceResult.java index 749857b86..ef710d25b 100644 --- a/src/main/java/org/stellar/sdk/xdr/ClaimClaimableBalanceResult.java +++ b/src/main/java/org/stellar/sdk/xdr/ClaimClaimableBalanceResult.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -96,7 +96,7 @@ public static ClaimClaimableBalanceResult decode(XdrDataInputStream stream) thro @Override public int hashCode() { - return Objects.hashCode(this.code); + return Objects.hash(this.code); } @Override @@ -106,13 +106,12 @@ public boolean equals(Object object) { } ClaimClaimableBalanceResult other = (ClaimClaimableBalanceResult) object; - return Objects.equal(this.code, other.code); + return Objects.equals(this.code, other.code); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -124,8 +123,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ClaimClaimableBalanceResult fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ClaimClaimableBalanceResultCode.java b/src/main/java/org/stellar/sdk/xdr/ClaimClaimableBalanceResultCode.java index 5a6521eed..475ec3e8f 100644 --- a/src/main/java/org/stellar/sdk/xdr/ClaimClaimableBalanceResultCode.java +++ b/src/main/java/org/stellar/sdk/xdr/ClaimClaimableBalanceResultCode.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -73,8 +73,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -86,8 +85,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ClaimClaimableBalanceResultCode fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ClaimLiquidityAtom.java b/src/main/java/org/stellar/sdk/xdr/ClaimLiquidityAtom.java index e03acda88..1c45b542b 100644 --- a/src/main/java/org/stellar/sdk/xdr/ClaimLiquidityAtom.java +++ b/src/main/java/org/stellar/sdk/xdr/ClaimLiquidityAtom.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -105,7 +105,7 @@ public static ClaimLiquidityAtom decode(XdrDataInputStream stream) throws IOExce @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.liquidityPoolID, this.assetSold, this.amountSold, this.assetBought, this.amountBought); } @@ -116,17 +116,16 @@ public boolean equals(Object object) { } ClaimLiquidityAtom other = (ClaimLiquidityAtom) object; - return Objects.equal(this.liquidityPoolID, other.liquidityPoolID) - && Objects.equal(this.assetSold, other.assetSold) - && Objects.equal(this.amountSold, other.amountSold) - && Objects.equal(this.assetBought, other.assetBought) - && Objects.equal(this.amountBought, other.amountBought); + return Objects.equals(this.liquidityPoolID, other.liquidityPoolID) + && Objects.equals(this.assetSold, other.assetSold) + && Objects.equals(this.amountSold, other.amountSold) + && Objects.equals(this.assetBought, other.assetBought) + && Objects.equals(this.amountBought, other.amountBought); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -138,8 +137,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ClaimLiquidityAtom fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ClaimOfferAtom.java b/src/main/java/org/stellar/sdk/xdr/ClaimOfferAtom.java index c379e7d9a..55da15ce9 100644 --- a/src/main/java/org/stellar/sdk/xdr/ClaimOfferAtom.java +++ b/src/main/java/org/stellar/sdk/xdr/ClaimOfferAtom.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -119,7 +119,7 @@ public static ClaimOfferAtom decode(XdrDataInputStream stream) throws IOExceptio @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.sellerID, this.offerID, this.assetSold, @@ -135,18 +135,17 @@ public boolean equals(Object object) { } ClaimOfferAtom other = (ClaimOfferAtom) object; - return Objects.equal(this.sellerID, other.sellerID) - && Objects.equal(this.offerID, other.offerID) - && Objects.equal(this.assetSold, other.assetSold) - && Objects.equal(this.amountSold, other.amountSold) - && Objects.equal(this.assetBought, other.assetBought) - && Objects.equal(this.amountBought, other.amountBought); + return Objects.equals(this.sellerID, other.sellerID) + && Objects.equals(this.offerID, other.offerID) + && Objects.equals(this.assetSold, other.assetSold) + && Objects.equals(this.amountSold, other.amountSold) + && Objects.equals(this.assetBought, other.assetBought) + && Objects.equals(this.amountBought, other.amountBought); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -158,8 +157,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ClaimOfferAtom fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ClaimOfferAtomV0.java b/src/main/java/org/stellar/sdk/xdr/ClaimOfferAtomV0.java index aa3e635f6..acf4435b1 100644 --- a/src/main/java/org/stellar/sdk/xdr/ClaimOfferAtomV0.java +++ b/src/main/java/org/stellar/sdk/xdr/ClaimOfferAtomV0.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -119,7 +119,7 @@ public static ClaimOfferAtomV0 decode(XdrDataInputStream stream) throws IOExcept @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.sellerEd25519, this.offerID, this.assetSold, @@ -135,18 +135,17 @@ public boolean equals(Object object) { } ClaimOfferAtomV0 other = (ClaimOfferAtomV0) object; - return Objects.equal(this.sellerEd25519, other.sellerEd25519) - && Objects.equal(this.offerID, other.offerID) - && Objects.equal(this.assetSold, other.assetSold) - && Objects.equal(this.amountSold, other.amountSold) - && Objects.equal(this.assetBought, other.assetBought) - && Objects.equal(this.amountBought, other.amountBought); + return Objects.equals(this.sellerEd25519, other.sellerEd25519) + && Objects.equals(this.offerID, other.offerID) + && Objects.equals(this.assetSold, other.assetSold) + && Objects.equals(this.amountSold, other.amountSold) + && Objects.equals(this.assetBought, other.assetBought) + && Objects.equals(this.amountBought, other.amountBought); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -158,8 +157,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ClaimOfferAtomV0 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ClaimPredicate.java b/src/main/java/org/stellar/sdk/xdr/ClaimPredicate.java index 43e58652a..44ddc6a1f 100644 --- a/src/main/java/org/stellar/sdk/xdr/ClaimPredicate.java +++ b/src/main/java/org/stellar/sdk/xdr/ClaimPredicate.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -227,7 +227,7 @@ public static ClaimPredicate decode(XdrDataInputStream stream) throws IOExceptio @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( Arrays.hashCode(this.andPredicates), Arrays.hashCode(this.orPredicates), this.notPredicate, @@ -245,16 +245,15 @@ public boolean equals(Object object) { ClaimPredicate other = (ClaimPredicate) object; return Arrays.equals(this.andPredicates, other.andPredicates) && Arrays.equals(this.orPredicates, other.orPredicates) - && Objects.equal(this.notPredicate, other.notPredicate) - && Objects.equal(this.absBefore, other.absBefore) - && Objects.equal(this.relBefore, other.relBefore) - && Objects.equal(this.type, other.type); + && Objects.equals(this.notPredicate, other.notPredicate) + && Objects.equals(this.absBefore, other.absBefore) + && Objects.equals(this.relBefore, other.relBefore) + && Objects.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -266,8 +265,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ClaimPredicate fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ClaimPredicateType.java b/src/main/java/org/stellar/sdk/xdr/ClaimPredicateType.java index bbd4e3db1..232600eaf 100644 --- a/src/main/java/org/stellar/sdk/xdr/ClaimPredicateType.java +++ b/src/main/java/org/stellar/sdk/xdr/ClaimPredicateType.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -72,8 +72,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -85,8 +84,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ClaimPredicateType fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ClaimableBalanceEntry.java b/src/main/java/org/stellar/sdk/xdr/ClaimableBalanceEntry.java index 54ab38357..6c5164f45 100644 --- a/src/main/java/org/stellar/sdk/xdr/ClaimableBalanceEntry.java +++ b/src/main/java/org/stellar/sdk/xdr/ClaimableBalanceEntry.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -127,7 +127,7 @@ public static ClaimableBalanceEntry decode(XdrDataInputStream stream) throws IOE @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.balanceID, Arrays.hashCode(this.claimants), this.asset, this.amount, this.ext); } @@ -138,17 +138,16 @@ public boolean equals(Object object) { } ClaimableBalanceEntry other = (ClaimableBalanceEntry) object; - return Objects.equal(this.balanceID, other.balanceID) + return Objects.equals(this.balanceID, other.balanceID) && Arrays.equals(this.claimants, other.claimants) - && Objects.equal(this.asset, other.asset) - && Objects.equal(this.amount, other.amount) - && Objects.equal(this.ext, other.ext); + && Objects.equals(this.asset, other.asset) + && Objects.equals(this.amount, other.amount) + && Objects.equals(this.ext, other.ext); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -160,8 +159,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ClaimableBalanceEntry fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -294,7 +292,7 @@ public static ClaimableBalanceEntryExt decode(XdrDataInputStream stream) throws @Override public int hashCode() { - return Objects.hashCode(this.v1, this.v); + return Objects.hash(this.v1, this.v); } @Override @@ -304,13 +302,12 @@ public boolean equals(Object object) { } ClaimableBalanceEntryExt other = (ClaimableBalanceEntryExt) object; - return Objects.equal(this.v1, other.v1) && Objects.equal(this.v, other.v); + return Objects.equals(this.v1, other.v1) && Objects.equals(this.v, other.v); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -322,8 +319,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ClaimableBalanceEntryExt fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ClaimableBalanceEntryExtensionV1.java b/src/main/java/org/stellar/sdk/xdr/ClaimableBalanceEntryExtensionV1.java index 0ef0744c0..6d078f36d 100644 --- a/src/main/java/org/stellar/sdk/xdr/ClaimableBalanceEntryExtensionV1.java +++ b/src/main/java/org/stellar/sdk/xdr/ClaimableBalanceEntryExtensionV1.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -73,7 +73,7 @@ public static ClaimableBalanceEntryExtensionV1 decode(XdrDataInputStream stream) @Override public int hashCode() { - return Objects.hashCode(this.ext, this.flags); + return Objects.hash(this.ext, this.flags); } @Override @@ -83,13 +83,12 @@ public boolean equals(Object object) { } ClaimableBalanceEntryExtensionV1 other = (ClaimableBalanceEntryExtensionV1) object; - return Objects.equal(this.ext, other.ext) && Objects.equal(this.flags, other.flags); + return Objects.equals(this.ext, other.ext) && Objects.equals(this.flags, other.flags); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -101,8 +100,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ClaimableBalanceEntryExtensionV1 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -194,7 +192,7 @@ public static ClaimableBalanceEntryExtensionV1Ext decode(XdrDataInputStream stre @Override public int hashCode() { - return Objects.hashCode(this.v); + return Objects.hash(this.v); } @Override @@ -204,13 +202,12 @@ public boolean equals(Object object) { } ClaimableBalanceEntryExtensionV1Ext other = (ClaimableBalanceEntryExtensionV1Ext) object; - return Objects.equal(this.v, other.v); + return Objects.equals(this.v, other.v); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -222,8 +219,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ClaimableBalanceEntryExtensionV1Ext fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ClaimableBalanceFlags.java b/src/main/java/org/stellar/sdk/xdr/ClaimableBalanceFlags.java index 5958a0162..87e307958 100644 --- a/src/main/java/org/stellar/sdk/xdr/ClaimableBalanceFlags.java +++ b/src/main/java/org/stellar/sdk/xdr/ClaimableBalanceFlags.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -54,8 +54,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -67,8 +66,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ClaimableBalanceFlags fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ClaimableBalanceID.java b/src/main/java/org/stellar/sdk/xdr/ClaimableBalanceID.java index 53bb5bdc0..a2adef3fb 100644 --- a/src/main/java/org/stellar/sdk/xdr/ClaimableBalanceID.java +++ b/src/main/java/org/stellar/sdk/xdr/ClaimableBalanceID.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -95,7 +95,7 @@ public static ClaimableBalanceID decode(XdrDataInputStream stream) throws IOExce @Override public int hashCode() { - return Objects.hashCode(this.v0, this.type); + return Objects.hash(this.v0, this.type); } @Override @@ -105,13 +105,12 @@ public boolean equals(Object object) { } ClaimableBalanceID other = (ClaimableBalanceID) object; - return Objects.equal(this.v0, other.v0) && Objects.equal(this.type, other.type); + return Objects.equals(this.v0, other.v0) && Objects.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -123,8 +122,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ClaimableBalanceID fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ClaimableBalanceIDType.java b/src/main/java/org/stellar/sdk/xdr/ClaimableBalanceIDType.java index 80e989b58..b4450f579 100644 --- a/src/main/java/org/stellar/sdk/xdr/ClaimableBalanceIDType.java +++ b/src/main/java/org/stellar/sdk/xdr/ClaimableBalanceIDType.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -52,8 +52,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -65,8 +64,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ClaimableBalanceIDType fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/Claimant.java b/src/main/java/org/stellar/sdk/xdr/Claimant.java index dc797111e..0c8d14b3c 100644 --- a/src/main/java/org/stellar/sdk/xdr/Claimant.java +++ b/src/main/java/org/stellar/sdk/xdr/Claimant.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -99,7 +99,7 @@ public static Claimant decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.v0, this.type); + return Objects.hash(this.v0, this.type); } @Override @@ -109,13 +109,12 @@ public boolean equals(Object object) { } Claimant other = (Claimant) object; - return Objects.equal(this.v0, other.v0) && Objects.equal(this.type, other.type); + return Objects.equals(this.v0, other.v0) && Objects.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -127,8 +126,7 @@ public byte[] toXdrByteArray() throws IOException { } public static Claimant fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -180,7 +178,7 @@ public static ClaimantV0 decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.destination, this.predicate); + return Objects.hash(this.destination, this.predicate); } @Override @@ -190,14 +188,13 @@ public boolean equals(Object object) { } ClaimantV0 other = (ClaimantV0) object; - return Objects.equal(this.destination, other.destination) - && Objects.equal(this.predicate, other.predicate); + return Objects.equals(this.destination, other.destination) + && Objects.equals(this.predicate, other.predicate); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -209,8 +206,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ClaimantV0 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ClaimantType.java b/src/main/java/org/stellar/sdk/xdr/ClaimantType.java index 3432fcd00..c27943bf3 100644 --- a/src/main/java/org/stellar/sdk/xdr/ClaimantType.java +++ b/src/main/java/org/stellar/sdk/xdr/ClaimantType.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -51,8 +51,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -64,8 +63,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ClaimantType fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ClawbackClaimableBalanceOp.java b/src/main/java/org/stellar/sdk/xdr/ClawbackClaimableBalanceOp.java index 900d16622..e99f07e85 100644 --- a/src/main/java/org/stellar/sdk/xdr/ClawbackClaimableBalanceOp.java +++ b/src/main/java/org/stellar/sdk/xdr/ClawbackClaimableBalanceOp.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -50,7 +50,7 @@ public static ClawbackClaimableBalanceOp decode(XdrDataInputStream stream) throw @Override public int hashCode() { - return Objects.hashCode(this.balanceID); + return Objects.hash(this.balanceID); } @Override @@ -60,13 +60,12 @@ public boolean equals(Object object) { } ClawbackClaimableBalanceOp other = (ClawbackClaimableBalanceOp) object; - return Objects.equal(this.balanceID, other.balanceID); + return Objects.equals(this.balanceID, other.balanceID); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -78,8 +77,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ClawbackClaimableBalanceOp fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ClawbackClaimableBalanceResult.java b/src/main/java/org/stellar/sdk/xdr/ClawbackClaimableBalanceResult.java index 162b55f42..5a1a44e71 100644 --- a/src/main/java/org/stellar/sdk/xdr/ClawbackClaimableBalanceResult.java +++ b/src/main/java/org/stellar/sdk/xdr/ClawbackClaimableBalanceResult.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -94,7 +94,7 @@ public static ClawbackClaimableBalanceResult decode(XdrDataInputStream stream) @Override public int hashCode() { - return Objects.hashCode(this.code); + return Objects.hash(this.code); } @Override @@ -104,13 +104,12 @@ public boolean equals(Object object) { } ClawbackClaimableBalanceResult other = (ClawbackClaimableBalanceResult) object; - return Objects.equal(this.code, other.code); + return Objects.equals(this.code, other.code); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -122,8 +121,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ClawbackClaimableBalanceResult fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ClawbackClaimableBalanceResultCode.java b/src/main/java/org/stellar/sdk/xdr/ClawbackClaimableBalanceResultCode.java index 04d2014a7..6e2e61692 100644 --- a/src/main/java/org/stellar/sdk/xdr/ClawbackClaimableBalanceResultCode.java +++ b/src/main/java/org/stellar/sdk/xdr/ClawbackClaimableBalanceResultCode.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -68,8 +68,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -81,8 +80,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ClawbackClaimableBalanceResultCode fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ClawbackOp.java b/src/main/java/org/stellar/sdk/xdr/ClawbackOp.java index 44a9e7528..4d40bec5b 100644 --- a/src/main/java/org/stellar/sdk/xdr/ClawbackOp.java +++ b/src/main/java/org/stellar/sdk/xdr/ClawbackOp.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -75,7 +75,7 @@ public static ClawbackOp decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.asset, this.from, this.amount); + return Objects.hash(this.asset, this.from, this.amount); } @Override @@ -85,15 +85,14 @@ public boolean equals(Object object) { } ClawbackOp other = (ClawbackOp) object; - return Objects.equal(this.asset, other.asset) - && Objects.equal(this.from, other.from) - && Objects.equal(this.amount, other.amount); + return Objects.equals(this.asset, other.asset) + && Objects.equals(this.from, other.from) + && Objects.equals(this.amount, other.amount); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -105,8 +104,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ClawbackOp fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ClawbackResult.java b/src/main/java/org/stellar/sdk/xdr/ClawbackResult.java index 53c2c8df3..6cebe6245 100644 --- a/src/main/java/org/stellar/sdk/xdr/ClawbackResult.java +++ b/src/main/java/org/stellar/sdk/xdr/ClawbackResult.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -91,7 +91,7 @@ public static ClawbackResult decode(XdrDataInputStream stream) throws IOExceptio @Override public int hashCode() { - return Objects.hashCode(this.code); + return Objects.hash(this.code); } @Override @@ -101,13 +101,12 @@ public boolean equals(Object object) { } ClawbackResult other = (ClawbackResult) object; - return Objects.equal(this.code, other.code); + return Objects.equals(this.code, other.code); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -119,8 +118,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ClawbackResult fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ClawbackResultCode.java b/src/main/java/org/stellar/sdk/xdr/ClawbackResultCode.java index 1aee628e5..576f10642 100644 --- a/src/main/java/org/stellar/sdk/xdr/ClawbackResultCode.java +++ b/src/main/java/org/stellar/sdk/xdr/ClawbackResultCode.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -71,8 +71,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -84,8 +83,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ClawbackResultCode fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ConfigSettingContractBandwidthV0.java b/src/main/java/org/stellar/sdk/xdr/ConfigSettingContractBandwidthV0.java index fd67a882e..48dcd092c 100644 --- a/src/main/java/org/stellar/sdk/xdr/ConfigSettingContractBandwidthV0.java +++ b/src/main/java/org/stellar/sdk/xdr/ConfigSettingContractBandwidthV0.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -83,7 +83,7 @@ public static ConfigSettingContractBandwidthV0 decode(XdrDataInputStream stream) @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.ledgerMaxPropagateSizeBytes, this.txMaxSizeBytes, this.feePropagateData1KB); } @@ -94,15 +94,14 @@ public boolean equals(Object object) { } ConfigSettingContractBandwidthV0 other = (ConfigSettingContractBandwidthV0) object; - return Objects.equal(this.ledgerMaxPropagateSizeBytes, other.ledgerMaxPropagateSizeBytes) - && Objects.equal(this.txMaxSizeBytes, other.txMaxSizeBytes) - && Objects.equal(this.feePropagateData1KB, other.feePropagateData1KB); + return Objects.equals(this.ledgerMaxPropagateSizeBytes, other.ledgerMaxPropagateSizeBytes) + && Objects.equals(this.txMaxSizeBytes, other.txMaxSizeBytes) + && Objects.equals(this.feePropagateData1KB, other.feePropagateData1KB); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -114,8 +113,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ConfigSettingContractBandwidthV0 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ConfigSettingContractComputeV0.java b/src/main/java/org/stellar/sdk/xdr/ConfigSettingContractComputeV0.java index cf721573f..3367bcb41 100644 --- a/src/main/java/org/stellar/sdk/xdr/ConfigSettingContractComputeV0.java +++ b/src/main/java/org/stellar/sdk/xdr/ConfigSettingContractComputeV0.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -98,7 +98,7 @@ public static ConfigSettingContractComputeV0 decode(XdrDataInputStream stream) @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.ledgerMaxInstructions, this.txMaxInstructions, this.feeRatePerInstructionsIncrement, @@ -112,17 +112,16 @@ public boolean equals(Object object) { } ConfigSettingContractComputeV0 other = (ConfigSettingContractComputeV0) object; - return Objects.equal(this.ledgerMaxInstructions, other.ledgerMaxInstructions) - && Objects.equal(this.txMaxInstructions, other.txMaxInstructions) - && Objects.equal( + return Objects.equals(this.ledgerMaxInstructions, other.ledgerMaxInstructions) + && Objects.equals(this.txMaxInstructions, other.txMaxInstructions) + && Objects.equals( this.feeRatePerInstructionsIncrement, other.feeRatePerInstructionsIncrement) - && Objects.equal(this.txMemoryLimit, other.txMemoryLimit); + && Objects.equals(this.txMemoryLimit, other.txMemoryLimit); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -134,8 +133,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ConfigSettingContractComputeV0 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ConfigSettingContractExecutionLanesV0.java b/src/main/java/org/stellar/sdk/xdr/ConfigSettingContractExecutionLanesV0.java index 4e695c2a3..5ff955c77 100644 --- a/src/main/java/org/stellar/sdk/xdr/ConfigSettingContractExecutionLanesV0.java +++ b/src/main/java/org/stellar/sdk/xdr/ConfigSettingContractExecutionLanesV0.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -54,7 +54,7 @@ public static ConfigSettingContractExecutionLanesV0 decode(XdrDataInputStream st @Override public int hashCode() { - return Objects.hashCode(this.ledgerMaxTxCount); + return Objects.hash(this.ledgerMaxTxCount); } @Override @@ -64,13 +64,12 @@ public boolean equals(Object object) { } ConfigSettingContractExecutionLanesV0 other = (ConfigSettingContractExecutionLanesV0) object; - return Objects.equal(this.ledgerMaxTxCount, other.ledgerMaxTxCount); + return Objects.equals(this.ledgerMaxTxCount, other.ledgerMaxTxCount); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -82,8 +81,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ConfigSettingContractExecutionLanesV0 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ConfigSettingContractHistoricalDataV0.java b/src/main/java/org/stellar/sdk/xdr/ConfigSettingContractHistoricalDataV0.java index fe42e4b53..553b78164 100644 --- a/src/main/java/org/stellar/sdk/xdr/ConfigSettingContractHistoricalDataV0.java +++ b/src/main/java/org/stellar/sdk/xdr/ConfigSettingContractHistoricalDataV0.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -53,7 +53,7 @@ public static ConfigSettingContractHistoricalDataV0 decode(XdrDataInputStream st @Override public int hashCode() { - return Objects.hashCode(this.feeHistorical1KB); + return Objects.hash(this.feeHistorical1KB); } @Override @@ -63,13 +63,12 @@ public boolean equals(Object object) { } ConfigSettingContractHistoricalDataV0 other = (ConfigSettingContractHistoricalDataV0) object; - return Objects.equal(this.feeHistorical1KB, other.feeHistorical1KB); + return Objects.equals(this.feeHistorical1KB, other.feeHistorical1KB); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -81,8 +80,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ConfigSettingContractHistoricalDataV0 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ConfigSettingContractLedgerCostV0.java b/src/main/java/org/stellar/sdk/xdr/ConfigSettingContractLedgerCostV0.java index 8880a5582..a074b23b5 100644 --- a/src/main/java/org/stellar/sdk/xdr/ConfigSettingContractLedgerCostV0.java +++ b/src/main/java/org/stellar/sdk/xdr/ConfigSettingContractLedgerCostV0.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -264,7 +264,7 @@ public static ConfigSettingContractLedgerCostV0 decode(XdrDataInputStream stream @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.ledgerMaxReadLedgerEntries, this.ledgerMaxReadBytes, this.ledgerMaxWriteLedgerEntries, @@ -290,28 +290,27 @@ public boolean equals(Object object) { } ConfigSettingContractLedgerCostV0 other = (ConfigSettingContractLedgerCostV0) object; - return Objects.equal(this.ledgerMaxReadLedgerEntries, other.ledgerMaxReadLedgerEntries) - && Objects.equal(this.ledgerMaxReadBytes, other.ledgerMaxReadBytes) - && Objects.equal(this.ledgerMaxWriteLedgerEntries, other.ledgerMaxWriteLedgerEntries) - && Objects.equal(this.ledgerMaxWriteBytes, other.ledgerMaxWriteBytes) - && Objects.equal(this.txMaxReadLedgerEntries, other.txMaxReadLedgerEntries) - && Objects.equal(this.txMaxReadBytes, other.txMaxReadBytes) - && Objects.equal(this.txMaxWriteLedgerEntries, other.txMaxWriteLedgerEntries) - && Objects.equal(this.txMaxWriteBytes, other.txMaxWriteBytes) - && Objects.equal(this.feeReadLedgerEntry, other.feeReadLedgerEntry) - && Objects.equal(this.feeWriteLedgerEntry, other.feeWriteLedgerEntry) - && Objects.equal(this.feeRead1KB, other.feeRead1KB) - && Objects.equal(this.feeWrite1KB, other.feeWrite1KB) - && Objects.equal(this.bucketListSizeBytes, other.bucketListSizeBytes) - && Objects.equal(this.bucketListFeeRateLow, other.bucketListFeeRateLow) - && Objects.equal(this.bucketListFeeRateHigh, other.bucketListFeeRateHigh) - && Objects.equal(this.bucketListGrowthFactor, other.bucketListGrowthFactor); + return Objects.equals(this.ledgerMaxReadLedgerEntries, other.ledgerMaxReadLedgerEntries) + && Objects.equals(this.ledgerMaxReadBytes, other.ledgerMaxReadBytes) + && Objects.equals(this.ledgerMaxWriteLedgerEntries, other.ledgerMaxWriteLedgerEntries) + && Objects.equals(this.ledgerMaxWriteBytes, other.ledgerMaxWriteBytes) + && Objects.equals(this.txMaxReadLedgerEntries, other.txMaxReadLedgerEntries) + && Objects.equals(this.txMaxReadBytes, other.txMaxReadBytes) + && Objects.equals(this.txMaxWriteLedgerEntries, other.txMaxWriteLedgerEntries) + && Objects.equals(this.txMaxWriteBytes, other.txMaxWriteBytes) + && Objects.equals(this.feeReadLedgerEntry, other.feeReadLedgerEntry) + && Objects.equals(this.feeWriteLedgerEntry, other.feeWriteLedgerEntry) + && Objects.equals(this.feeRead1KB, other.feeRead1KB) + && Objects.equals(this.feeWrite1KB, other.feeWrite1KB) + && Objects.equals(this.bucketListSizeBytes, other.bucketListSizeBytes) + && Objects.equals(this.bucketListFeeRateLow, other.bucketListFeeRateLow) + && Objects.equals(this.bucketListFeeRateHigh, other.bucketListFeeRateHigh) + && Objects.equals(this.bucketListGrowthFactor, other.bucketListGrowthFactor); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -323,8 +322,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ConfigSettingContractLedgerCostV0 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ConfigSettingContractMetaDataV0.java b/src/main/java/org/stellar/sdk/xdr/ConfigSettingContractMetaDataV0.java index 3d17551d7..d2f2add8a 100644 --- a/src/main/java/org/stellar/sdk/xdr/ConfigSettingContractMetaDataV0.java +++ b/src/main/java/org/stellar/sdk/xdr/ConfigSettingContractMetaDataV0.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -68,7 +68,7 @@ public static ConfigSettingContractMetaDataV0 decode(XdrDataInputStream stream) @Override public int hashCode() { - return Objects.hashCode(this.txMaxExtendedMetaDataSizeBytes, this.feeExtendedMetaData1KB); + return Objects.hash(this.txMaxExtendedMetaDataSizeBytes, this.feeExtendedMetaData1KB); } @Override @@ -78,14 +78,13 @@ public boolean equals(Object object) { } ConfigSettingContractMetaDataV0 other = (ConfigSettingContractMetaDataV0) object; - return Objects.equal(this.txMaxExtendedMetaDataSizeBytes, other.txMaxExtendedMetaDataSizeBytes) - && Objects.equal(this.feeExtendedMetaData1KB, other.feeExtendedMetaData1KB); + return Objects.equals(this.txMaxExtendedMetaDataSizeBytes, other.txMaxExtendedMetaDataSizeBytes) + && Objects.equals(this.feeExtendedMetaData1KB, other.feeExtendedMetaData1KB); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -97,8 +96,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ConfigSettingContractMetaDataV0 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ConfigSettingEntry.java b/src/main/java/org/stellar/sdk/xdr/ConfigSettingEntry.java index 2a576ebe9..eef08fa01 100644 --- a/src/main/java/org/stellar/sdk/xdr/ConfigSettingEntry.java +++ b/src/main/java/org/stellar/sdk/xdr/ConfigSettingEntry.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -414,7 +414,7 @@ public static ConfigSettingEntry decode(XdrDataInputStream stream) throws IOExce @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.contractMaxSizeBytes, this.contractCompute, this.contractLedgerCost, @@ -438,26 +438,25 @@ public boolean equals(Object object) { } ConfigSettingEntry other = (ConfigSettingEntry) object; - return Objects.equal(this.contractMaxSizeBytes, other.contractMaxSizeBytes) - && Objects.equal(this.contractCompute, other.contractCompute) - && Objects.equal(this.contractLedgerCost, other.contractLedgerCost) - && Objects.equal(this.contractHistoricalData, other.contractHistoricalData) - && Objects.equal(this.contractMetaData, other.contractMetaData) - && Objects.equal(this.contractBandwidth, other.contractBandwidth) - && Objects.equal(this.contractCostParamsCpuInsns, other.contractCostParamsCpuInsns) - && Objects.equal(this.contractCostParamsMemBytes, other.contractCostParamsMemBytes) - && Objects.equal(this.contractDataKeySizeBytes, other.contractDataKeySizeBytes) - && Objects.equal(this.contractDataEntrySizeBytes, other.contractDataEntrySizeBytes) - && Objects.equal(this.stateExpirationSettings, other.stateExpirationSettings) - && Objects.equal(this.contractExecutionLanes, other.contractExecutionLanes) + return Objects.equals(this.contractMaxSizeBytes, other.contractMaxSizeBytes) + && Objects.equals(this.contractCompute, other.contractCompute) + && Objects.equals(this.contractLedgerCost, other.contractLedgerCost) + && Objects.equals(this.contractHistoricalData, other.contractHistoricalData) + && Objects.equals(this.contractMetaData, other.contractMetaData) + && Objects.equals(this.contractBandwidth, other.contractBandwidth) + && Objects.equals(this.contractCostParamsCpuInsns, other.contractCostParamsCpuInsns) + && Objects.equals(this.contractCostParamsMemBytes, other.contractCostParamsMemBytes) + && Objects.equals(this.contractDataKeySizeBytes, other.contractDataKeySizeBytes) + && Objects.equals(this.contractDataEntrySizeBytes, other.contractDataEntrySizeBytes) + && Objects.equals(this.stateExpirationSettings, other.stateExpirationSettings) + && Objects.equals(this.contractExecutionLanes, other.contractExecutionLanes) && Arrays.equals(this.bucketListSizeWindow, other.bucketListSizeWindow) - && Objects.equal(this.configSettingID, other.configSettingID); + && Objects.equals(this.configSettingID, other.configSettingID); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -469,8 +468,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ConfigSettingEntry fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ConfigSettingID.java b/src/main/java/org/stellar/sdk/xdr/ConfigSettingID.java index 7cd979a66..ce21fe6cc 100644 --- a/src/main/java/org/stellar/sdk/xdr/ConfigSettingID.java +++ b/src/main/java/org/stellar/sdk/xdr/ConfigSettingID.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -99,8 +99,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -112,8 +111,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ConfigSettingID fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ConfigUpgradeSet.java b/src/main/java/org/stellar/sdk/xdr/ConfigUpgradeSet.java index 35f990000..4017cf0f6 100644 --- a/src/main/java/org/stellar/sdk/xdr/ConfigUpgradeSet.java +++ b/src/main/java/org/stellar/sdk/xdr/ConfigUpgradeSet.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; // === xdr source ============================================================ @@ -71,8 +71,7 @@ public boolean equals(Object object) { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -84,8 +83,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ConfigUpgradeSet fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ConfigUpgradeSetKey.java b/src/main/java/org/stellar/sdk/xdr/ConfigUpgradeSetKey.java index 0d10ff674..e43f450da 100644 --- a/src/main/java/org/stellar/sdk/xdr/ConfigUpgradeSetKey.java +++ b/src/main/java/org/stellar/sdk/xdr/ConfigUpgradeSetKey.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -62,7 +62,7 @@ public static ConfigUpgradeSetKey decode(XdrDataInputStream stream) throws IOExc @Override public int hashCode() { - return Objects.hashCode(this.contractID, this.contentHash); + return Objects.hash(this.contractID, this.contentHash); } @Override @@ -72,14 +72,13 @@ public boolean equals(Object object) { } ConfigUpgradeSetKey other = (ConfigUpgradeSetKey) object; - return Objects.equal(this.contractID, other.contractID) - && Objects.equal(this.contentHash, other.contentHash); + return Objects.equals(this.contractID, other.contractID) + && Objects.equals(this.contentHash, other.contentHash); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -91,8 +90,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ConfigUpgradeSetKey fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ContractCodeEntry.java b/src/main/java/org/stellar/sdk/xdr/ContractCodeEntry.java index 0035614b0..96410c85a 100644 --- a/src/main/java/org/stellar/sdk/xdr/ContractCodeEntry.java +++ b/src/main/java/org/stellar/sdk/xdr/ContractCodeEntry.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -96,7 +96,7 @@ public static ContractCodeEntry decode(XdrDataInputStream stream) throws IOExcep @Override public int hashCode() { - return Objects.hashCode(this.ext, this.hash, this.body, this.expirationLedgerSeq); + return Objects.hash(this.ext, this.hash, this.body, this.expirationLedgerSeq); } @Override @@ -106,16 +106,15 @@ public boolean equals(Object object) { } ContractCodeEntry other = (ContractCodeEntry) object; - return Objects.equal(this.ext, other.ext) - && Objects.equal(this.hash, other.hash) - && Objects.equal(this.body, other.body) - && Objects.equal(this.expirationLedgerSeq, other.expirationLedgerSeq); + return Objects.equals(this.ext, other.ext) + && Objects.equals(this.hash, other.hash) + && Objects.equals(this.body, other.body) + && Objects.equals(this.expirationLedgerSeq, other.expirationLedgerSeq); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -127,8 +126,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ContractCodeEntry fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -258,7 +256,7 @@ public static ContractCodeEntryBody decode(XdrDataInputStream stream) throws IOE @Override public int hashCode() { - return Objects.hashCode(Arrays.hashCode(this.code), this.bodyType); + return Objects.hash(Arrays.hashCode(this.code), this.bodyType); } @Override @@ -268,13 +266,12 @@ public boolean equals(Object object) { } ContractCodeEntryBody other = (ContractCodeEntryBody) object; - return Arrays.equals(this.code, other.code) && Objects.equal(this.bodyType, other.bodyType); + return Arrays.equals(this.code, other.code) && Objects.equals(this.bodyType, other.bodyType); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -286,8 +283,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ContractCodeEntryBody fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ContractCostParamEntry.java b/src/main/java/org/stellar/sdk/xdr/ContractCostParamEntry.java index 062868a05..7cef7a241 100644 --- a/src/main/java/org/stellar/sdk/xdr/ContractCostParamEntry.java +++ b/src/main/java/org/stellar/sdk/xdr/ContractCostParamEntry.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -77,7 +77,7 @@ public static ContractCostParamEntry decode(XdrDataInputStream stream) throws IO @Override public int hashCode() { - return Objects.hashCode(this.ext, this.constTerm, this.linearTerm); + return Objects.hash(this.ext, this.constTerm, this.linearTerm); } @Override @@ -87,15 +87,14 @@ public boolean equals(Object object) { } ContractCostParamEntry other = (ContractCostParamEntry) object; - return Objects.equal(this.ext, other.ext) - && Objects.equal(this.constTerm, other.constTerm) - && Objects.equal(this.linearTerm, other.linearTerm); + return Objects.equals(this.ext, other.ext) + && Objects.equals(this.constTerm, other.constTerm) + && Objects.equals(this.linearTerm, other.linearTerm); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -107,8 +106,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ContractCostParamEntry fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ContractCostParams.java b/src/main/java/org/stellar/sdk/xdr/ContractCostParams.java index 4c5654b11..203b067db 100644 --- a/src/main/java/org/stellar/sdk/xdr/ContractCostParams.java +++ b/src/main/java/org/stellar/sdk/xdr/ContractCostParams.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; // === xdr source ============================================================ @@ -74,8 +74,7 @@ public boolean equals(Object object) { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -87,8 +86,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ContractCostParams fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ContractCostType.java b/src/main/java/org/stellar/sdk/xdr/ContractCostType.java index 645779b4a..26b4e0fb8 100644 --- a/src/main/java/org/stellar/sdk/xdr/ContractCostType.java +++ b/src/main/java/org/stellar/sdk/xdr/ContractCostType.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -206,8 +206,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -219,8 +218,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ContractCostType fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ContractDataDurability.java b/src/main/java/org/stellar/sdk/xdr/ContractDataDurability.java index a286b47a9..7a7f8032d 100644 --- a/src/main/java/org/stellar/sdk/xdr/ContractDataDurability.java +++ b/src/main/java/org/stellar/sdk/xdr/ContractDataDurability.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -55,8 +55,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -68,8 +67,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ContractDataDurability fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ContractDataEntry.java b/src/main/java/org/stellar/sdk/xdr/ContractDataEntry.java index e6e3e82b3..f76bc5d8d 100644 --- a/src/main/java/org/stellar/sdk/xdr/ContractDataEntry.java +++ b/src/main/java/org/stellar/sdk/xdr/ContractDataEntry.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -112,7 +112,7 @@ public static ContractDataEntry decode(XdrDataInputStream stream) throws IOExcep @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.contract, this.key, this.durability, this.body, this.expirationLedgerSeq); } @@ -123,17 +123,16 @@ public boolean equals(Object object) { } ContractDataEntry other = (ContractDataEntry) object; - return Objects.equal(this.contract, other.contract) - && Objects.equal(this.key, other.key) - && Objects.equal(this.durability, other.durability) - && Objects.equal(this.body, other.body) - && Objects.equal(this.expirationLedgerSeq, other.expirationLedgerSeq); + return Objects.equals(this.contract, other.contract) + && Objects.equals(this.key, other.key) + && Objects.equals(this.durability, other.durability) + && Objects.equals(this.body, other.body) + && Objects.equals(this.expirationLedgerSeq, other.expirationLedgerSeq); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -145,8 +144,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ContractDataEntry fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -279,7 +277,7 @@ public static ContractDataEntryBody decode(XdrDataInputStream stream) throws IOE @Override public int hashCode() { - return Objects.hashCode(this.data, this.bodyType); + return Objects.hash(this.data, this.bodyType); } @Override @@ -289,13 +287,12 @@ public boolean equals(Object object) { } ContractDataEntryBody other = (ContractDataEntryBody) object; - return Objects.equal(this.data, other.data) && Objects.equal(this.bodyType, other.bodyType); + return Objects.equals(this.data, other.data) && Objects.equals(this.bodyType, other.bodyType); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -307,8 +304,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ContractDataEntryBody fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -361,7 +357,7 @@ public static ContractDataEntryData decode(XdrDataInputStream stream) throws IOE @Override public int hashCode() { - return Objects.hashCode(this.flags, this.val); + return Objects.hash(this.flags, this.val); } @Override @@ -371,13 +367,12 @@ public boolean equals(Object object) { } ContractDataEntryData other = (ContractDataEntryData) object; - return Objects.equal(this.flags, other.flags) && Objects.equal(this.val, other.val); + return Objects.equals(this.flags, other.flags) && Objects.equals(this.val, other.val); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -389,8 +384,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ContractDataEntryData fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ContractDataFlags.java b/src/main/java/org/stellar/sdk/xdr/ContractDataFlags.java index 0e20ed10a..8a304ce06 100644 --- a/src/main/java/org/stellar/sdk/xdr/ContractDataFlags.java +++ b/src/main/java/org/stellar/sdk/xdr/ContractDataFlags.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -53,8 +53,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -66,8 +65,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ContractDataFlags fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ContractEntryBodyType.java b/src/main/java/org/stellar/sdk/xdr/ContractEntryBodyType.java index 9bf5b1f89..4737417e9 100644 --- a/src/main/java/org/stellar/sdk/xdr/ContractEntryBodyType.java +++ b/src/main/java/org/stellar/sdk/xdr/ContractEntryBodyType.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -55,8 +55,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -68,8 +67,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ContractEntryBodyType fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ContractEvent.java b/src/main/java/org/stellar/sdk/xdr/ContractEvent.java index 5bc8e9287..71a2e27ef 100644 --- a/src/main/java/org/stellar/sdk/xdr/ContractEvent.java +++ b/src/main/java/org/stellar/sdk/xdr/ContractEvent.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -109,7 +109,7 @@ public static ContractEvent decode(XdrDataInputStream stream) throws IOException @Override public int hashCode() { - return Objects.hashCode(this.ext, this.contractID, this.type, this.body); + return Objects.hash(this.ext, this.contractID, this.type, this.body); } @Override @@ -119,16 +119,15 @@ public boolean equals(Object object) { } ContractEvent other = (ContractEvent) object; - return Objects.equal(this.ext, other.ext) - && Objects.equal(this.contractID, other.contractID) - && Objects.equal(this.type, other.type) - && Objects.equal(this.body, other.body); + return Objects.equals(this.ext, other.ext) + && Objects.equals(this.contractID, other.contractID) + && Objects.equals(this.type, other.type) + && Objects.equals(this.body, other.body); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -140,8 +139,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ContractEvent fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -262,7 +260,7 @@ public static ContractEventBody decode(XdrDataInputStream stream) throws IOExcep @Override public int hashCode() { - return Objects.hashCode(this.v0, this.v); + return Objects.hash(this.v0, this.v); } @Override @@ -272,13 +270,12 @@ public boolean equals(Object object) { } ContractEventBody other = (ContractEventBody) object; - return Objects.equal(this.v0, other.v0) && Objects.equal(this.v, other.v); + return Objects.equals(this.v0, other.v0) && Objects.equals(this.v, other.v); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -290,8 +287,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ContractEventBody fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -343,7 +339,7 @@ public static ContractEventV0 decode(XdrDataInputStream stream) throws IOExcepti @Override public int hashCode() { - return Objects.hashCode(this.topics, this.data); + return Objects.hash(this.topics, this.data); } @Override @@ -353,13 +349,12 @@ public boolean equals(Object object) { } ContractEventV0 other = (ContractEventV0) object; - return Objects.equal(this.topics, other.topics) && Objects.equal(this.data, other.data); + return Objects.equals(this.topics, other.topics) && Objects.equals(this.data, other.data); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -371,8 +366,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ContractEventV0 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ContractEventType.java b/src/main/java/org/stellar/sdk/xdr/ContractEventType.java index 19adb659c..21d202ea8 100644 --- a/src/main/java/org/stellar/sdk/xdr/ContractEventType.java +++ b/src/main/java/org/stellar/sdk/xdr/ContractEventType.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -60,8 +60,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -73,8 +72,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ContractEventType fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ContractExecutable.java b/src/main/java/org/stellar/sdk/xdr/ContractExecutable.java index 889f9274f..8007fcbd8 100644 --- a/src/main/java/org/stellar/sdk/xdr/ContractExecutable.java +++ b/src/main/java/org/stellar/sdk/xdr/ContractExecutable.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -101,7 +101,7 @@ public static ContractExecutable decode(XdrDataInputStream stream) throws IOExce @Override public int hashCode() { - return Objects.hashCode(this.wasm_hash, this.type); + return Objects.hash(this.wasm_hash, this.type); } @Override @@ -111,13 +111,12 @@ public boolean equals(Object object) { } ContractExecutable other = (ContractExecutable) object; - return Objects.equal(this.wasm_hash, other.wasm_hash) && Objects.equal(this.type, other.type); + return Objects.equals(this.wasm_hash, other.wasm_hash) && Objects.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -129,8 +128,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ContractExecutable fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ContractExecutableType.java b/src/main/java/org/stellar/sdk/xdr/ContractExecutableType.java index 4670c06ed..76c59da2b 100644 --- a/src/main/java/org/stellar/sdk/xdr/ContractExecutableType.java +++ b/src/main/java/org/stellar/sdk/xdr/ContractExecutableType.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -56,8 +56,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -69,8 +68,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ContractExecutableType fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ContractIDPreimage.java b/src/main/java/org/stellar/sdk/xdr/ContractIDPreimage.java index b264111c9..ff8dfdff9 100644 --- a/src/main/java/org/stellar/sdk/xdr/ContractIDPreimage.java +++ b/src/main/java/org/stellar/sdk/xdr/ContractIDPreimage.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -124,7 +124,7 @@ public static ContractIDPreimage decode(XdrDataInputStream stream) throws IOExce @Override public int hashCode() { - return Objects.hashCode(this.fromAddress, this.fromAsset, this.type); + return Objects.hash(this.fromAddress, this.fromAsset, this.type); } @Override @@ -134,15 +134,14 @@ public boolean equals(Object object) { } ContractIDPreimage other = (ContractIDPreimage) object; - return Objects.equal(this.fromAddress, other.fromAddress) - && Objects.equal(this.fromAsset, other.fromAsset) - && Objects.equal(this.type, other.type); + return Objects.equals(this.fromAddress, other.fromAddress) + && Objects.equals(this.fromAsset, other.fromAsset) + && Objects.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -154,8 +153,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ContractIDPreimage fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -211,7 +209,7 @@ public static ContractIDPreimageFromAddress decode(XdrDataInputStream stream) @Override public int hashCode() { - return Objects.hashCode(this.address, this.salt); + return Objects.hash(this.address, this.salt); } @Override @@ -221,13 +219,12 @@ public boolean equals(Object object) { } ContractIDPreimageFromAddress other = (ContractIDPreimageFromAddress) object; - return Objects.equal(this.address, other.address) && Objects.equal(this.salt, other.salt); + return Objects.equals(this.address, other.address) && Objects.equals(this.salt, other.salt); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -239,8 +236,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ContractIDPreimageFromAddress fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ContractIDPreimageType.java b/src/main/java/org/stellar/sdk/xdr/ContractIDPreimageType.java index ef49dd359..a9a113e0e 100644 --- a/src/main/java/org/stellar/sdk/xdr/ContractIDPreimageType.java +++ b/src/main/java/org/stellar/sdk/xdr/ContractIDPreimageType.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -56,8 +56,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -69,8 +68,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ContractIDPreimageType fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/CreateAccountOp.java b/src/main/java/org/stellar/sdk/xdr/CreateAccountOp.java index 12ced4a18..11d84b9a7 100644 --- a/src/main/java/org/stellar/sdk/xdr/CreateAccountOp.java +++ b/src/main/java/org/stellar/sdk/xdr/CreateAccountOp.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -62,7 +62,7 @@ public static CreateAccountOp decode(XdrDataInputStream stream) throws IOExcepti @Override public int hashCode() { - return Objects.hashCode(this.destination, this.startingBalance); + return Objects.hash(this.destination, this.startingBalance); } @Override @@ -72,14 +72,13 @@ public boolean equals(Object object) { } CreateAccountOp other = (CreateAccountOp) object; - return Objects.equal(this.destination, other.destination) - && Objects.equal(this.startingBalance, other.startingBalance); + return Objects.equals(this.destination, other.destination) + && Objects.equals(this.startingBalance, other.startingBalance); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -91,8 +90,7 @@ public byte[] toXdrByteArray() throws IOException { } public static CreateAccountOp fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/CreateAccountResult.java b/src/main/java/org/stellar/sdk/xdr/CreateAccountResult.java index c4052db18..2ed001166 100644 --- a/src/main/java/org/stellar/sdk/xdr/CreateAccountResult.java +++ b/src/main/java/org/stellar/sdk/xdr/CreateAccountResult.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -92,7 +92,7 @@ public static CreateAccountResult decode(XdrDataInputStream stream) throws IOExc @Override public int hashCode() { - return Objects.hashCode(this.code); + return Objects.hash(this.code); } @Override @@ -102,13 +102,12 @@ public boolean equals(Object object) { } CreateAccountResult other = (CreateAccountResult) object; - return Objects.equal(this.code, other.code); + return Objects.equals(this.code, other.code); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -120,8 +119,7 @@ public byte[] toXdrByteArray() throws IOException { } public static CreateAccountResult fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/CreateAccountResultCode.java b/src/main/java/org/stellar/sdk/xdr/CreateAccountResultCode.java index 80356ab87..dde756a97 100644 --- a/src/main/java/org/stellar/sdk/xdr/CreateAccountResultCode.java +++ b/src/main/java/org/stellar/sdk/xdr/CreateAccountResultCode.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -72,8 +72,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -85,8 +84,7 @@ public byte[] toXdrByteArray() throws IOException { } public static CreateAccountResultCode fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/CreateClaimableBalanceOp.java b/src/main/java/org/stellar/sdk/xdr/CreateClaimableBalanceOp.java index fd088563d..4a428218c 100644 --- a/src/main/java/org/stellar/sdk/xdr/CreateClaimableBalanceOp.java +++ b/src/main/java/org/stellar/sdk/xdr/CreateClaimableBalanceOp.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -85,7 +85,7 @@ public static CreateClaimableBalanceOp decode(XdrDataInputStream stream) throws @Override public int hashCode() { - return Objects.hashCode(this.asset, this.amount, Arrays.hashCode(this.claimants)); + return Objects.hash(this.asset, this.amount, Arrays.hashCode(this.claimants)); } @Override @@ -95,15 +95,14 @@ public boolean equals(Object object) { } CreateClaimableBalanceOp other = (CreateClaimableBalanceOp) object; - return Objects.equal(this.asset, other.asset) - && Objects.equal(this.amount, other.amount) + return Objects.equals(this.asset, other.asset) + && Objects.equals(this.amount, other.amount) && Arrays.equals(this.claimants, other.claimants); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -115,8 +114,7 @@ public byte[] toXdrByteArray() throws IOException { } public static CreateClaimableBalanceOp fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/CreateClaimableBalanceResult.java b/src/main/java/org/stellar/sdk/xdr/CreateClaimableBalanceResult.java index b77bcf6e6..98ded2563 100644 --- a/src/main/java/org/stellar/sdk/xdr/CreateClaimableBalanceResult.java +++ b/src/main/java/org/stellar/sdk/xdr/CreateClaimableBalanceResult.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -116,7 +116,7 @@ public static CreateClaimableBalanceResult decode(XdrDataInputStream stream) thr @Override public int hashCode() { - return Objects.hashCode(this.balanceID, this.code); + return Objects.hash(this.balanceID, this.code); } @Override @@ -126,13 +126,12 @@ public boolean equals(Object object) { } CreateClaimableBalanceResult other = (CreateClaimableBalanceResult) object; - return Objects.equal(this.balanceID, other.balanceID) && Objects.equal(this.code, other.code); + return Objects.equals(this.balanceID, other.balanceID) && Objects.equals(this.code, other.code); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -144,8 +143,7 @@ public byte[] toXdrByteArray() throws IOException { } public static CreateClaimableBalanceResult fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/CreateClaimableBalanceResultCode.java b/src/main/java/org/stellar/sdk/xdr/CreateClaimableBalanceResultCode.java index 043255af4..b19e0e98e 100644 --- a/src/main/java/org/stellar/sdk/xdr/CreateClaimableBalanceResultCode.java +++ b/src/main/java/org/stellar/sdk/xdr/CreateClaimableBalanceResultCode.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -73,8 +73,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -86,8 +85,7 @@ public byte[] toXdrByteArray() throws IOException { } public static CreateClaimableBalanceResultCode fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/CreateContractArgs.java b/src/main/java/org/stellar/sdk/xdr/CreateContractArgs.java index 7caeb531e..0d7cce8f4 100644 --- a/src/main/java/org/stellar/sdk/xdr/CreateContractArgs.java +++ b/src/main/java/org/stellar/sdk/xdr/CreateContractArgs.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -62,7 +62,7 @@ public static CreateContractArgs decode(XdrDataInputStream stream) throws IOExce @Override public int hashCode() { - return Objects.hashCode(this.contractIDPreimage, this.executable); + return Objects.hash(this.contractIDPreimage, this.executable); } @Override @@ -72,14 +72,13 @@ public boolean equals(Object object) { } CreateContractArgs other = (CreateContractArgs) object; - return Objects.equal(this.contractIDPreimage, other.contractIDPreimage) - && Objects.equal(this.executable, other.executable); + return Objects.equals(this.contractIDPreimage, other.contractIDPreimage) + && Objects.equals(this.executable, other.executable); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -91,8 +90,7 @@ public byte[] toXdrByteArray() throws IOException { } public static CreateContractArgs fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/CreatePassiveSellOfferOp.java b/src/main/java/org/stellar/sdk/xdr/CreatePassiveSellOfferOp.java index 1112b6421..0d8e0a90b 100644 --- a/src/main/java/org/stellar/sdk/xdr/CreatePassiveSellOfferOp.java +++ b/src/main/java/org/stellar/sdk/xdr/CreatePassiveSellOfferOp.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -89,7 +89,7 @@ public static CreatePassiveSellOfferOp decode(XdrDataInputStream stream) throws @Override public int hashCode() { - return Objects.hashCode(this.selling, this.buying, this.amount, this.price); + return Objects.hash(this.selling, this.buying, this.amount, this.price); } @Override @@ -99,16 +99,15 @@ public boolean equals(Object object) { } CreatePassiveSellOfferOp other = (CreatePassiveSellOfferOp) object; - return Objects.equal(this.selling, other.selling) - && Objects.equal(this.buying, other.buying) - && Objects.equal(this.amount, other.amount) - && Objects.equal(this.price, other.price); + return Objects.equals(this.selling, other.selling) + && Objects.equals(this.buying, other.buying) + && Objects.equals(this.amount, other.amount) + && Objects.equals(this.price, other.price); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -120,8 +119,7 @@ public byte[] toXdrByteArray() throws IOException { } public static CreatePassiveSellOfferOp fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/CryptoKeyType.java b/src/main/java/org/stellar/sdk/xdr/CryptoKeyType.java index 518ded557..80509f5d7 100644 --- a/src/main/java/org/stellar/sdk/xdr/CryptoKeyType.java +++ b/src/main/java/org/stellar/sdk/xdr/CryptoKeyType.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -69,8 +69,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -82,8 +81,7 @@ public byte[] toXdrByteArray() throws IOException { } public static CryptoKeyType fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/Curve25519Public.java b/src/main/java/org/stellar/sdk/xdr/Curve25519Public.java index 3e43fffed..b94746477 100644 --- a/src/main/java/org/stellar/sdk/xdr/Curve25519Public.java +++ b/src/main/java/org/stellar/sdk/xdr/Curve25519Public.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; // === xdr source ============================================================ @@ -67,8 +67,7 @@ public boolean equals(Object object) { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -80,8 +79,7 @@ public byte[] toXdrByteArray() throws IOException { } public static Curve25519Public fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/Curve25519Secret.java b/src/main/java/org/stellar/sdk/xdr/Curve25519Secret.java index 90ea87d2a..1b4e2ec51 100644 --- a/src/main/java/org/stellar/sdk/xdr/Curve25519Secret.java +++ b/src/main/java/org/stellar/sdk/xdr/Curve25519Secret.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; // === xdr source ============================================================ @@ -67,8 +67,7 @@ public boolean equals(Object object) { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -80,8 +79,7 @@ public byte[] toXdrByteArray() throws IOException { } public static Curve25519Secret fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/DataEntry.java b/src/main/java/org/stellar/sdk/xdr/DataEntry.java index d00de786b..4b279752d 100644 --- a/src/main/java/org/stellar/sdk/xdr/DataEntry.java +++ b/src/main/java/org/stellar/sdk/xdr/DataEntry.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -95,7 +95,7 @@ public static DataEntry decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.accountID, this.dataName, this.dataValue, this.ext); + return Objects.hash(this.accountID, this.dataName, this.dataValue, this.ext); } @Override @@ -105,16 +105,15 @@ public boolean equals(Object object) { } DataEntry other = (DataEntry) object; - return Objects.equal(this.accountID, other.accountID) - && Objects.equal(this.dataName, other.dataName) - && Objects.equal(this.dataValue, other.dataValue) - && Objects.equal(this.ext, other.ext); + return Objects.equals(this.accountID, other.accountID) + && Objects.equals(this.dataName, other.dataName) + && Objects.equals(this.dataValue, other.dataValue) + && Objects.equals(this.ext, other.ext); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -126,8 +125,7 @@ public byte[] toXdrByteArray() throws IOException { } public static DataEntry fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -229,7 +227,7 @@ public static DataEntryExt decode(XdrDataInputStream stream) throws IOException @Override public int hashCode() { - return Objects.hashCode(this.v); + return Objects.hash(this.v); } @Override @@ -239,13 +237,12 @@ public boolean equals(Object object) { } DataEntryExt other = (DataEntryExt) object; - return Objects.equal(this.v, other.v); + return Objects.equals(this.v, other.v); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -257,8 +254,7 @@ public byte[] toXdrByteArray() throws IOException { } public static DataEntryExt fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/DataValue.java b/src/main/java/org/stellar/sdk/xdr/DataValue.java index 7d3e0aed6..433a40782 100644 --- a/src/main/java/org/stellar/sdk/xdr/DataValue.java +++ b/src/main/java/org/stellar/sdk/xdr/DataValue.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; // === xdr source ============================================================ @@ -69,8 +69,7 @@ public boolean equals(Object object) { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -82,8 +81,7 @@ public byte[] toXdrByteArray() throws IOException { } public static DataValue fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/DecoratedSignature.java b/src/main/java/org/stellar/sdk/xdr/DecoratedSignature.java index 80b1728b9..48d3be132 100644 --- a/src/main/java/org/stellar/sdk/xdr/DecoratedSignature.java +++ b/src/main/java/org/stellar/sdk/xdr/DecoratedSignature.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -62,7 +62,7 @@ public static DecoratedSignature decode(XdrDataInputStream stream) throws IOExce @Override public int hashCode() { - return Objects.hashCode(this.hint, this.signature); + return Objects.hash(this.hint, this.signature); } @Override @@ -72,13 +72,12 @@ public boolean equals(Object object) { } DecoratedSignature other = (DecoratedSignature) object; - return Objects.equal(this.hint, other.hint) && Objects.equal(this.signature, other.signature); + return Objects.equals(this.hint, other.hint) && Objects.equals(this.signature, other.signature); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -90,8 +89,7 @@ public byte[] toXdrByteArray() throws IOException { } public static DecoratedSignature fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/DiagnosticEvent.java b/src/main/java/org/stellar/sdk/xdr/DiagnosticEvent.java index 735a2eddb..2479f2428 100644 --- a/src/main/java/org/stellar/sdk/xdr/DiagnosticEvent.java +++ b/src/main/java/org/stellar/sdk/xdr/DiagnosticEvent.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -62,7 +62,7 @@ public static DiagnosticEvent decode(XdrDataInputStream stream) throws IOExcepti @Override public int hashCode() { - return Objects.hashCode(this.inSuccessfulContractCall, this.event); + return Objects.hash(this.inSuccessfulContractCall, this.event); } @Override @@ -72,14 +72,13 @@ public boolean equals(Object object) { } DiagnosticEvent other = (DiagnosticEvent) object; - return Objects.equal(this.inSuccessfulContractCall, other.inSuccessfulContractCall) - && Objects.equal(this.event, other.event); + return Objects.equals(this.inSuccessfulContractCall, other.inSuccessfulContractCall) + && Objects.equals(this.event, other.event); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -91,8 +90,7 @@ public byte[] toXdrByteArray() throws IOException { } public static DiagnosticEvent fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/DontHave.java b/src/main/java/org/stellar/sdk/xdr/DontHave.java index 2952ea1c2..0174ec9a8 100644 --- a/src/main/java/org/stellar/sdk/xdr/DontHave.java +++ b/src/main/java/org/stellar/sdk/xdr/DontHave.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -62,7 +62,7 @@ public static DontHave decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.type, this.reqHash); + return Objects.hash(this.type, this.reqHash); } @Override @@ -72,13 +72,12 @@ public boolean equals(Object object) { } DontHave other = (DontHave) object; - return Objects.equal(this.type, other.type) && Objects.equal(this.reqHash, other.reqHash); + return Objects.equals(this.type, other.type) && Objects.equals(this.reqHash, other.reqHash); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -90,8 +89,7 @@ public byte[] toXdrByteArray() throws IOException { } public static DontHave fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/Duration.java b/src/main/java/org/stellar/sdk/xdr/Duration.java index bb740d7f9..850afd980 100644 --- a/src/main/java/org/stellar/sdk/xdr/Duration.java +++ b/src/main/java/org/stellar/sdk/xdr/Duration.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -50,7 +50,7 @@ public static Duration decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.Duration); + return Objects.hash(this.Duration); } @Override @@ -60,13 +60,12 @@ public boolean equals(Object object) { } Duration other = (Duration) object; - return Objects.equal(this.Duration, other.Duration); + return Objects.equals(this.Duration, other.Duration); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -78,8 +77,7 @@ public byte[] toXdrByteArray() throws IOException { } public static Duration fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/EncryptedBody.java b/src/main/java/org/stellar/sdk/xdr/EncryptedBody.java index 980f98085..195f3bbdb 100644 --- a/src/main/java/org/stellar/sdk/xdr/EncryptedBody.java +++ b/src/main/java/org/stellar/sdk/xdr/EncryptedBody.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; // === xdr source ============================================================ @@ -69,8 +69,7 @@ public boolean equals(Object object) { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -82,8 +81,7 @@ public byte[] toXdrByteArray() throws IOException { } public static EncryptedBody fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/EndSponsoringFutureReservesResult.java b/src/main/java/org/stellar/sdk/xdr/EndSponsoringFutureReservesResult.java index ed2ee43b6..90123a3e7 100644 --- a/src/main/java/org/stellar/sdk/xdr/EndSponsoringFutureReservesResult.java +++ b/src/main/java/org/stellar/sdk/xdr/EndSponsoringFutureReservesResult.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -88,7 +88,7 @@ public static EndSponsoringFutureReservesResult decode(XdrDataInputStream stream @Override public int hashCode() { - return Objects.hashCode(this.code); + return Objects.hash(this.code); } @Override @@ -98,13 +98,12 @@ public boolean equals(Object object) { } EndSponsoringFutureReservesResult other = (EndSponsoringFutureReservesResult) object; - return Objects.equal(this.code, other.code); + return Objects.equals(this.code, other.code); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -116,8 +115,7 @@ public byte[] toXdrByteArray() throws IOException { } public static EndSponsoringFutureReservesResult fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/EndSponsoringFutureReservesResultCode.java b/src/main/java/org/stellar/sdk/xdr/EndSponsoringFutureReservesResultCode.java index 861615933..1d51c8c41 100644 --- a/src/main/java/org/stellar/sdk/xdr/EndSponsoringFutureReservesResultCode.java +++ b/src/main/java/org/stellar/sdk/xdr/EndSponsoringFutureReservesResultCode.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -60,8 +60,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -73,8 +72,7 @@ public byte[] toXdrByteArray() throws IOException { } public static EndSponsoringFutureReservesResultCode fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/EnvelopeType.java b/src/main/java/org/stellar/sdk/xdr/EnvelopeType.java index 98a9505d9..cda5a5a0d 100644 --- a/src/main/java/org/stellar/sdk/xdr/EnvelopeType.java +++ b/src/main/java/org/stellar/sdk/xdr/EnvelopeType.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -87,8 +87,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -100,8 +99,7 @@ public byte[] toXdrByteArray() throws IOException { } public static EnvelopeType fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/Error.java b/src/main/java/org/stellar/sdk/xdr/Error.java index c1fd69dfb..8cd781329 100644 --- a/src/main/java/org/stellar/sdk/xdr/Error.java +++ b/src/main/java/org/stellar/sdk/xdr/Error.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -61,7 +61,7 @@ public static Error decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.code, this.msg); + return Objects.hash(this.code, this.msg); } @Override @@ -71,13 +71,12 @@ public boolean equals(Object object) { } Error other = (Error) object; - return Objects.equal(this.code, other.code) && Objects.equal(this.msg, other.msg); + return Objects.equals(this.code, other.code) && Objects.equals(this.msg, other.msg); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -89,8 +88,7 @@ public byte[] toXdrByteArray() throws IOException { } public static Error fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ErrorCode.java b/src/main/java/org/stellar/sdk/xdr/ErrorCode.java index b5131668f..87e1cb529 100644 --- a/src/main/java/org/stellar/sdk/xdr/ErrorCode.java +++ b/src/main/java/org/stellar/sdk/xdr/ErrorCode.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -67,8 +67,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -80,8 +79,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ErrorCode fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ExtensionPoint.java b/src/main/java/org/stellar/sdk/xdr/ExtensionPoint.java index 25cd82247..fa72e4391 100644 --- a/src/main/java/org/stellar/sdk/xdr/ExtensionPoint.java +++ b/src/main/java/org/stellar/sdk/xdr/ExtensionPoint.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -76,7 +76,7 @@ public static ExtensionPoint decode(XdrDataInputStream stream) throws IOExceptio @Override public int hashCode() { - return Objects.hashCode(this.v); + return Objects.hash(this.v); } @Override @@ -86,13 +86,12 @@ public boolean equals(Object object) { } ExtensionPoint other = (ExtensionPoint) object; - return Objects.equal(this.v, other.v); + return Objects.equals(this.v, other.v); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -104,8 +103,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ExtensionPoint fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/FeeBumpTransaction.java b/src/main/java/org/stellar/sdk/xdr/FeeBumpTransaction.java index 2908b9273..0463a6137 100644 --- a/src/main/java/org/stellar/sdk/xdr/FeeBumpTransaction.java +++ b/src/main/java/org/stellar/sdk/xdr/FeeBumpTransaction.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -98,7 +98,7 @@ public static FeeBumpTransaction decode(XdrDataInputStream stream) throws IOExce @Override public int hashCode() { - return Objects.hashCode(this.feeSource, this.fee, this.innerTx, this.ext); + return Objects.hash(this.feeSource, this.fee, this.innerTx, this.ext); } @Override @@ -108,16 +108,15 @@ public boolean equals(Object object) { } FeeBumpTransaction other = (FeeBumpTransaction) object; - return Objects.equal(this.feeSource, other.feeSource) - && Objects.equal(this.fee, other.fee) - && Objects.equal(this.innerTx, other.innerTx) - && Objects.equal(this.ext, other.ext); + return Objects.equals(this.feeSource, other.feeSource) + && Objects.equals(this.fee, other.fee) + && Objects.equals(this.innerTx, other.innerTx) + && Objects.equals(this.ext, other.ext); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -129,8 +128,7 @@ public byte[] toXdrByteArray() throws IOException { } public static FeeBumpTransaction fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -252,7 +250,7 @@ public static FeeBumpTransactionInnerTx decode(XdrDataInputStream stream) throws @Override public int hashCode() { - return Objects.hashCode(this.v1, this.type); + return Objects.hash(this.v1, this.type); } @Override @@ -262,13 +260,12 @@ public boolean equals(Object object) { } FeeBumpTransactionInnerTx other = (FeeBumpTransactionInnerTx) object; - return Objects.equal(this.v1, other.v1) && Objects.equal(this.type, other.type); + return Objects.equals(this.v1, other.v1) && Objects.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -280,8 +277,7 @@ public byte[] toXdrByteArray() throws IOException { } public static FeeBumpTransactionInnerTx fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -349,7 +345,7 @@ public static FeeBumpTransactionExt decode(XdrDataInputStream stream) throws IOE @Override public int hashCode() { - return Objects.hashCode(this.v); + return Objects.hash(this.v); } @Override @@ -359,13 +355,12 @@ public boolean equals(Object object) { } FeeBumpTransactionExt other = (FeeBumpTransactionExt) object; - return Objects.equal(this.v, other.v); + return Objects.equals(this.v, other.v); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -377,8 +372,7 @@ public byte[] toXdrByteArray() throws IOException { } public static FeeBumpTransactionExt fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/FeeBumpTransactionEnvelope.java b/src/main/java/org/stellar/sdk/xdr/FeeBumpTransactionEnvelope.java index af9739bc0..5275168d1 100644 --- a/src/main/java/org/stellar/sdk/xdr/FeeBumpTransactionEnvelope.java +++ b/src/main/java/org/stellar/sdk/xdr/FeeBumpTransactionEnvelope.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -74,7 +74,7 @@ public static FeeBumpTransactionEnvelope decode(XdrDataInputStream stream) throw @Override public int hashCode() { - return Objects.hashCode(this.tx, Arrays.hashCode(this.signatures)); + return Objects.hash(this.tx, Arrays.hashCode(this.signatures)); } @Override @@ -84,13 +84,12 @@ public boolean equals(Object object) { } FeeBumpTransactionEnvelope other = (FeeBumpTransactionEnvelope) object; - return Objects.equal(this.tx, other.tx) && Arrays.equals(this.signatures, other.signatures); + return Objects.equals(this.tx, other.tx) && Arrays.equals(this.signatures, other.signatures); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -102,8 +101,7 @@ public byte[] toXdrByteArray() throws IOException { } public static FeeBumpTransactionEnvelope fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/FloodAdvert.java b/src/main/java/org/stellar/sdk/xdr/FloodAdvert.java index e05c9269b..6263eeb7d 100644 --- a/src/main/java/org/stellar/sdk/xdr/FloodAdvert.java +++ b/src/main/java/org/stellar/sdk/xdr/FloodAdvert.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -49,7 +49,7 @@ public static FloodAdvert decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.txHashes); + return Objects.hash(this.txHashes); } @Override @@ -59,13 +59,12 @@ public boolean equals(Object object) { } FloodAdvert other = (FloodAdvert) object; - return Objects.equal(this.txHashes, other.txHashes); + return Objects.equals(this.txHashes, other.txHashes); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -77,8 +76,7 @@ public byte[] toXdrByteArray() throws IOException { } public static FloodAdvert fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/FloodDemand.java b/src/main/java/org/stellar/sdk/xdr/FloodDemand.java index c7e7d231f..2c0ca87c2 100644 --- a/src/main/java/org/stellar/sdk/xdr/FloodDemand.java +++ b/src/main/java/org/stellar/sdk/xdr/FloodDemand.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -49,7 +49,7 @@ public static FloodDemand decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.txHashes); + return Objects.hash(this.txHashes); } @Override @@ -59,13 +59,12 @@ public boolean equals(Object object) { } FloodDemand other = (FloodDemand) object; - return Objects.equal(this.txHashes, other.txHashes); + return Objects.equals(this.txHashes, other.txHashes); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -77,8 +76,7 @@ public byte[] toXdrByteArray() throws IOException { } public static FloodDemand fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/GeneralizedTransactionSet.java b/src/main/java/org/stellar/sdk/xdr/GeneralizedTransactionSet.java index bf8b72417..5d677dc43 100644 --- a/src/main/java/org/stellar/sdk/xdr/GeneralizedTransactionSet.java +++ b/src/main/java/org/stellar/sdk/xdr/GeneralizedTransactionSet.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -97,7 +97,7 @@ public static GeneralizedTransactionSet decode(XdrDataInputStream stream) throws @Override public int hashCode() { - return Objects.hashCode(this.v1TxSet, this.v); + return Objects.hash(this.v1TxSet, this.v); } @Override @@ -107,13 +107,12 @@ public boolean equals(Object object) { } GeneralizedTransactionSet other = (GeneralizedTransactionSet) object; - return Objects.equal(this.v1TxSet, other.v1TxSet) && Objects.equal(this.v, other.v); + return Objects.equals(this.v1TxSet, other.v1TxSet) && Objects.equals(this.v, other.v); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -125,8 +124,7 @@ public byte[] toXdrByteArray() throws IOException { } public static GeneralizedTransactionSet fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/Hash.java b/src/main/java/org/stellar/sdk/xdr/Hash.java index f04b8343e..f72221f1d 100644 --- a/src/main/java/org/stellar/sdk/xdr/Hash.java +++ b/src/main/java/org/stellar/sdk/xdr/Hash.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; // === xdr source ============================================================ @@ -67,8 +67,7 @@ public boolean equals(Object object) { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -80,8 +79,7 @@ public byte[] toXdrByteArray() throws IOException { } public static Hash fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/HashIDPreimage.java b/src/main/java/org/stellar/sdk/xdr/HashIDPreimage.java index 343874cc9..5216f1a5c 100644 --- a/src/main/java/org/stellar/sdk/xdr/HashIDPreimage.java +++ b/src/main/java/org/stellar/sdk/xdr/HashIDPreimage.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -194,7 +194,7 @@ public static HashIDPreimage decode(XdrDataInputStream stream) throws IOExceptio @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.operationID, this.revokeID, this.contractID, this.sorobanAuthorization, this.type); } @@ -205,17 +205,16 @@ public boolean equals(Object object) { } HashIDPreimage other = (HashIDPreimage) object; - return Objects.equal(this.operationID, other.operationID) - && Objects.equal(this.revokeID, other.revokeID) - && Objects.equal(this.contractID, other.contractID) - && Objects.equal(this.sorobanAuthorization, other.sorobanAuthorization) - && Objects.equal(this.type, other.type); + return Objects.equals(this.operationID, other.operationID) + && Objects.equals(this.revokeID, other.revokeID) + && Objects.equals(this.contractID, other.contractID) + && Objects.equals(this.sorobanAuthorization, other.sorobanAuthorization) + && Objects.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -227,8 +226,7 @@ public byte[] toXdrByteArray() throws IOException { } public static HashIDPreimage fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -293,7 +291,7 @@ public static HashIDPreimageOperationID decode(XdrDataInputStream stream) throws @Override public int hashCode() { - return Objects.hashCode(this.sourceAccount, this.seqNum, this.opNum); + return Objects.hash(this.sourceAccount, this.seqNum, this.opNum); } @Override @@ -303,15 +301,14 @@ public boolean equals(Object object) { } HashIDPreimageOperationID other = (HashIDPreimageOperationID) object; - return Objects.equal(this.sourceAccount, other.sourceAccount) - && Objects.equal(this.seqNum, other.seqNum) - && Objects.equal(this.opNum, other.opNum); + return Objects.equals(this.sourceAccount, other.sourceAccount) + && Objects.equals(this.seqNum, other.seqNum) + && Objects.equals(this.opNum, other.opNum); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -323,8 +320,7 @@ public byte[] toXdrByteArray() throws IOException { } public static HashIDPreimageOperationID fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -443,7 +439,7 @@ public static HashIDPreimageRevokeID decode(XdrDataInputStream stream) throws IO @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.sourceAccount, this.seqNum, this.opNum, this.liquidityPoolID, this.asset); } @@ -454,17 +450,16 @@ public boolean equals(Object object) { } HashIDPreimageRevokeID other = (HashIDPreimageRevokeID) object; - return Objects.equal(this.sourceAccount, other.sourceAccount) - && Objects.equal(this.seqNum, other.seqNum) - && Objects.equal(this.opNum, other.opNum) - && Objects.equal(this.liquidityPoolID, other.liquidityPoolID) - && Objects.equal(this.asset, other.asset); + return Objects.equals(this.sourceAccount, other.sourceAccount) + && Objects.equals(this.seqNum, other.seqNum) + && Objects.equals(this.opNum, other.opNum) + && Objects.equals(this.liquidityPoolID, other.liquidityPoolID) + && Objects.equals(this.asset, other.asset); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -476,8 +471,7 @@ public byte[] toXdrByteArray() throws IOException { } public static HashIDPreimageRevokeID fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -574,7 +568,7 @@ public static HashIDPreimageContractID decode(XdrDataInputStream stream) throws @Override public int hashCode() { - return Objects.hashCode(this.networkID, this.contractIDPreimage); + return Objects.hash(this.networkID, this.contractIDPreimage); } @Override @@ -584,14 +578,13 @@ public boolean equals(Object object) { } HashIDPreimageContractID other = (HashIDPreimageContractID) object; - return Objects.equal(this.networkID, other.networkID) - && Objects.equal(this.contractIDPreimage, other.contractIDPreimage); + return Objects.equals(this.networkID, other.networkID) + && Objects.equals(this.contractIDPreimage, other.contractIDPreimage); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -603,8 +596,7 @@ public byte[] toXdrByteArray() throws IOException { } public static HashIDPreimageContractID fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -709,7 +701,7 @@ public static HashIDPreimageSorobanAuthorization decode(XdrDataInputStream strea @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.networkID, this.nonce, this.signatureExpirationLedger, this.invocation); } @@ -720,16 +712,15 @@ public boolean equals(Object object) { } HashIDPreimageSorobanAuthorization other = (HashIDPreimageSorobanAuthorization) object; - return Objects.equal(this.networkID, other.networkID) - && Objects.equal(this.nonce, other.nonce) - && Objects.equal(this.signatureExpirationLedger, other.signatureExpirationLedger) - && Objects.equal(this.invocation, other.invocation); + return Objects.equals(this.networkID, other.networkID) + && Objects.equals(this.nonce, other.nonce) + && Objects.equals(this.signatureExpirationLedger, other.signatureExpirationLedger) + && Objects.equals(this.invocation, other.invocation); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -741,8 +732,7 @@ public byte[] toXdrByteArray() throws IOException { } public static HashIDPreimageSorobanAuthorization fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/Hello.java b/src/main/java/org/stellar/sdk/xdr/Hello.java index e131ee4f0..e64d1faf8 100644 --- a/src/main/java/org/stellar/sdk/xdr/Hello.java +++ b/src/main/java/org/stellar/sdk/xdr/Hello.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -152,7 +152,7 @@ public static Hello decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.ledgerVersion, this.overlayVersion, this.overlayMinVersion, @@ -171,21 +171,20 @@ public boolean equals(Object object) { } Hello other = (Hello) object; - return Objects.equal(this.ledgerVersion, other.ledgerVersion) - && Objects.equal(this.overlayVersion, other.overlayVersion) - && Objects.equal(this.overlayMinVersion, other.overlayMinVersion) - && Objects.equal(this.networkID, other.networkID) - && Objects.equal(this.versionStr, other.versionStr) - && Objects.equal(this.listeningPort, other.listeningPort) - && Objects.equal(this.peerID, other.peerID) - && Objects.equal(this.cert, other.cert) - && Objects.equal(this.nonce, other.nonce); + return Objects.equals(this.ledgerVersion, other.ledgerVersion) + && Objects.equals(this.overlayVersion, other.overlayVersion) + && Objects.equals(this.overlayMinVersion, other.overlayMinVersion) + && Objects.equals(this.networkID, other.networkID) + && Objects.equals(this.versionStr, other.versionStr) + && Objects.equals(this.listeningPort, other.listeningPort) + && Objects.equals(this.peerID, other.peerID) + && Objects.equals(this.cert, other.cert) + && Objects.equals(this.nonce, other.nonce); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -197,8 +196,7 @@ public byte[] toXdrByteArray() throws IOException { } public static Hello fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/HmacSha256Key.java b/src/main/java/org/stellar/sdk/xdr/HmacSha256Key.java index 289cbf05c..6adce32ef 100644 --- a/src/main/java/org/stellar/sdk/xdr/HmacSha256Key.java +++ b/src/main/java/org/stellar/sdk/xdr/HmacSha256Key.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; // === xdr source ============================================================ @@ -67,8 +67,7 @@ public boolean equals(Object object) { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -80,8 +79,7 @@ public byte[] toXdrByteArray() throws IOException { } public static HmacSha256Key fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/HmacSha256Mac.java b/src/main/java/org/stellar/sdk/xdr/HmacSha256Mac.java index 1d361a93a..1a741c7b4 100644 --- a/src/main/java/org/stellar/sdk/xdr/HmacSha256Mac.java +++ b/src/main/java/org/stellar/sdk/xdr/HmacSha256Mac.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; // === xdr source ============================================================ @@ -67,8 +67,7 @@ public boolean equals(Object object) { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -80,8 +79,7 @@ public byte[] toXdrByteArray() throws IOException { } public static HmacSha256Mac fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/HostFunction.java b/src/main/java/org/stellar/sdk/xdr/HostFunction.java index f62984d1d..efebe3f86 100644 --- a/src/main/java/org/stellar/sdk/xdr/HostFunction.java +++ b/src/main/java/org/stellar/sdk/xdr/HostFunction.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -150,7 +150,7 @@ public static HostFunction decode(XdrDataInputStream stream) throws IOException @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.invokeContract, this.createContract, Arrays.hashCode(this.wasm), this.type); } @@ -161,16 +161,15 @@ public boolean equals(Object object) { } HostFunction other = (HostFunction) object; - return Objects.equal(this.invokeContract, other.invokeContract) - && Objects.equal(this.createContract, other.createContract) + return Objects.equals(this.invokeContract, other.invokeContract) + && Objects.equals(this.createContract, other.createContract) && Arrays.equals(this.wasm, other.wasm) - && Objects.equal(this.type, other.type); + && Objects.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -182,8 +181,7 @@ public byte[] toXdrByteArray() throws IOException { } public static HostFunction fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/HostFunctionType.java b/src/main/java/org/stellar/sdk/xdr/HostFunctionType.java index a374f9ed9..18f84e1d4 100644 --- a/src/main/java/org/stellar/sdk/xdr/HostFunctionType.java +++ b/src/main/java/org/stellar/sdk/xdr/HostFunctionType.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -59,8 +59,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -72,8 +71,7 @@ public byte[] toXdrByteArray() throws IOException { } public static HostFunctionType fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/IPAddrType.java b/src/main/java/org/stellar/sdk/xdr/IPAddrType.java index 8d62a3d48..0d24dde81 100644 --- a/src/main/java/org/stellar/sdk/xdr/IPAddrType.java +++ b/src/main/java/org/stellar/sdk/xdr/IPAddrType.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -55,8 +55,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -68,8 +67,7 @@ public byte[] toXdrByteArray() throws IOException { } public static IPAddrType fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/InflationPayout.java b/src/main/java/org/stellar/sdk/xdr/InflationPayout.java index ffb1923db..37d782cfe 100644 --- a/src/main/java/org/stellar/sdk/xdr/InflationPayout.java +++ b/src/main/java/org/stellar/sdk/xdr/InflationPayout.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -62,7 +62,7 @@ public static InflationPayout decode(XdrDataInputStream stream) throws IOExcepti @Override public int hashCode() { - return Objects.hashCode(this.destination, this.amount); + return Objects.hash(this.destination, this.amount); } @Override @@ -72,14 +72,13 @@ public boolean equals(Object object) { } InflationPayout other = (InflationPayout) object; - return Objects.equal(this.destination, other.destination) - && Objects.equal(this.amount, other.amount); + return Objects.equals(this.destination, other.destination) + && Objects.equals(this.amount, other.amount); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -91,8 +90,7 @@ public byte[] toXdrByteArray() throws IOException { } public static InflationPayout fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/InflationResult.java b/src/main/java/org/stellar/sdk/xdr/InflationResult.java index a4452ba16..394d2d0c1 100644 --- a/src/main/java/org/stellar/sdk/xdr/InflationResult.java +++ b/src/main/java/org/stellar/sdk/xdr/InflationResult.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -110,7 +110,7 @@ public static InflationResult decode(XdrDataInputStream stream) throws IOExcepti @Override public int hashCode() { - return Objects.hashCode(Arrays.hashCode(this.payouts), this.code); + return Objects.hash(Arrays.hashCode(this.payouts), this.code); } @Override @@ -120,13 +120,12 @@ public boolean equals(Object object) { } InflationResult other = (InflationResult) object; - return Arrays.equals(this.payouts, other.payouts) && Objects.equal(this.code, other.code); + return Arrays.equals(this.payouts, other.payouts) && Objects.equals(this.code, other.code); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -138,8 +137,7 @@ public byte[] toXdrByteArray() throws IOException { } public static InflationResult fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/InflationResultCode.java b/src/main/java/org/stellar/sdk/xdr/InflationResultCode.java index 8cf4e12f0..d483d06c7 100644 --- a/src/main/java/org/stellar/sdk/xdr/InflationResultCode.java +++ b/src/main/java/org/stellar/sdk/xdr/InflationResultCode.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -58,8 +58,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -71,8 +70,7 @@ public byte[] toXdrByteArray() throws IOException { } public static InflationResultCode fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/InnerTransactionResult.java b/src/main/java/org/stellar/sdk/xdr/InnerTransactionResult.java index a7e514ed6..51ba48567 100644 --- a/src/main/java/org/stellar/sdk/xdr/InnerTransactionResult.java +++ b/src/main/java/org/stellar/sdk/xdr/InnerTransactionResult.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -110,7 +110,7 @@ public static InnerTransactionResult decode(XdrDataInputStream stream) throws IO @Override public int hashCode() { - return Objects.hashCode(this.feeCharged, this.result, this.ext); + return Objects.hash(this.feeCharged, this.result, this.ext); } @Override @@ -120,15 +120,14 @@ public boolean equals(Object object) { } InnerTransactionResult other = (InnerTransactionResult) object; - return Objects.equal(this.feeCharged, other.feeCharged) - && Objects.equal(this.result, other.result) - && Objects.equal(this.ext, other.ext); + return Objects.equals(this.feeCharged, other.feeCharged) + && Objects.equals(this.result, other.result) + && Objects.equals(this.ext, other.ext); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -140,8 +139,7 @@ public byte[] toXdrByteArray() throws IOException { } public static InnerTransactionResult fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -301,7 +299,7 @@ public static InnerTransactionResultResult decode(XdrDataInputStream stream) @Override public int hashCode() { - return Objects.hashCode(Arrays.hashCode(this.results), this.code); + return Objects.hash(Arrays.hashCode(this.results), this.code); } @Override @@ -311,13 +309,12 @@ public boolean equals(Object object) { } InnerTransactionResultResult other = (InnerTransactionResultResult) object; - return Arrays.equals(this.results, other.results) && Objects.equal(this.code, other.code); + return Arrays.equals(this.results, other.results) && Objects.equals(this.code, other.code); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -329,8 +326,7 @@ public byte[] toXdrByteArray() throws IOException { } public static InnerTransactionResultResult fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -398,7 +394,7 @@ public static InnerTransactionResultExt decode(XdrDataInputStream stream) throws @Override public int hashCode() { - return Objects.hashCode(this.v); + return Objects.hash(this.v); } @Override @@ -408,13 +404,12 @@ public boolean equals(Object object) { } InnerTransactionResultExt other = (InnerTransactionResultExt) object; - return Objects.equal(this.v, other.v); + return Objects.equals(this.v, other.v); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -426,8 +421,7 @@ public byte[] toXdrByteArray() throws IOException { } public static InnerTransactionResultExt fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/InnerTransactionResultPair.java b/src/main/java/org/stellar/sdk/xdr/InnerTransactionResultPair.java index 878e4e75b..3a141b39b 100644 --- a/src/main/java/org/stellar/sdk/xdr/InnerTransactionResultPair.java +++ b/src/main/java/org/stellar/sdk/xdr/InnerTransactionResultPair.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -63,7 +63,7 @@ public static InnerTransactionResultPair decode(XdrDataInputStream stream) throw @Override public int hashCode() { - return Objects.hashCode(this.transactionHash, this.result); + return Objects.hash(this.transactionHash, this.result); } @Override @@ -73,14 +73,13 @@ public boolean equals(Object object) { } InnerTransactionResultPair other = (InnerTransactionResultPair) object; - return Objects.equal(this.transactionHash, other.transactionHash) - && Objects.equal(this.result, other.result); + return Objects.equals(this.transactionHash, other.transactionHash) + && Objects.equals(this.result, other.result); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -92,8 +91,7 @@ public byte[] toXdrByteArray() throws IOException { } public static InnerTransactionResultPair fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/Int128Parts.java b/src/main/java/org/stellar/sdk/xdr/Int128Parts.java index 2bf2552c3..1c09044cc 100644 --- a/src/main/java/org/stellar/sdk/xdr/Int128Parts.java +++ b/src/main/java/org/stellar/sdk/xdr/Int128Parts.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -61,7 +61,7 @@ public static Int128Parts decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.hi, this.lo); + return Objects.hash(this.hi, this.lo); } @Override @@ -71,13 +71,12 @@ public boolean equals(Object object) { } Int128Parts other = (Int128Parts) object; - return Objects.equal(this.hi, other.hi) && Objects.equal(this.lo, other.lo); + return Objects.equals(this.hi, other.hi) && Objects.equals(this.lo, other.lo); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -89,8 +88,7 @@ public byte[] toXdrByteArray() throws IOException { } public static Int128Parts fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/Int256Parts.java b/src/main/java/org/stellar/sdk/xdr/Int256Parts.java index 66f9204a7..977f64e9a 100644 --- a/src/main/java/org/stellar/sdk/xdr/Int256Parts.java +++ b/src/main/java/org/stellar/sdk/xdr/Int256Parts.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -87,7 +87,7 @@ public static Int256Parts decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.hi_hi, this.hi_lo, this.lo_hi, this.lo_lo); + return Objects.hash(this.hi_hi, this.hi_lo, this.lo_hi, this.lo_lo); } @Override @@ -97,16 +97,15 @@ public boolean equals(Object object) { } Int256Parts other = (Int256Parts) object; - return Objects.equal(this.hi_hi, other.hi_hi) - && Objects.equal(this.hi_lo, other.hi_lo) - && Objects.equal(this.lo_hi, other.lo_hi) - && Objects.equal(this.lo_lo, other.lo_lo); + return Objects.equals(this.hi_hi, other.hi_hi) + && Objects.equals(this.hi_lo, other.hi_lo) + && Objects.equals(this.lo_hi, other.lo_hi) + && Objects.equals(this.lo_lo, other.lo_lo); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -118,8 +117,7 @@ public byte[] toXdrByteArray() throws IOException { } public static Int256Parts fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/Int32.java b/src/main/java/org/stellar/sdk/xdr/Int32.java index b887dd2d9..ca0d4b012 100644 --- a/src/main/java/org/stellar/sdk/xdr/Int32.java +++ b/src/main/java/org/stellar/sdk/xdr/Int32.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -49,7 +49,7 @@ public static Int32 decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.int32); + return Objects.hash(this.int32); } @Override @@ -59,13 +59,12 @@ public boolean equals(Object object) { } Int32 other = (Int32) object; - return Objects.equal(this.int32, other.int32); + return Objects.equals(this.int32, other.int32); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -77,8 +76,7 @@ public byte[] toXdrByteArray() throws IOException { } public static Int32 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/Int64.java b/src/main/java/org/stellar/sdk/xdr/Int64.java index c47b05bfd..d29362e3d 100644 --- a/src/main/java/org/stellar/sdk/xdr/Int64.java +++ b/src/main/java/org/stellar/sdk/xdr/Int64.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -49,7 +49,7 @@ public static Int64 decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.int64); + return Objects.hash(this.int64); } @Override @@ -59,13 +59,12 @@ public boolean equals(Object object) { } Int64 other = (Int64) object; - return Objects.equal(this.int64, other.int64); + return Objects.equals(this.int64, other.int64); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -77,8 +76,7 @@ public byte[] toXdrByteArray() throws IOException { } public static Int64 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/InvokeHostFunctionOp.java b/src/main/java/org/stellar/sdk/xdr/InvokeHostFunctionOp.java index 59d82dd6a..6a1348f09 100644 --- a/src/main/java/org/stellar/sdk/xdr/InvokeHostFunctionOp.java +++ b/src/main/java/org/stellar/sdk/xdr/InvokeHostFunctionOp.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -74,7 +74,7 @@ public static InvokeHostFunctionOp decode(XdrDataInputStream stream) throws IOEx @Override public int hashCode() { - return Objects.hashCode(this.hostFunction, Arrays.hashCode(this.auth)); + return Objects.hash(this.hostFunction, Arrays.hashCode(this.auth)); } @Override @@ -84,14 +84,13 @@ public boolean equals(Object object) { } InvokeHostFunctionOp other = (InvokeHostFunctionOp) object; - return Objects.equal(this.hostFunction, other.hostFunction) + return Objects.equals(this.hostFunction, other.hostFunction) && Arrays.equals(this.auth, other.auth); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -103,8 +102,7 @@ public byte[] toXdrByteArray() throws IOException { } public static InvokeHostFunctionOp fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/InvokeHostFunctionResult.java b/src/main/java/org/stellar/sdk/xdr/InvokeHostFunctionResult.java index 494fb3500..c0ff0fa32 100644 --- a/src/main/java/org/stellar/sdk/xdr/InvokeHostFunctionResult.java +++ b/src/main/java/org/stellar/sdk/xdr/InvokeHostFunctionResult.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -108,7 +108,7 @@ public static InvokeHostFunctionResult decode(XdrDataInputStream stream) throws @Override public int hashCode() { - return Objects.hashCode(this.success, this.code); + return Objects.hash(this.success, this.code); } @Override @@ -118,13 +118,12 @@ public boolean equals(Object object) { } InvokeHostFunctionResult other = (InvokeHostFunctionResult) object; - return Objects.equal(this.success, other.success) && Objects.equal(this.code, other.code); + return Objects.equals(this.success, other.success) && Objects.equals(this.code, other.code); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -136,8 +135,7 @@ public byte[] toXdrByteArray() throws IOException { } public static InvokeHostFunctionResult fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/InvokeHostFunctionResultCode.java b/src/main/java/org/stellar/sdk/xdr/InvokeHostFunctionResultCode.java index b88f149df..dc87d2a64 100644 --- a/src/main/java/org/stellar/sdk/xdr/InvokeHostFunctionResultCode.java +++ b/src/main/java/org/stellar/sdk/xdr/InvokeHostFunctionResultCode.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -67,8 +67,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -80,8 +79,7 @@ public byte[] toXdrByteArray() throws IOException { } public static InvokeHostFunctionResultCode fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/InvokeHostFunctionSuccessPreImage.java b/src/main/java/org/stellar/sdk/xdr/InvokeHostFunctionSuccessPreImage.java index feefc9cd5..21a5656e3 100644 --- a/src/main/java/org/stellar/sdk/xdr/InvokeHostFunctionSuccessPreImage.java +++ b/src/main/java/org/stellar/sdk/xdr/InvokeHostFunctionSuccessPreImage.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -75,7 +75,7 @@ public static InvokeHostFunctionSuccessPreImage decode(XdrDataInputStream stream @Override public int hashCode() { - return Objects.hashCode(this.returnValue, Arrays.hashCode(this.events)); + return Objects.hash(this.returnValue, Arrays.hashCode(this.events)); } @Override @@ -85,14 +85,13 @@ public boolean equals(Object object) { } InvokeHostFunctionSuccessPreImage other = (InvokeHostFunctionSuccessPreImage) object; - return Objects.equal(this.returnValue, other.returnValue) + return Objects.equals(this.returnValue, other.returnValue) && Arrays.equals(this.events, other.events); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -104,8 +103,7 @@ public byte[] toXdrByteArray() throws IOException { } public static InvokeHostFunctionSuccessPreImage fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/LedgerBounds.java b/src/main/java/org/stellar/sdk/xdr/LedgerBounds.java index 596b79023..179a7598d 100644 --- a/src/main/java/org/stellar/sdk/xdr/LedgerBounds.java +++ b/src/main/java/org/stellar/sdk/xdr/LedgerBounds.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -62,7 +62,7 @@ public static LedgerBounds decode(XdrDataInputStream stream) throws IOException @Override public int hashCode() { - return Objects.hashCode(this.minLedger, this.maxLedger); + return Objects.hash(this.minLedger, this.maxLedger); } @Override @@ -72,14 +72,13 @@ public boolean equals(Object object) { } LedgerBounds other = (LedgerBounds) object; - return Objects.equal(this.minLedger, other.minLedger) - && Objects.equal(this.maxLedger, other.maxLedger); + return Objects.equals(this.minLedger, other.minLedger) + && Objects.equals(this.maxLedger, other.maxLedger); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -91,8 +90,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LedgerBounds fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/LedgerCloseMeta.java b/src/main/java/org/stellar/sdk/xdr/LedgerCloseMeta.java index ea5942334..c39ab4434 100644 --- a/src/main/java/org/stellar/sdk/xdr/LedgerCloseMeta.java +++ b/src/main/java/org/stellar/sdk/xdr/LedgerCloseMeta.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -145,7 +145,7 @@ public static LedgerCloseMeta decode(XdrDataInputStream stream) throws IOExcepti @Override public int hashCode() { - return Objects.hashCode(this.v0, this.v1, this.v2, this.v); + return Objects.hash(this.v0, this.v1, this.v2, this.v); } @Override @@ -155,16 +155,15 @@ public boolean equals(Object object) { } LedgerCloseMeta other = (LedgerCloseMeta) object; - return Objects.equal(this.v0, other.v0) - && Objects.equal(this.v1, other.v1) - && Objects.equal(this.v2, other.v2) - && Objects.equal(this.v, other.v); + return Objects.equals(this.v0, other.v0) + && Objects.equals(this.v1, other.v1) + && Objects.equals(this.v2, other.v2) + && Objects.equals(this.v, other.v); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -176,8 +175,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LedgerCloseMeta fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/LedgerCloseMetaV0.java b/src/main/java/org/stellar/sdk/xdr/LedgerCloseMetaV0.java index 5a8d90e96..64281560b 100644 --- a/src/main/java/org/stellar/sdk/xdr/LedgerCloseMetaV0.java +++ b/src/main/java/org/stellar/sdk/xdr/LedgerCloseMetaV0.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -135,7 +135,7 @@ public static LedgerCloseMetaV0 decode(XdrDataInputStream stream) throws IOExcep @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.ledgerHeader, this.txSet, Arrays.hashCode(this.txProcessing), @@ -150,8 +150,8 @@ public boolean equals(Object object) { } LedgerCloseMetaV0 other = (LedgerCloseMetaV0) object; - return Objects.equal(this.ledgerHeader, other.ledgerHeader) - && Objects.equal(this.txSet, other.txSet) + return Objects.equals(this.ledgerHeader, other.ledgerHeader) + && Objects.equals(this.txSet, other.txSet) && Arrays.equals(this.txProcessing, other.txProcessing) && Arrays.equals(this.upgradesProcessing, other.upgradesProcessing) && Arrays.equals(this.scpInfo, other.scpInfo); @@ -159,8 +159,7 @@ public boolean equals(Object object) { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -172,8 +171,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LedgerCloseMetaV0 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/LedgerCloseMetaV1.java b/src/main/java/org/stellar/sdk/xdr/LedgerCloseMetaV1.java index 727aad9c7..c21f78354 100644 --- a/src/main/java/org/stellar/sdk/xdr/LedgerCloseMetaV1.java +++ b/src/main/java/org/stellar/sdk/xdr/LedgerCloseMetaV1.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -135,7 +135,7 @@ public static LedgerCloseMetaV1 decode(XdrDataInputStream stream) throws IOExcep @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.ledgerHeader, this.txSet, Arrays.hashCode(this.txProcessing), @@ -150,8 +150,8 @@ public boolean equals(Object object) { } LedgerCloseMetaV1 other = (LedgerCloseMetaV1) object; - return Objects.equal(this.ledgerHeader, other.ledgerHeader) - && Objects.equal(this.txSet, other.txSet) + return Objects.equals(this.ledgerHeader, other.ledgerHeader) + && Objects.equals(this.txSet, other.txSet) && Arrays.equals(this.txProcessing, other.txProcessing) && Arrays.equals(this.upgradesProcessing, other.upgradesProcessing) && Arrays.equals(this.scpInfo, other.scpInfo); @@ -159,8 +159,7 @@ public boolean equals(Object object) { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -172,8 +171,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LedgerCloseMetaV1 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/LedgerCloseMetaV2.java b/src/main/java/org/stellar/sdk/xdr/LedgerCloseMetaV2.java index ee92e31a2..053560cec 100644 --- a/src/main/java/org/stellar/sdk/xdr/LedgerCloseMetaV2.java +++ b/src/main/java/org/stellar/sdk/xdr/LedgerCloseMetaV2.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -218,7 +218,7 @@ public static LedgerCloseMetaV2 decode(XdrDataInputStream stream) throws IOExcep @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.ext, this.ledgerHeader, this.txSet, @@ -237,21 +237,20 @@ public boolean equals(Object object) { } LedgerCloseMetaV2 other = (LedgerCloseMetaV2) object; - return Objects.equal(this.ext, other.ext) - && Objects.equal(this.ledgerHeader, other.ledgerHeader) - && Objects.equal(this.txSet, other.txSet) + return Objects.equals(this.ext, other.ext) + && Objects.equals(this.ledgerHeader, other.ledgerHeader) + && Objects.equals(this.txSet, other.txSet) && Arrays.equals(this.txProcessing, other.txProcessing) && Arrays.equals(this.upgradesProcessing, other.upgradesProcessing) && Arrays.equals(this.scpInfo, other.scpInfo) - && Objects.equal(this.totalByteSizeOfBucketList, other.totalByteSizeOfBucketList) + && Objects.equals(this.totalByteSizeOfBucketList, other.totalByteSizeOfBucketList) && Arrays.equals(this.evictedTemporaryLedgerKeys, other.evictedTemporaryLedgerKeys) && Arrays.equals(this.evictedPersistentLedgerEntries, other.evictedPersistentLedgerEntries); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -263,8 +262,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LedgerCloseMetaV2 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/LedgerCloseValueSignature.java b/src/main/java/org/stellar/sdk/xdr/LedgerCloseValueSignature.java index f834aff58..470635bd5 100644 --- a/src/main/java/org/stellar/sdk/xdr/LedgerCloseValueSignature.java +++ b/src/main/java/org/stellar/sdk/xdr/LedgerCloseValueSignature.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -63,7 +63,7 @@ public static LedgerCloseValueSignature decode(XdrDataInputStream stream) throws @Override public int hashCode() { - return Objects.hashCode(this.nodeID, this.signature); + return Objects.hash(this.nodeID, this.signature); } @Override @@ -73,14 +73,13 @@ public boolean equals(Object object) { } LedgerCloseValueSignature other = (LedgerCloseValueSignature) object; - return Objects.equal(this.nodeID, other.nodeID) - && Objects.equal(this.signature, other.signature); + return Objects.equals(this.nodeID, other.nodeID) + && Objects.equals(this.signature, other.signature); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -92,8 +91,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LedgerCloseValueSignature fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/LedgerEntry.java b/src/main/java/org/stellar/sdk/xdr/LedgerEntry.java index 574c3bdcd..7b5f95764 100644 --- a/src/main/java/org/stellar/sdk/xdr/LedgerEntry.java +++ b/src/main/java/org/stellar/sdk/xdr/LedgerEntry.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -106,7 +106,7 @@ public static LedgerEntry decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.lastModifiedLedgerSeq, this.data, this.ext); + return Objects.hash(this.lastModifiedLedgerSeq, this.data, this.ext); } @Override @@ -116,15 +116,14 @@ public boolean equals(Object object) { } LedgerEntry other = (LedgerEntry) object; - return Objects.equal(this.lastModifiedLedgerSeq, other.lastModifiedLedgerSeq) - && Objects.equal(this.data, other.data) - && Objects.equal(this.ext, other.ext); + return Objects.equals(this.lastModifiedLedgerSeq, other.lastModifiedLedgerSeq) + && Objects.equals(this.data, other.data) + && Objects.equals(this.ext, other.ext); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -136,8 +135,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LedgerEntry fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -435,7 +433,7 @@ public static LedgerEntryData decode(XdrDataInputStream stream) throws IOExcepti @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.account, this.trustLine, this.offer, @@ -455,22 +453,21 @@ public boolean equals(Object object) { } LedgerEntryData other = (LedgerEntryData) object; - return Objects.equal(this.account, other.account) - && Objects.equal(this.trustLine, other.trustLine) - && Objects.equal(this.offer, other.offer) - && Objects.equal(this.data, other.data) - && Objects.equal(this.claimableBalance, other.claimableBalance) - && Objects.equal(this.liquidityPool, other.liquidityPool) - && Objects.equal(this.contractData, other.contractData) - && Objects.equal(this.contractCode, other.contractCode) - && Objects.equal(this.configSetting, other.configSetting) - && Objects.equal(this.type, other.type); + return Objects.equals(this.account, other.account) + && Objects.equals(this.trustLine, other.trustLine) + && Objects.equals(this.offer, other.offer) + && Objects.equals(this.data, other.data) + && Objects.equals(this.claimableBalance, other.claimableBalance) + && Objects.equals(this.liquidityPool, other.liquidityPool) + && Objects.equals(this.contractData, other.contractData) + && Objects.equals(this.contractCode, other.contractCode) + && Objects.equals(this.configSetting, other.configSetting) + && Objects.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -482,8 +479,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LedgerEntryData fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -573,7 +569,7 @@ public static LedgerEntryExt decode(XdrDataInputStream stream) throws IOExceptio @Override public int hashCode() { - return Objects.hashCode(this.v1, this.v); + return Objects.hash(this.v1, this.v); } @Override @@ -583,13 +579,12 @@ public boolean equals(Object object) { } LedgerEntryExt other = (LedgerEntryExt) object; - return Objects.equal(this.v1, other.v1) && Objects.equal(this.v, other.v); + return Objects.equals(this.v1, other.v1) && Objects.equals(this.v, other.v); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -601,8 +596,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LedgerEntryExt fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/LedgerEntryChange.java b/src/main/java/org/stellar/sdk/xdr/LedgerEntryChange.java index cda0a7137..1fa6cfeac 100644 --- a/src/main/java/org/stellar/sdk/xdr/LedgerEntryChange.java +++ b/src/main/java/org/stellar/sdk/xdr/LedgerEntryChange.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -170,7 +170,7 @@ public static LedgerEntryChange decode(XdrDataInputStream stream) throws IOExcep @Override public int hashCode() { - return Objects.hashCode(this.created, this.updated, this.removed, this.state, this.type); + return Objects.hash(this.created, this.updated, this.removed, this.state, this.type); } @Override @@ -180,17 +180,16 @@ public boolean equals(Object object) { } LedgerEntryChange other = (LedgerEntryChange) object; - return Objects.equal(this.created, other.created) - && Objects.equal(this.updated, other.updated) - && Objects.equal(this.removed, other.removed) - && Objects.equal(this.state, other.state) - && Objects.equal(this.type, other.type); + return Objects.equals(this.created, other.created) + && Objects.equals(this.updated, other.updated) + && Objects.equals(this.removed, other.removed) + && Objects.equals(this.state, other.state) + && Objects.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -202,8 +201,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LedgerEntryChange fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/LedgerEntryChangeType.java b/src/main/java/org/stellar/sdk/xdr/LedgerEntryChangeType.java index 170bbb957..88fa5dabc 100644 --- a/src/main/java/org/stellar/sdk/xdr/LedgerEntryChangeType.java +++ b/src/main/java/org/stellar/sdk/xdr/LedgerEntryChangeType.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -64,8 +64,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -77,8 +76,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LedgerEntryChangeType fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/LedgerEntryChanges.java b/src/main/java/org/stellar/sdk/xdr/LedgerEntryChanges.java index 395b6d3cd..3c051d783 100644 --- a/src/main/java/org/stellar/sdk/xdr/LedgerEntryChanges.java +++ b/src/main/java/org/stellar/sdk/xdr/LedgerEntryChanges.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; // === xdr source ============================================================ @@ -73,8 +73,7 @@ public boolean equals(Object object) { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -86,8 +85,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LedgerEntryChanges fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/LedgerEntryExtensionV1.java b/src/main/java/org/stellar/sdk/xdr/LedgerEntryExtensionV1.java index f0cdf88f3..e7a6510c6 100644 --- a/src/main/java/org/stellar/sdk/xdr/LedgerEntryExtensionV1.java +++ b/src/main/java/org/stellar/sdk/xdr/LedgerEntryExtensionV1.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -69,7 +69,7 @@ public static LedgerEntryExtensionV1 decode(XdrDataInputStream stream) throws IO @Override public int hashCode() { - return Objects.hashCode(this.sponsoringID, this.ext); + return Objects.hash(this.sponsoringID, this.ext); } @Override @@ -79,14 +79,13 @@ public boolean equals(Object object) { } LedgerEntryExtensionV1 other = (LedgerEntryExtensionV1) object; - return Objects.equal(this.sponsoringID, other.sponsoringID) - && Objects.equal(this.ext, other.ext); + return Objects.equals(this.sponsoringID, other.sponsoringID) + && Objects.equals(this.ext, other.ext); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -98,8 +97,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LedgerEntryExtensionV1 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -188,7 +186,7 @@ public static LedgerEntryExtensionV1Ext decode(XdrDataInputStream stream) throws @Override public int hashCode() { - return Objects.hashCode(this.v); + return Objects.hash(this.v); } @Override @@ -198,13 +196,12 @@ public boolean equals(Object object) { } LedgerEntryExtensionV1Ext other = (LedgerEntryExtensionV1Ext) object; - return Objects.equal(this.v, other.v); + return Objects.equals(this.v, other.v); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -216,8 +213,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LedgerEntryExtensionV1Ext fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/LedgerEntryType.java b/src/main/java/org/stellar/sdk/xdr/LedgerEntryType.java index fb93bcda4..6aeda4284 100644 --- a/src/main/java/org/stellar/sdk/xdr/LedgerEntryType.java +++ b/src/main/java/org/stellar/sdk/xdr/LedgerEntryType.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -83,8 +83,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -96,8 +95,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LedgerEntryType fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/LedgerFootprint.java b/src/main/java/org/stellar/sdk/xdr/LedgerFootprint.java index 2800c971b..827e3beab 100644 --- a/src/main/java/org/stellar/sdk/xdr/LedgerFootprint.java +++ b/src/main/java/org/stellar/sdk/xdr/LedgerFootprint.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -79,7 +79,7 @@ public static LedgerFootprint decode(XdrDataInputStream stream) throws IOExcepti @Override public int hashCode() { - return Objects.hashCode(Arrays.hashCode(this.readOnly), Arrays.hashCode(this.readWrite)); + return Objects.hash(Arrays.hashCode(this.readOnly), Arrays.hashCode(this.readWrite)); } @Override @@ -95,8 +95,7 @@ public boolean equals(Object object) { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -108,8 +107,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LedgerFootprint fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/LedgerHeader.java b/src/main/java/org/stellar/sdk/xdr/LedgerHeader.java index aff6b0089..bcd463efe 100644 --- a/src/main/java/org/stellar/sdk/xdr/LedgerHeader.java +++ b/src/main/java/org/stellar/sdk/xdr/LedgerHeader.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -260,7 +260,7 @@ public static LedgerHeader decode(XdrDataInputStream stream) throws IOException @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.ledgerVersion, this.previousLedgerHash, this.scpValue, @@ -285,27 +285,26 @@ public boolean equals(Object object) { } LedgerHeader other = (LedgerHeader) object; - return Objects.equal(this.ledgerVersion, other.ledgerVersion) - && Objects.equal(this.previousLedgerHash, other.previousLedgerHash) - && Objects.equal(this.scpValue, other.scpValue) - && Objects.equal(this.txSetResultHash, other.txSetResultHash) - && Objects.equal(this.bucketListHash, other.bucketListHash) - && Objects.equal(this.ledgerSeq, other.ledgerSeq) - && Objects.equal(this.totalCoins, other.totalCoins) - && Objects.equal(this.feePool, other.feePool) - && Objects.equal(this.inflationSeq, other.inflationSeq) - && Objects.equal(this.idPool, other.idPool) - && Objects.equal(this.baseFee, other.baseFee) - && Objects.equal(this.baseReserve, other.baseReserve) - && Objects.equal(this.maxTxSetSize, other.maxTxSetSize) + return Objects.equals(this.ledgerVersion, other.ledgerVersion) + && Objects.equals(this.previousLedgerHash, other.previousLedgerHash) + && Objects.equals(this.scpValue, other.scpValue) + && Objects.equals(this.txSetResultHash, other.txSetResultHash) + && Objects.equals(this.bucketListHash, other.bucketListHash) + && Objects.equals(this.ledgerSeq, other.ledgerSeq) + && Objects.equals(this.totalCoins, other.totalCoins) + && Objects.equals(this.feePool, other.feePool) + && Objects.equals(this.inflationSeq, other.inflationSeq) + && Objects.equals(this.idPool, other.idPool) + && Objects.equals(this.baseFee, other.baseFee) + && Objects.equals(this.baseReserve, other.baseReserve) + && Objects.equals(this.maxTxSetSize, other.maxTxSetSize) && Arrays.equals(this.skipList, other.skipList) - && Objects.equal(this.ext, other.ext); + && Objects.equals(this.ext, other.ext); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -317,8 +316,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LedgerHeader fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -520,7 +518,7 @@ public static LedgerHeaderExt decode(XdrDataInputStream stream) throws IOExcepti @Override public int hashCode() { - return Objects.hashCode(this.v1, this.v); + return Objects.hash(this.v1, this.v); } @Override @@ -530,13 +528,12 @@ public boolean equals(Object object) { } LedgerHeaderExt other = (LedgerHeaderExt) object; - return Objects.equal(this.v1, other.v1) && Objects.equal(this.v, other.v); + return Objects.equals(this.v1, other.v1) && Objects.equals(this.v, other.v); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -548,8 +545,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LedgerHeaderExt fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/LedgerHeaderExtensionV1.java b/src/main/java/org/stellar/sdk/xdr/LedgerHeaderExtensionV1.java index 5ed005ab8..d81323626 100644 --- a/src/main/java/org/stellar/sdk/xdr/LedgerHeaderExtensionV1.java +++ b/src/main/java/org/stellar/sdk/xdr/LedgerHeaderExtensionV1.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -69,7 +69,7 @@ public static LedgerHeaderExtensionV1 decode(XdrDataInputStream stream) throws I @Override public int hashCode() { - return Objects.hashCode(this.flags, this.ext); + return Objects.hash(this.flags, this.ext); } @Override @@ -79,13 +79,12 @@ public boolean equals(Object object) { } LedgerHeaderExtensionV1 other = (LedgerHeaderExtensionV1) object; - return Objects.equal(this.flags, other.flags) && Objects.equal(this.ext, other.ext); + return Objects.equals(this.flags, other.flags) && Objects.equals(this.ext, other.ext); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -97,8 +96,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LedgerHeaderExtensionV1 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -188,7 +186,7 @@ public static LedgerHeaderExtensionV1Ext decode(XdrDataInputStream stream) throw @Override public int hashCode() { - return Objects.hashCode(this.v); + return Objects.hash(this.v); } @Override @@ -198,13 +196,12 @@ public boolean equals(Object object) { } LedgerHeaderExtensionV1Ext other = (LedgerHeaderExtensionV1Ext) object; - return Objects.equal(this.v, other.v); + return Objects.equals(this.v, other.v); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -216,8 +213,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LedgerHeaderExtensionV1Ext fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/LedgerHeaderFlags.java b/src/main/java/org/stellar/sdk/xdr/LedgerHeaderFlags.java index 85988d04b..3ab78d984 100644 --- a/src/main/java/org/stellar/sdk/xdr/LedgerHeaderFlags.java +++ b/src/main/java/org/stellar/sdk/xdr/LedgerHeaderFlags.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -76,8 +76,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -89,8 +88,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LedgerHeaderFlags fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/LedgerHeaderHistoryEntry.java b/src/main/java/org/stellar/sdk/xdr/LedgerHeaderHistoryEntry.java index 82bbe293b..b8c91b502 100644 --- a/src/main/java/org/stellar/sdk/xdr/LedgerHeaderHistoryEntry.java +++ b/src/main/java/org/stellar/sdk/xdr/LedgerHeaderHistoryEntry.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -83,7 +83,7 @@ public static LedgerHeaderHistoryEntry decode(XdrDataInputStream stream) throws @Override public int hashCode() { - return Objects.hashCode(this.hash, this.header, this.ext); + return Objects.hash(this.hash, this.header, this.ext); } @Override @@ -93,15 +93,14 @@ public boolean equals(Object object) { } LedgerHeaderHistoryEntry other = (LedgerHeaderHistoryEntry) object; - return Objects.equal(this.hash, other.hash) - && Objects.equal(this.header, other.header) - && Objects.equal(this.ext, other.ext); + return Objects.equals(this.hash, other.hash) + && Objects.equals(this.header, other.header) + && Objects.equals(this.ext, other.ext); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -113,8 +112,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LedgerHeaderHistoryEntry fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -211,7 +209,7 @@ public static LedgerHeaderHistoryEntryExt decode(XdrDataInputStream stream) thro @Override public int hashCode() { - return Objects.hashCode(this.v); + return Objects.hash(this.v); } @Override @@ -221,13 +219,12 @@ public boolean equals(Object object) { } LedgerHeaderHistoryEntryExt other = (LedgerHeaderHistoryEntryExt) object; - return Objects.equal(this.v, other.v); + return Objects.equals(this.v, other.v); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -239,8 +236,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LedgerHeaderHistoryEntryExt fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/LedgerKey.java b/src/main/java/org/stellar/sdk/xdr/LedgerKey.java index ef527d173..2ea6e418d 100644 --- a/src/main/java/org/stellar/sdk/xdr/LedgerKey.java +++ b/src/main/java/org/stellar/sdk/xdr/LedgerKey.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -334,7 +334,7 @@ public static LedgerKey decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.account, this.trustLine, this.offer, @@ -354,22 +354,21 @@ public boolean equals(Object object) { } LedgerKey other = (LedgerKey) object; - return Objects.equal(this.account, other.account) - && Objects.equal(this.trustLine, other.trustLine) - && Objects.equal(this.offer, other.offer) - && Objects.equal(this.data, other.data) - && Objects.equal(this.claimableBalance, other.claimableBalance) - && Objects.equal(this.liquidityPool, other.liquidityPool) - && Objects.equal(this.contractData, other.contractData) - && Objects.equal(this.contractCode, other.contractCode) - && Objects.equal(this.configSetting, other.configSetting) - && Objects.equal(this.type, other.type); + return Objects.equals(this.account, other.account) + && Objects.equals(this.trustLine, other.trustLine) + && Objects.equals(this.offer, other.offer) + && Objects.equals(this.data, other.data) + && Objects.equals(this.claimableBalance, other.claimableBalance) + && Objects.equals(this.liquidityPool, other.liquidityPool) + && Objects.equals(this.contractData, other.contractData) + && Objects.equals(this.contractCode, other.contractCode) + && Objects.equals(this.configSetting, other.configSetting) + && Objects.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -381,8 +380,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LedgerKey fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -422,7 +420,7 @@ public static LedgerKeyAccount decode(XdrDataInputStream stream) throws IOExcept @Override public int hashCode() { - return Objects.hashCode(this.accountID); + return Objects.hash(this.accountID); } @Override @@ -432,13 +430,12 @@ public boolean equals(Object object) { } LedgerKeyAccount other = (LedgerKeyAccount) object; - return Objects.equal(this.accountID, other.accountID); + return Objects.equals(this.accountID, other.accountID); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -450,8 +447,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LedgerKeyAccount fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -520,7 +516,7 @@ public static LedgerKeyTrustLine decode(XdrDataInputStream stream) throws IOExce @Override public int hashCode() { - return Objects.hashCode(this.accountID, this.asset); + return Objects.hash(this.accountID, this.asset); } @Override @@ -530,14 +526,13 @@ public boolean equals(Object object) { } LedgerKeyTrustLine other = (LedgerKeyTrustLine) object; - return Objects.equal(this.accountID, other.accountID) - && Objects.equal(this.asset, other.asset); + return Objects.equals(this.accountID, other.accountID) + && Objects.equals(this.asset, other.asset); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -549,8 +544,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LedgerKeyTrustLine fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -625,7 +619,7 @@ public static LedgerKeyOffer decode(XdrDataInputStream stream) throws IOExceptio @Override public int hashCode() { - return Objects.hashCode(this.sellerID, this.offerID); + return Objects.hash(this.sellerID, this.offerID); } @Override @@ -635,14 +629,13 @@ public boolean equals(Object object) { } LedgerKeyOffer other = (LedgerKeyOffer) object; - return Objects.equal(this.sellerID, other.sellerID) - && Objects.equal(this.offerID, other.offerID); + return Objects.equals(this.sellerID, other.sellerID) + && Objects.equals(this.offerID, other.offerID); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -654,8 +647,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LedgerKeyOffer fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -730,7 +722,7 @@ public static LedgerKeyData decode(XdrDataInputStream stream) throws IOException @Override public int hashCode() { - return Objects.hashCode(this.accountID, this.dataName); + return Objects.hash(this.accountID, this.dataName); } @Override @@ -740,14 +732,13 @@ public boolean equals(Object object) { } LedgerKeyData other = (LedgerKeyData) object; - return Objects.equal(this.accountID, other.accountID) - && Objects.equal(this.dataName, other.dataName); + return Objects.equals(this.accountID, other.accountID) + && Objects.equals(this.dataName, other.dataName); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -759,8 +750,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LedgerKeyData fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -824,7 +814,7 @@ public static LedgerKeyClaimableBalance decode(XdrDataInputStream stream) throws @Override public int hashCode() { - return Objects.hashCode(this.balanceID); + return Objects.hash(this.balanceID); } @Override @@ -834,13 +824,12 @@ public boolean equals(Object object) { } LedgerKeyClaimableBalance other = (LedgerKeyClaimableBalance) object; - return Objects.equal(this.balanceID, other.balanceID); + return Objects.equals(this.balanceID, other.balanceID); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -852,8 +841,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LedgerKeyClaimableBalance fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -910,7 +898,7 @@ public static LedgerKeyLiquidityPool decode(XdrDataInputStream stream) throws IO @Override public int hashCode() { - return Objects.hashCode(this.liquidityPoolID); + return Objects.hash(this.liquidityPoolID); } @Override @@ -920,13 +908,12 @@ public boolean equals(Object object) { } LedgerKeyLiquidityPool other = (LedgerKeyLiquidityPool) object; - return Objects.equal(this.liquidityPoolID, other.liquidityPoolID); + return Objects.equals(this.liquidityPoolID, other.liquidityPoolID); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -938,8 +925,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LedgerKeyLiquidityPool fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -1032,7 +1018,7 @@ public static LedgerKeyContractData decode(XdrDataInputStream stream) throws IOE @Override public int hashCode() { - return Objects.hashCode(this.contract, this.key, this.durability, this.bodyType); + return Objects.hash(this.contract, this.key, this.durability, this.bodyType); } @Override @@ -1042,16 +1028,15 @@ public boolean equals(Object object) { } LedgerKeyContractData other = (LedgerKeyContractData) object; - return Objects.equal(this.contract, other.contract) - && Objects.equal(this.key, other.key) - && Objects.equal(this.durability, other.durability) - && Objects.equal(this.bodyType, other.bodyType); + return Objects.equals(this.contract, other.contract) + && Objects.equals(this.key, other.key) + && Objects.equals(this.durability, other.durability) + && Objects.equals(this.bodyType, other.bodyType); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -1063,8 +1048,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LedgerKeyContractData fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -1154,7 +1138,7 @@ public static LedgerKeyContractCode decode(XdrDataInputStream stream) throws IOE @Override public int hashCode() { - return Objects.hashCode(this.hash, this.bodyType); + return Objects.hash(this.hash, this.bodyType); } @Override @@ -1164,13 +1148,12 @@ public boolean equals(Object object) { } LedgerKeyContractCode other = (LedgerKeyContractCode) object; - return Objects.equal(this.hash, other.hash) && Objects.equal(this.bodyType, other.bodyType); + return Objects.equals(this.hash, other.hash) && Objects.equals(this.bodyType, other.bodyType); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -1182,8 +1165,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LedgerKeyContractCode fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -1247,7 +1229,7 @@ public static LedgerKeyConfigSetting decode(XdrDataInputStream stream) throws IO @Override public int hashCode() { - return Objects.hashCode(this.configSettingID); + return Objects.hash(this.configSettingID); } @Override @@ -1257,13 +1239,12 @@ public boolean equals(Object object) { } LedgerKeyConfigSetting other = (LedgerKeyConfigSetting) object; - return Objects.equal(this.configSettingID, other.configSettingID); + return Objects.equals(this.configSettingID, other.configSettingID); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -1275,8 +1256,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LedgerKeyConfigSetting fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/LedgerSCPMessages.java b/src/main/java/org/stellar/sdk/xdr/LedgerSCPMessages.java index 015d56615..734e792a5 100644 --- a/src/main/java/org/stellar/sdk/xdr/LedgerSCPMessages.java +++ b/src/main/java/org/stellar/sdk/xdr/LedgerSCPMessages.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -71,7 +71,7 @@ public static LedgerSCPMessages decode(XdrDataInputStream stream) throws IOExcep @Override public int hashCode() { - return Objects.hashCode(this.ledgerSeq, Arrays.hashCode(this.messages)); + return Objects.hash(this.ledgerSeq, Arrays.hashCode(this.messages)); } @Override @@ -81,14 +81,13 @@ public boolean equals(Object object) { } LedgerSCPMessages other = (LedgerSCPMessages) object; - return Objects.equal(this.ledgerSeq, other.ledgerSeq) + return Objects.equals(this.ledgerSeq, other.ledgerSeq) && Arrays.equals(this.messages, other.messages); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -100,8 +99,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LedgerSCPMessages fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/LedgerUpgrade.java b/src/main/java/org/stellar/sdk/xdr/LedgerUpgrade.java index 995b36531..d2be4d47d 100644 --- a/src/main/java/org/stellar/sdk/xdr/LedgerUpgrade.java +++ b/src/main/java/org/stellar/sdk/xdr/LedgerUpgrade.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -220,7 +220,7 @@ public static LedgerUpgrade decode(XdrDataInputStream stream) throws IOException @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.newLedgerVersion, this.newBaseFee, this.newMaxTxSetSize, @@ -237,19 +237,18 @@ public boolean equals(Object object) { } LedgerUpgrade other = (LedgerUpgrade) object; - return Objects.equal(this.newLedgerVersion, other.newLedgerVersion) - && Objects.equal(this.newBaseFee, other.newBaseFee) - && Objects.equal(this.newMaxTxSetSize, other.newMaxTxSetSize) - && Objects.equal(this.newBaseReserve, other.newBaseReserve) - && Objects.equal(this.newFlags, other.newFlags) - && Objects.equal(this.newConfig, other.newConfig) - && Objects.equal(this.type, other.type); + return Objects.equals(this.newLedgerVersion, other.newLedgerVersion) + && Objects.equals(this.newBaseFee, other.newBaseFee) + && Objects.equals(this.newMaxTxSetSize, other.newMaxTxSetSize) + && Objects.equals(this.newBaseReserve, other.newBaseReserve) + && Objects.equals(this.newFlags, other.newFlags) + && Objects.equals(this.newConfig, other.newConfig) + && Objects.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -261,8 +260,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LedgerUpgrade fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/LedgerUpgradeType.java b/src/main/java/org/stellar/sdk/xdr/LedgerUpgradeType.java index 47876e276..af9d495f4 100644 --- a/src/main/java/org/stellar/sdk/xdr/LedgerUpgradeType.java +++ b/src/main/java/org/stellar/sdk/xdr/LedgerUpgradeType.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -72,8 +72,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -85,8 +84,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LedgerUpgradeType fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/Liabilities.java b/src/main/java/org/stellar/sdk/xdr/Liabilities.java index b1d0b0d5a..851b06ef6 100644 --- a/src/main/java/org/stellar/sdk/xdr/Liabilities.java +++ b/src/main/java/org/stellar/sdk/xdr/Liabilities.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -62,7 +62,7 @@ public static Liabilities decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.buying, this.selling); + return Objects.hash(this.buying, this.selling); } @Override @@ -72,13 +72,12 @@ public boolean equals(Object object) { } Liabilities other = (Liabilities) object; - return Objects.equal(this.buying, other.buying) && Objects.equal(this.selling, other.selling); + return Objects.equals(this.buying, other.buying) && Objects.equals(this.selling, other.selling); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -90,8 +89,7 @@ public byte[] toXdrByteArray() throws IOException { } public static Liabilities fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/LiquidityPoolConstantProductParameters.java b/src/main/java/org/stellar/sdk/xdr/LiquidityPoolConstantProductParameters.java index 387e18e69..c10d88b23 100644 --- a/src/main/java/org/stellar/sdk/xdr/LiquidityPoolConstantProductParameters.java +++ b/src/main/java/org/stellar/sdk/xdr/LiquidityPoolConstantProductParameters.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -79,7 +79,7 @@ public static LiquidityPoolConstantProductParameters decode(XdrDataInputStream s @Override public int hashCode() { - return Objects.hashCode(this.assetA, this.assetB, this.fee); + return Objects.hash(this.assetA, this.assetB, this.fee); } @Override @@ -89,15 +89,14 @@ public boolean equals(Object object) { } LiquidityPoolConstantProductParameters other = (LiquidityPoolConstantProductParameters) object; - return Objects.equal(this.assetA, other.assetA) - && Objects.equal(this.assetB, other.assetB) - && Objects.equal(this.fee, other.fee); + return Objects.equals(this.assetA, other.assetA) + && Objects.equals(this.assetB, other.assetB) + && Objects.equals(this.fee, other.fee); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -110,8 +109,7 @@ public byte[] toXdrByteArray() throws IOException { public static LiquidityPoolConstantProductParameters fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/LiquidityPoolDepositOp.java b/src/main/java/org/stellar/sdk/xdr/LiquidityPoolDepositOp.java index a059f37b7..c57457134 100644 --- a/src/main/java/org/stellar/sdk/xdr/LiquidityPoolDepositOp.java +++ b/src/main/java/org/stellar/sdk/xdr/LiquidityPoolDepositOp.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -102,7 +102,7 @@ public static LiquidityPoolDepositOp decode(XdrDataInputStream stream) throws IO @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.liquidityPoolID, this.maxAmountA, this.maxAmountB, this.minPrice, this.maxPrice); } @@ -113,17 +113,16 @@ public boolean equals(Object object) { } LiquidityPoolDepositOp other = (LiquidityPoolDepositOp) object; - return Objects.equal(this.liquidityPoolID, other.liquidityPoolID) - && Objects.equal(this.maxAmountA, other.maxAmountA) - && Objects.equal(this.maxAmountB, other.maxAmountB) - && Objects.equal(this.minPrice, other.minPrice) - && Objects.equal(this.maxPrice, other.maxPrice); + return Objects.equals(this.liquidityPoolID, other.liquidityPoolID) + && Objects.equals(this.maxAmountA, other.maxAmountA) + && Objects.equals(this.maxAmountB, other.maxAmountB) + && Objects.equals(this.minPrice, other.minPrice) + && Objects.equals(this.maxPrice, other.maxPrice); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -135,8 +134,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LiquidityPoolDepositOp fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/LiquidityPoolDepositResult.java b/src/main/java/org/stellar/sdk/xdr/LiquidityPoolDepositResult.java index cf555d95f..d6485dd21 100644 --- a/src/main/java/org/stellar/sdk/xdr/LiquidityPoolDepositResult.java +++ b/src/main/java/org/stellar/sdk/xdr/LiquidityPoolDepositResult.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -101,7 +101,7 @@ public static LiquidityPoolDepositResult decode(XdrDataInputStream stream) throw @Override public int hashCode() { - return Objects.hashCode(this.code); + return Objects.hash(this.code); } @Override @@ -111,13 +111,12 @@ public boolean equals(Object object) { } LiquidityPoolDepositResult other = (LiquidityPoolDepositResult) object; - return Objects.equal(this.code, other.code); + return Objects.equals(this.code, other.code); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -129,8 +128,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LiquidityPoolDepositResult fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/LiquidityPoolDepositResultCode.java b/src/main/java/org/stellar/sdk/xdr/LiquidityPoolDepositResultCode.java index d9b5afe02..e409f7c29 100644 --- a/src/main/java/org/stellar/sdk/xdr/LiquidityPoolDepositResultCode.java +++ b/src/main/java/org/stellar/sdk/xdr/LiquidityPoolDepositResultCode.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -88,8 +88,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -101,8 +100,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LiquidityPoolDepositResultCode fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/LiquidityPoolEntry.java b/src/main/java/org/stellar/sdk/xdr/LiquidityPoolEntry.java index ec5a2003d..86d199b71 100644 --- a/src/main/java/org/stellar/sdk/xdr/LiquidityPoolEntry.java +++ b/src/main/java/org/stellar/sdk/xdr/LiquidityPoolEntry.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -77,7 +77,7 @@ public static LiquidityPoolEntry decode(XdrDataInputStream stream) throws IOExce @Override public int hashCode() { - return Objects.hashCode(this.liquidityPoolID, this.body); + return Objects.hash(this.liquidityPoolID, this.body); } @Override @@ -87,14 +87,13 @@ public boolean equals(Object object) { } LiquidityPoolEntry other = (LiquidityPoolEntry) object; - return Objects.equal(this.liquidityPoolID, other.liquidityPoolID) - && Objects.equal(this.body, other.body); + return Objects.equals(this.liquidityPoolID, other.liquidityPoolID) + && Objects.equals(this.body, other.body); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -106,8 +105,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LiquidityPoolEntry fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -217,7 +215,7 @@ public static LiquidityPoolEntryBody decode(XdrDataInputStream stream) throws IO @Override public int hashCode() { - return Objects.hashCode(this.constantProduct, this.type); + return Objects.hash(this.constantProduct, this.type); } @Override @@ -227,14 +225,13 @@ public boolean equals(Object object) { } LiquidityPoolEntryBody other = (LiquidityPoolEntryBody) object; - return Objects.equal(this.constantProduct, other.constantProduct) - && Objects.equal(this.type, other.type); + return Objects.equals(this.constantProduct, other.constantProduct) + && Objects.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -246,8 +243,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LiquidityPoolEntryBody fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -341,7 +337,7 @@ public static LiquidityPoolEntryConstantProduct decode(XdrDataInputStream stream @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.params, this.reserveA, this.reserveB, @@ -356,17 +352,16 @@ public boolean equals(Object object) { } LiquidityPoolEntryConstantProduct other = (LiquidityPoolEntryConstantProduct) object; - return Objects.equal(this.params, other.params) - && Objects.equal(this.reserveA, other.reserveA) - && Objects.equal(this.reserveB, other.reserveB) - && Objects.equal(this.totalPoolShares, other.totalPoolShares) - && Objects.equal(this.poolSharesTrustLineCount, other.poolSharesTrustLineCount); + return Objects.equals(this.params, other.params) + && Objects.equals(this.reserveA, other.reserveA) + && Objects.equals(this.reserveB, other.reserveB) + && Objects.equals(this.totalPoolShares, other.totalPoolShares) + && Objects.equals(this.poolSharesTrustLineCount, other.poolSharesTrustLineCount); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -378,8 +373,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LiquidityPoolEntryConstantProduct fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/LiquidityPoolParameters.java b/src/main/java/org/stellar/sdk/xdr/LiquidityPoolParameters.java index 5b554bfdc..e36a29f9f 100644 --- a/src/main/java/org/stellar/sdk/xdr/LiquidityPoolParameters.java +++ b/src/main/java/org/stellar/sdk/xdr/LiquidityPoolParameters.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -98,7 +98,7 @@ public static LiquidityPoolParameters decode(XdrDataInputStream stream) throws I @Override public int hashCode() { - return Objects.hashCode(this.constantProduct, this.type); + return Objects.hash(this.constantProduct, this.type); } @Override @@ -108,14 +108,13 @@ public boolean equals(Object object) { } LiquidityPoolParameters other = (LiquidityPoolParameters) object; - return Objects.equal(this.constantProduct, other.constantProduct) - && Objects.equal(this.type, other.type); + return Objects.equals(this.constantProduct, other.constantProduct) + && Objects.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -127,8 +126,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LiquidityPoolParameters fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/LiquidityPoolType.java b/src/main/java/org/stellar/sdk/xdr/LiquidityPoolType.java index 8c326247b..f3b194758 100644 --- a/src/main/java/org/stellar/sdk/xdr/LiquidityPoolType.java +++ b/src/main/java/org/stellar/sdk/xdr/LiquidityPoolType.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -52,8 +52,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -65,8 +64,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LiquidityPoolType fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/LiquidityPoolWithdrawOp.java b/src/main/java/org/stellar/sdk/xdr/LiquidityPoolWithdrawOp.java index 1a1f2802a..e5e5412a9 100644 --- a/src/main/java/org/stellar/sdk/xdr/LiquidityPoolWithdrawOp.java +++ b/src/main/java/org/stellar/sdk/xdr/LiquidityPoolWithdrawOp.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -89,7 +89,7 @@ public static LiquidityPoolWithdrawOp decode(XdrDataInputStream stream) throws I @Override public int hashCode() { - return Objects.hashCode(this.liquidityPoolID, this.amount, this.minAmountA, this.minAmountB); + return Objects.hash(this.liquidityPoolID, this.amount, this.minAmountA, this.minAmountB); } @Override @@ -99,16 +99,15 @@ public boolean equals(Object object) { } LiquidityPoolWithdrawOp other = (LiquidityPoolWithdrawOp) object; - return Objects.equal(this.liquidityPoolID, other.liquidityPoolID) - && Objects.equal(this.amount, other.amount) - && Objects.equal(this.minAmountA, other.minAmountA) - && Objects.equal(this.minAmountB, other.minAmountB); + return Objects.equals(this.liquidityPoolID, other.liquidityPoolID) + && Objects.equals(this.amount, other.amount) + && Objects.equals(this.minAmountA, other.minAmountA) + && Objects.equals(this.minAmountB, other.minAmountB); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -120,8 +119,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LiquidityPoolWithdrawOp fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/LiquidityPoolWithdrawResult.java b/src/main/java/org/stellar/sdk/xdr/LiquidityPoolWithdrawResult.java index 5adf72fe6..bbe4b663a 100644 --- a/src/main/java/org/stellar/sdk/xdr/LiquidityPoolWithdrawResult.java +++ b/src/main/java/org/stellar/sdk/xdr/LiquidityPoolWithdrawResult.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -96,7 +96,7 @@ public static LiquidityPoolWithdrawResult decode(XdrDataInputStream stream) thro @Override public int hashCode() { - return Objects.hashCode(this.code); + return Objects.hash(this.code); } @Override @@ -106,13 +106,12 @@ public boolean equals(Object object) { } LiquidityPoolWithdrawResult other = (LiquidityPoolWithdrawResult) object; - return Objects.equal(this.code, other.code); + return Objects.equals(this.code, other.code); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -124,8 +123,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LiquidityPoolWithdrawResult fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/LiquidityPoolWithdrawResultCode.java b/src/main/java/org/stellar/sdk/xdr/LiquidityPoolWithdrawResultCode.java index e99125470..8af5e77fc 100644 --- a/src/main/java/org/stellar/sdk/xdr/LiquidityPoolWithdrawResultCode.java +++ b/src/main/java/org/stellar/sdk/xdr/LiquidityPoolWithdrawResultCode.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -79,8 +79,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -92,8 +91,7 @@ public byte[] toXdrByteArray() throws IOException { } public static LiquidityPoolWithdrawResultCode fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ManageBuyOfferOp.java b/src/main/java/org/stellar/sdk/xdr/ManageBuyOfferOp.java index 2a879abcf..943b24f65 100644 --- a/src/main/java/org/stellar/sdk/xdr/ManageBuyOfferOp.java +++ b/src/main/java/org/stellar/sdk/xdr/ManageBuyOfferOp.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -104,7 +104,7 @@ public static ManageBuyOfferOp decode(XdrDataInputStream stream) throws IOExcept @Override public int hashCode() { - return Objects.hashCode(this.selling, this.buying, this.buyAmount, this.price, this.offerID); + return Objects.hash(this.selling, this.buying, this.buyAmount, this.price, this.offerID); } @Override @@ -114,17 +114,16 @@ public boolean equals(Object object) { } ManageBuyOfferOp other = (ManageBuyOfferOp) object; - return Objects.equal(this.selling, other.selling) - && Objects.equal(this.buying, other.buying) - && Objects.equal(this.buyAmount, other.buyAmount) - && Objects.equal(this.price, other.price) - && Objects.equal(this.offerID, other.offerID); + return Objects.equals(this.selling, other.selling) + && Objects.equals(this.buying, other.buying) + && Objects.equals(this.buyAmount, other.buyAmount) + && Objects.equals(this.price, other.price) + && Objects.equals(this.offerID, other.offerID); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -136,8 +135,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ManageBuyOfferOp fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ManageBuyOfferResult.java b/src/main/java/org/stellar/sdk/xdr/ManageBuyOfferResult.java index 4e47b8dea..c04c7eae2 100644 --- a/src/main/java/org/stellar/sdk/xdr/ManageBuyOfferResult.java +++ b/src/main/java/org/stellar/sdk/xdr/ManageBuyOfferResult.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -135,7 +135,7 @@ public static ManageBuyOfferResult decode(XdrDataInputStream stream) throws IOEx @Override public int hashCode() { - return Objects.hashCode(this.success, this.code); + return Objects.hash(this.success, this.code); } @Override @@ -145,13 +145,12 @@ public boolean equals(Object object) { } ManageBuyOfferResult other = (ManageBuyOfferResult) object; - return Objects.equal(this.success, other.success) && Objects.equal(this.code, other.code); + return Objects.equals(this.success, other.success) && Objects.equals(this.code, other.code); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -163,8 +162,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ManageBuyOfferResult fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ManageBuyOfferResultCode.java b/src/main/java/org/stellar/sdk/xdr/ManageBuyOfferResultCode.java index 48319a324..b6c171803 100644 --- a/src/main/java/org/stellar/sdk/xdr/ManageBuyOfferResultCode.java +++ b/src/main/java/org/stellar/sdk/xdr/ManageBuyOfferResultCode.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -107,8 +107,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -120,8 +119,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ManageBuyOfferResultCode fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ManageDataOp.java b/src/main/java/org/stellar/sdk/xdr/ManageDataOp.java index cac6b2772..77ab7e67c 100644 --- a/src/main/java/org/stellar/sdk/xdr/ManageDataOp.java +++ b/src/main/java/org/stellar/sdk/xdr/ManageDataOp.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -70,7 +70,7 @@ public static ManageDataOp decode(XdrDataInputStream stream) throws IOException @Override public int hashCode() { - return Objects.hashCode(this.dataName, this.dataValue); + return Objects.hash(this.dataName, this.dataValue); } @Override @@ -80,14 +80,13 @@ public boolean equals(Object object) { } ManageDataOp other = (ManageDataOp) object; - return Objects.equal(this.dataName, other.dataName) - && Objects.equal(this.dataValue, other.dataValue); + return Objects.equals(this.dataName, other.dataName) + && Objects.equals(this.dataValue, other.dataValue); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -99,8 +98,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ManageDataOp fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ManageDataResult.java b/src/main/java/org/stellar/sdk/xdr/ManageDataResult.java index 9a801aebb..910c8b379 100644 --- a/src/main/java/org/stellar/sdk/xdr/ManageDataResult.java +++ b/src/main/java/org/stellar/sdk/xdr/ManageDataResult.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -91,7 +91,7 @@ public static ManageDataResult decode(XdrDataInputStream stream) throws IOExcept @Override public int hashCode() { - return Objects.hashCode(this.code); + return Objects.hash(this.code); } @Override @@ -101,13 +101,12 @@ public boolean equals(Object object) { } ManageDataResult other = (ManageDataResult) object; - return Objects.equal(this.code, other.code); + return Objects.equals(this.code, other.code); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -119,8 +118,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ManageDataResult fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ManageDataResultCode.java b/src/main/java/org/stellar/sdk/xdr/ManageDataResultCode.java index db63e205a..8437b3885 100644 --- a/src/main/java/org/stellar/sdk/xdr/ManageDataResultCode.java +++ b/src/main/java/org/stellar/sdk/xdr/ManageDataResultCode.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -72,8 +72,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -85,8 +84,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ManageDataResultCode fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ManageOfferEffect.java b/src/main/java/org/stellar/sdk/xdr/ManageOfferEffect.java index e88d7ef17..21e28766b 100644 --- a/src/main/java/org/stellar/sdk/xdr/ManageOfferEffect.java +++ b/src/main/java/org/stellar/sdk/xdr/ManageOfferEffect.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -60,8 +60,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -73,8 +72,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ManageOfferEffect fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ManageOfferSuccessResult.java b/src/main/java/org/stellar/sdk/xdr/ManageOfferSuccessResult.java index 8b649c160..0a916fc24 100644 --- a/src/main/java/org/stellar/sdk/xdr/ManageOfferSuccessResult.java +++ b/src/main/java/org/stellar/sdk/xdr/ManageOfferSuccessResult.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -82,7 +82,7 @@ public static ManageOfferSuccessResult decode(XdrDataInputStream stream) throws @Override public int hashCode() { - return Objects.hashCode(Arrays.hashCode(this.offersClaimed), this.offer); + return Objects.hash(Arrays.hashCode(this.offersClaimed), this.offer); } @Override @@ -93,13 +93,12 @@ public boolean equals(Object object) { ManageOfferSuccessResult other = (ManageOfferSuccessResult) object; return Arrays.equals(this.offersClaimed, other.offersClaimed) - && Objects.equal(this.offer, other.offer); + && Objects.equals(this.offer, other.offer); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -111,8 +110,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ManageOfferSuccessResult fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -229,7 +227,7 @@ public static ManageOfferSuccessResultOffer decode(XdrDataInputStream stream) @Override public int hashCode() { - return Objects.hashCode(this.offer, this.effect); + return Objects.hash(this.offer, this.effect); } @Override @@ -239,13 +237,12 @@ public boolean equals(Object object) { } ManageOfferSuccessResultOffer other = (ManageOfferSuccessResultOffer) object; - return Objects.equal(this.offer, other.offer) && Objects.equal(this.effect, other.effect); + return Objects.equals(this.offer, other.offer) && Objects.equals(this.effect, other.effect); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -257,8 +254,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ManageOfferSuccessResultOffer fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ManageSellOfferOp.java b/src/main/java/org/stellar/sdk/xdr/ManageSellOfferOp.java index b802452ae..f6808c0dd 100644 --- a/src/main/java/org/stellar/sdk/xdr/ManageSellOfferOp.java +++ b/src/main/java/org/stellar/sdk/xdr/ManageSellOfferOp.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -103,7 +103,7 @@ public static ManageSellOfferOp decode(XdrDataInputStream stream) throws IOExcep @Override public int hashCode() { - return Objects.hashCode(this.selling, this.buying, this.amount, this.price, this.offerID); + return Objects.hash(this.selling, this.buying, this.amount, this.price, this.offerID); } @Override @@ -113,17 +113,16 @@ public boolean equals(Object object) { } ManageSellOfferOp other = (ManageSellOfferOp) object; - return Objects.equal(this.selling, other.selling) - && Objects.equal(this.buying, other.buying) - && Objects.equal(this.amount, other.amount) - && Objects.equal(this.price, other.price) - && Objects.equal(this.offerID, other.offerID); + return Objects.equals(this.selling, other.selling) + && Objects.equals(this.buying, other.buying) + && Objects.equals(this.amount, other.amount) + && Objects.equals(this.price, other.price) + && Objects.equals(this.offerID, other.offerID); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -135,8 +134,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ManageSellOfferOp fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ManageSellOfferResult.java b/src/main/java/org/stellar/sdk/xdr/ManageSellOfferResult.java index 38f812312..69475ace2 100644 --- a/src/main/java/org/stellar/sdk/xdr/ManageSellOfferResult.java +++ b/src/main/java/org/stellar/sdk/xdr/ManageSellOfferResult.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -135,7 +135,7 @@ public static ManageSellOfferResult decode(XdrDataInputStream stream) throws IOE @Override public int hashCode() { - return Objects.hashCode(this.success, this.code); + return Objects.hash(this.success, this.code); } @Override @@ -145,13 +145,12 @@ public boolean equals(Object object) { } ManageSellOfferResult other = (ManageSellOfferResult) object; - return Objects.equal(this.success, other.success) && Objects.equal(this.code, other.code); + return Objects.equals(this.success, other.success) && Objects.equals(this.code, other.code); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -163,8 +162,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ManageSellOfferResult fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ManageSellOfferResultCode.java b/src/main/java/org/stellar/sdk/xdr/ManageSellOfferResultCode.java index 97faa4815..bfedd49fc 100644 --- a/src/main/java/org/stellar/sdk/xdr/ManageSellOfferResultCode.java +++ b/src/main/java/org/stellar/sdk/xdr/ManageSellOfferResultCode.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -110,8 +110,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -123,8 +122,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ManageSellOfferResultCode fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/Memo.java b/src/main/java/org/stellar/sdk/xdr/Memo.java index 264e56d7a..f7a402d41 100644 --- a/src/main/java/org/stellar/sdk/xdr/Memo.java +++ b/src/main/java/org/stellar/sdk/xdr/Memo.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -175,7 +175,7 @@ public static Memo decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.text, this.id, this.hash, this.retHash, this.type); + return Objects.hash(this.text, this.id, this.hash, this.retHash, this.type); } @Override @@ -185,17 +185,16 @@ public boolean equals(Object object) { } Memo other = (Memo) object; - return Objects.equal(this.text, other.text) - && Objects.equal(this.id, other.id) - && Objects.equal(this.hash, other.hash) - && Objects.equal(this.retHash, other.retHash) - && Objects.equal(this.type, other.type); + return Objects.equals(this.text, other.text) + && Objects.equals(this.id, other.id) + && Objects.equals(this.hash, other.hash) + && Objects.equals(this.retHash, other.retHash) + && Objects.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -207,8 +206,7 @@ public byte[] toXdrByteArray() throws IOException { } public static Memo fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/MemoType.java b/src/main/java/org/stellar/sdk/xdr/MemoType.java index f1c47b717..f4f32e448 100644 --- a/src/main/java/org/stellar/sdk/xdr/MemoType.java +++ b/src/main/java/org/stellar/sdk/xdr/MemoType.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -67,8 +67,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -80,8 +79,7 @@ public byte[] toXdrByteArray() throws IOException { } public static MemoType fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/MessageType.java b/src/main/java/org/stellar/sdk/xdr/MessageType.java index fb1d1b31a..d93ea3c47 100644 --- a/src/main/java/org/stellar/sdk/xdr/MessageType.java +++ b/src/main/java/org/stellar/sdk/xdr/MessageType.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -137,8 +137,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -150,8 +149,7 @@ public byte[] toXdrByteArray() throws IOException { } public static MessageType fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/MuxedAccount.java b/src/main/java/org/stellar/sdk/xdr/MuxedAccount.java index 94a0162a4..d3f2351ea 100644 --- a/src/main/java/org/stellar/sdk/xdr/MuxedAccount.java +++ b/src/main/java/org/stellar/sdk/xdr/MuxedAccount.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -124,7 +124,7 @@ public static MuxedAccount decode(XdrDataInputStream stream) throws IOException @Override public int hashCode() { - return Objects.hashCode(this.ed25519, this.med25519, this.type); + return Objects.hash(this.ed25519, this.med25519, this.type); } @Override @@ -134,15 +134,14 @@ public boolean equals(Object object) { } MuxedAccount other = (MuxedAccount) object; - return Objects.equal(this.ed25519, other.ed25519) - && Objects.equal(this.med25519, other.med25519) - && Objects.equal(this.type, other.type); + return Objects.equals(this.ed25519, other.ed25519) + && Objects.equals(this.med25519, other.med25519) + && Objects.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -154,8 +153,7 @@ public byte[] toXdrByteArray() throws IOException { } public static MuxedAccount fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -208,7 +206,7 @@ public static MuxedAccountMed25519 decode(XdrDataInputStream stream) throws IOEx @Override public int hashCode() { - return Objects.hashCode(this.id, this.ed25519); + return Objects.hash(this.id, this.ed25519); } @Override @@ -218,13 +216,12 @@ public boolean equals(Object object) { } MuxedAccountMed25519 other = (MuxedAccountMed25519) object; - return Objects.equal(this.id, other.id) && Objects.equal(this.ed25519, other.ed25519); + return Objects.equals(this.id, other.id) && Objects.equals(this.ed25519, other.ed25519); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -236,8 +233,7 @@ public byte[] toXdrByteArray() throws IOException { } public static MuxedAccountMed25519 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/NodeID.java b/src/main/java/org/stellar/sdk/xdr/NodeID.java index c8d7f9afd..37c9de666 100644 --- a/src/main/java/org/stellar/sdk/xdr/NodeID.java +++ b/src/main/java/org/stellar/sdk/xdr/NodeID.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -49,7 +49,7 @@ public static NodeID decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.NodeID); + return Objects.hash(this.NodeID); } @Override @@ -59,13 +59,12 @@ public boolean equals(Object object) { } NodeID other = (NodeID) object; - return Objects.equal(this.NodeID, other.NodeID); + return Objects.equals(this.NodeID, other.NodeID); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -77,8 +76,7 @@ public byte[] toXdrByteArray() throws IOException { } public static NodeID fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/OfferEntry.java b/src/main/java/org/stellar/sdk/xdr/OfferEntry.java index d4415109e..578ab2d84 100644 --- a/src/main/java/org/stellar/sdk/xdr/OfferEntry.java +++ b/src/main/java/org/stellar/sdk/xdr/OfferEntry.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -153,7 +153,7 @@ public static OfferEntry decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.sellerID, this.offerID, this.selling, @@ -171,20 +171,19 @@ public boolean equals(Object object) { } OfferEntry other = (OfferEntry) object; - return Objects.equal(this.sellerID, other.sellerID) - && Objects.equal(this.offerID, other.offerID) - && Objects.equal(this.selling, other.selling) - && Objects.equal(this.buying, other.buying) - && Objects.equal(this.amount, other.amount) - && Objects.equal(this.price, other.price) - && Objects.equal(this.flags, other.flags) - && Objects.equal(this.ext, other.ext); + return Objects.equals(this.sellerID, other.sellerID) + && Objects.equals(this.offerID, other.offerID) + && Objects.equals(this.selling, other.selling) + && Objects.equals(this.buying, other.buying) + && Objects.equals(this.amount, other.amount) + && Objects.equals(this.price, other.price) + && Objects.equals(this.flags, other.flags) + && Objects.equals(this.ext, other.ext); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -196,8 +195,7 @@ public byte[] toXdrByteArray() throws IOException { } public static OfferEntry fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -327,7 +325,7 @@ public static OfferEntryExt decode(XdrDataInputStream stream) throws IOException @Override public int hashCode() { - return Objects.hashCode(this.v); + return Objects.hash(this.v); } @Override @@ -337,13 +335,12 @@ public boolean equals(Object object) { } OfferEntryExt other = (OfferEntryExt) object; - return Objects.equal(this.v, other.v); + return Objects.equals(this.v, other.v); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -355,8 +352,7 @@ public byte[] toXdrByteArray() throws IOException { } public static OfferEntryExt fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/OfferEntryFlags.java b/src/main/java/org/stellar/sdk/xdr/OfferEntryFlags.java index 82721b7b1..07c112686 100644 --- a/src/main/java/org/stellar/sdk/xdr/OfferEntryFlags.java +++ b/src/main/java/org/stellar/sdk/xdr/OfferEntryFlags.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -53,8 +53,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -66,8 +65,7 @@ public byte[] toXdrByteArray() throws IOException { } public static OfferEntryFlags fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/Operation.java b/src/main/java/org/stellar/sdk/xdr/Operation.java index 1bf37c92c..ba5d805f8 100644 --- a/src/main/java/org/stellar/sdk/xdr/Operation.java +++ b/src/main/java/org/stellar/sdk/xdr/Operation.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -131,7 +131,7 @@ public static Operation decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.sourceAccount, this.body); + return Objects.hash(this.sourceAccount, this.body); } @Override @@ -141,14 +141,13 @@ public boolean equals(Object object) { } Operation other = (Operation) object; - return Objects.equal(this.sourceAccount, other.sourceAccount) - && Objects.equal(this.body, other.body); + return Objects.equals(this.sourceAccount, other.sourceAccount) + && Objects.equals(this.body, other.body); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -160,8 +159,7 @@ public byte[] toXdrByteArray() throws IOException { } public static Operation fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -838,7 +836,7 @@ public static OperationBody decode(XdrDataInputStream stream) throws IOException @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.createAccountOp, this.paymentOp, this.pathPaymentStrictReceiveOp, @@ -874,39 +872,38 @@ public boolean equals(Object object) { } OperationBody other = (OperationBody) object; - return Objects.equal(this.createAccountOp, other.createAccountOp) - && Objects.equal(this.paymentOp, other.paymentOp) - && Objects.equal(this.pathPaymentStrictReceiveOp, other.pathPaymentStrictReceiveOp) - && Objects.equal(this.manageSellOfferOp, other.manageSellOfferOp) - && Objects.equal(this.createPassiveSellOfferOp, other.createPassiveSellOfferOp) - && Objects.equal(this.setOptionsOp, other.setOptionsOp) - && Objects.equal(this.changeTrustOp, other.changeTrustOp) - && Objects.equal(this.allowTrustOp, other.allowTrustOp) - && Objects.equal(this.destination, other.destination) - && Objects.equal(this.manageDataOp, other.manageDataOp) - && Objects.equal(this.bumpSequenceOp, other.bumpSequenceOp) - && Objects.equal(this.manageBuyOfferOp, other.manageBuyOfferOp) - && Objects.equal(this.pathPaymentStrictSendOp, other.pathPaymentStrictSendOp) - && Objects.equal(this.createClaimableBalanceOp, other.createClaimableBalanceOp) - && Objects.equal(this.claimClaimableBalanceOp, other.claimClaimableBalanceOp) - && Objects.equal( + return Objects.equals(this.createAccountOp, other.createAccountOp) + && Objects.equals(this.paymentOp, other.paymentOp) + && Objects.equals(this.pathPaymentStrictReceiveOp, other.pathPaymentStrictReceiveOp) + && Objects.equals(this.manageSellOfferOp, other.manageSellOfferOp) + && Objects.equals(this.createPassiveSellOfferOp, other.createPassiveSellOfferOp) + && Objects.equals(this.setOptionsOp, other.setOptionsOp) + && Objects.equals(this.changeTrustOp, other.changeTrustOp) + && Objects.equals(this.allowTrustOp, other.allowTrustOp) + && Objects.equals(this.destination, other.destination) + && Objects.equals(this.manageDataOp, other.manageDataOp) + && Objects.equals(this.bumpSequenceOp, other.bumpSequenceOp) + && Objects.equals(this.manageBuyOfferOp, other.manageBuyOfferOp) + && Objects.equals(this.pathPaymentStrictSendOp, other.pathPaymentStrictSendOp) + && Objects.equals(this.createClaimableBalanceOp, other.createClaimableBalanceOp) + && Objects.equals(this.claimClaimableBalanceOp, other.claimClaimableBalanceOp) + && Objects.equals( this.beginSponsoringFutureReservesOp, other.beginSponsoringFutureReservesOp) - && Objects.equal(this.revokeSponsorshipOp, other.revokeSponsorshipOp) - && Objects.equal(this.clawbackOp, other.clawbackOp) - && Objects.equal(this.clawbackClaimableBalanceOp, other.clawbackClaimableBalanceOp) - && Objects.equal(this.setTrustLineFlagsOp, other.setTrustLineFlagsOp) - && Objects.equal(this.liquidityPoolDepositOp, other.liquidityPoolDepositOp) - && Objects.equal(this.liquidityPoolWithdrawOp, other.liquidityPoolWithdrawOp) - && Objects.equal(this.invokeHostFunctionOp, other.invokeHostFunctionOp) - && Objects.equal(this.bumpFootprintExpirationOp, other.bumpFootprintExpirationOp) - && Objects.equal(this.restoreFootprintOp, other.restoreFootprintOp) - && Objects.equal(this.type, other.type); + && Objects.equals(this.revokeSponsorshipOp, other.revokeSponsorshipOp) + && Objects.equals(this.clawbackOp, other.clawbackOp) + && Objects.equals(this.clawbackClaimableBalanceOp, other.clawbackClaimableBalanceOp) + && Objects.equals(this.setTrustLineFlagsOp, other.setTrustLineFlagsOp) + && Objects.equals(this.liquidityPoolDepositOp, other.liquidityPoolDepositOp) + && Objects.equals(this.liquidityPoolWithdrawOp, other.liquidityPoolWithdrawOp) + && Objects.equals(this.invokeHostFunctionOp, other.invokeHostFunctionOp) + && Objects.equals(this.bumpFootprintExpirationOp, other.bumpFootprintExpirationOp) + && Objects.equals(this.restoreFootprintOp, other.restoreFootprintOp) + && Objects.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -918,8 +915,7 @@ public byte[] toXdrByteArray() throws IOException { } public static OperationBody fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/OperationMeta.java b/src/main/java/org/stellar/sdk/xdr/OperationMeta.java index 1390366f3..e5181afe0 100644 --- a/src/main/java/org/stellar/sdk/xdr/OperationMeta.java +++ b/src/main/java/org/stellar/sdk/xdr/OperationMeta.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -49,7 +49,7 @@ public static OperationMeta decode(XdrDataInputStream stream) throws IOException @Override public int hashCode() { - return Objects.hashCode(this.changes); + return Objects.hash(this.changes); } @Override @@ -59,13 +59,12 @@ public boolean equals(Object object) { } OperationMeta other = (OperationMeta) object; - return Objects.equal(this.changes, other.changes); + return Objects.equals(this.changes, other.changes); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -77,8 +76,7 @@ public byte[] toXdrByteArray() throws IOException { } public static OperationMeta fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/OperationResult.java b/src/main/java/org/stellar/sdk/xdr/OperationResult.java index 383079877..e5dd07a70 100644 --- a/src/main/java/org/stellar/sdk/xdr/OperationResult.java +++ b/src/main/java/org/stellar/sdk/xdr/OperationResult.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -173,7 +173,7 @@ public static OperationResult decode(XdrDataInputStream stream) throws IOExcepti @Override public int hashCode() { - return Objects.hashCode(this.tr, this.code); + return Objects.hash(this.tr, this.code); } @Override @@ -183,13 +183,12 @@ public boolean equals(Object object) { } OperationResult other = (OperationResult) object; - return Objects.equal(this.tr, other.tr) && Objects.equal(this.code, other.code); + return Objects.equals(this.tr, other.tr) && Objects.equals(this.code, other.code); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -201,8 +200,7 @@ public byte[] toXdrByteArray() throws IOException { } public static OperationResult fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -920,7 +918,7 @@ public static OperationResultTr decode(XdrDataInputStream stream) throws IOExcep @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.createAccountResult, this.paymentResult, this.pathPaymentStrictReceiveResult, @@ -958,44 +956,43 @@ public boolean equals(Object object) { } OperationResultTr other = (OperationResultTr) object; - return Objects.equal(this.createAccountResult, other.createAccountResult) - && Objects.equal(this.paymentResult, other.paymentResult) - && Objects.equal( + return Objects.equals(this.createAccountResult, other.createAccountResult) + && Objects.equals(this.paymentResult, other.paymentResult) + && Objects.equals( this.pathPaymentStrictReceiveResult, other.pathPaymentStrictReceiveResult) - && Objects.equal(this.manageSellOfferResult, other.manageSellOfferResult) - && Objects.equal(this.createPassiveSellOfferResult, other.createPassiveSellOfferResult) - && Objects.equal(this.setOptionsResult, other.setOptionsResult) - && Objects.equal(this.changeTrustResult, other.changeTrustResult) - && Objects.equal(this.allowTrustResult, other.allowTrustResult) - && Objects.equal(this.accountMergeResult, other.accountMergeResult) - && Objects.equal(this.inflationResult, other.inflationResult) - && Objects.equal(this.manageDataResult, other.manageDataResult) - && Objects.equal(this.bumpSeqResult, other.bumpSeqResult) - && Objects.equal(this.manageBuyOfferResult, other.manageBuyOfferResult) - && Objects.equal(this.pathPaymentStrictSendResult, other.pathPaymentStrictSendResult) - && Objects.equal(this.createClaimableBalanceResult, other.createClaimableBalanceResult) - && Objects.equal(this.claimClaimableBalanceResult, other.claimClaimableBalanceResult) - && Objects.equal( + && Objects.equals(this.manageSellOfferResult, other.manageSellOfferResult) + && Objects.equals(this.createPassiveSellOfferResult, other.createPassiveSellOfferResult) + && Objects.equals(this.setOptionsResult, other.setOptionsResult) + && Objects.equals(this.changeTrustResult, other.changeTrustResult) + && Objects.equals(this.allowTrustResult, other.allowTrustResult) + && Objects.equals(this.accountMergeResult, other.accountMergeResult) + && Objects.equals(this.inflationResult, other.inflationResult) + && Objects.equals(this.manageDataResult, other.manageDataResult) + && Objects.equals(this.bumpSeqResult, other.bumpSeqResult) + && Objects.equals(this.manageBuyOfferResult, other.manageBuyOfferResult) + && Objects.equals(this.pathPaymentStrictSendResult, other.pathPaymentStrictSendResult) + && Objects.equals(this.createClaimableBalanceResult, other.createClaimableBalanceResult) + && Objects.equals(this.claimClaimableBalanceResult, other.claimClaimableBalanceResult) + && Objects.equals( this.beginSponsoringFutureReservesResult, other.beginSponsoringFutureReservesResult) - && Objects.equal( + && Objects.equals( this.endSponsoringFutureReservesResult, other.endSponsoringFutureReservesResult) - && Objects.equal(this.revokeSponsorshipResult, other.revokeSponsorshipResult) - && Objects.equal(this.clawbackResult, other.clawbackResult) - && Objects.equal( + && Objects.equals(this.revokeSponsorshipResult, other.revokeSponsorshipResult) + && Objects.equals(this.clawbackResult, other.clawbackResult) + && Objects.equals( this.clawbackClaimableBalanceResult, other.clawbackClaimableBalanceResult) - && Objects.equal(this.setTrustLineFlagsResult, other.setTrustLineFlagsResult) - && Objects.equal(this.liquidityPoolDepositResult, other.liquidityPoolDepositResult) - && Objects.equal(this.liquidityPoolWithdrawResult, other.liquidityPoolWithdrawResult) - && Objects.equal(this.invokeHostFunctionResult, other.invokeHostFunctionResult) - && Objects.equal(this.bumpFootprintExpirationResult, other.bumpFootprintExpirationResult) - && Objects.equal(this.restoreFootprintResult, other.restoreFootprintResult) - && Objects.equal(this.type, other.type); + && Objects.equals(this.setTrustLineFlagsResult, other.setTrustLineFlagsResult) + && Objects.equals(this.liquidityPoolDepositResult, other.liquidityPoolDepositResult) + && Objects.equals(this.liquidityPoolWithdrawResult, other.liquidityPoolWithdrawResult) + && Objects.equals(this.invokeHostFunctionResult, other.invokeHostFunctionResult) + && Objects.equals(this.bumpFootprintExpirationResult, other.bumpFootprintExpirationResult) + && Objects.equals(this.restoreFootprintResult, other.restoreFootprintResult) + && Objects.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -1007,8 +1004,7 @@ public byte[] toXdrByteArray() throws IOException { } public static OperationResultTr fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/OperationResultCode.java b/src/main/java/org/stellar/sdk/xdr/OperationResultCode.java index ebf4a5bcc..b167762de 100644 --- a/src/main/java/org/stellar/sdk/xdr/OperationResultCode.java +++ b/src/main/java/org/stellar/sdk/xdr/OperationResultCode.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -77,8 +77,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -90,8 +89,7 @@ public byte[] toXdrByteArray() throws IOException { } public static OperationResultCode fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/OperationType.java b/src/main/java/org/stellar/sdk/xdr/OperationType.java index c4c6d391e..1ffec8c42 100644 --- a/src/main/java/org/stellar/sdk/xdr/OperationType.java +++ b/src/main/java/org/stellar/sdk/xdr/OperationType.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -155,8 +155,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -168,8 +167,7 @@ public byte[] toXdrByteArray() throws IOException { } public static OperationType fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/PathPaymentStrictReceiveOp.java b/src/main/java/org/stellar/sdk/xdr/PathPaymentStrictReceiveOp.java index 869a5202d..b6a5b5534 100644 --- a/src/main/java/org/stellar/sdk/xdr/PathPaymentStrictReceiveOp.java +++ b/src/main/java/org/stellar/sdk/xdr/PathPaymentStrictReceiveOp.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -128,7 +128,7 @@ public static PathPaymentStrictReceiveOp decode(XdrDataInputStream stream) throw @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.sendAsset, this.sendMax, this.destination, @@ -144,18 +144,17 @@ public boolean equals(Object object) { } PathPaymentStrictReceiveOp other = (PathPaymentStrictReceiveOp) object; - return Objects.equal(this.sendAsset, other.sendAsset) - && Objects.equal(this.sendMax, other.sendMax) - && Objects.equal(this.destination, other.destination) - && Objects.equal(this.destAsset, other.destAsset) - && Objects.equal(this.destAmount, other.destAmount) + return Objects.equals(this.sendAsset, other.sendAsset) + && Objects.equals(this.sendMax, other.sendMax) + && Objects.equals(this.destination, other.destination) + && Objects.equals(this.destAsset, other.destAsset) + && Objects.equals(this.destAmount, other.destAmount) && Arrays.equals(this.path, other.path); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -167,8 +166,7 @@ public byte[] toXdrByteArray() throws IOException { } public static PathPaymentStrictReceiveOp fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/PathPaymentStrictReceiveResult.java b/src/main/java/org/stellar/sdk/xdr/PathPaymentStrictReceiveResult.java index 85caab2ac..98725de63 100644 --- a/src/main/java/org/stellar/sdk/xdr/PathPaymentStrictReceiveResult.java +++ b/src/main/java/org/stellar/sdk/xdr/PathPaymentStrictReceiveResult.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -172,7 +172,7 @@ public static PathPaymentStrictReceiveResult decode(XdrDataInputStream stream) @Override public int hashCode() { - return Objects.hashCode(this.success, this.noIssuer, this.code); + return Objects.hash(this.success, this.noIssuer, this.code); } @Override @@ -182,15 +182,14 @@ public boolean equals(Object object) { } PathPaymentStrictReceiveResult other = (PathPaymentStrictReceiveResult) object; - return Objects.equal(this.success, other.success) - && Objects.equal(this.noIssuer, other.noIssuer) - && Objects.equal(this.code, other.code); + return Objects.equals(this.success, other.success) + && Objects.equals(this.noIssuer, other.noIssuer) + && Objects.equals(this.code, other.code); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -202,8 +201,7 @@ public byte[] toXdrByteArray() throws IOException { } public static PathPaymentStrictReceiveResult fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -267,7 +265,7 @@ public static PathPaymentStrictReceiveResultSuccess decode(XdrDataInputStream st @Override public int hashCode() { - return Objects.hashCode(Arrays.hashCode(this.offers), this.last); + return Objects.hash(Arrays.hashCode(this.offers), this.last); } @Override @@ -277,13 +275,12 @@ public boolean equals(Object object) { } PathPaymentStrictReceiveResultSuccess other = (PathPaymentStrictReceiveResultSuccess) object; - return Arrays.equals(this.offers, other.offers) && Objects.equal(this.last, other.last); + return Arrays.equals(this.offers, other.offers) && Objects.equals(this.last, other.last); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -296,8 +293,7 @@ public byte[] toXdrByteArray() throws IOException { public static PathPaymentStrictReceiveResultSuccess fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/PathPaymentStrictReceiveResultCode.java b/src/main/java/org/stellar/sdk/xdr/PathPaymentStrictReceiveResultCode.java index 1e30560e7..a3690e156 100644 --- a/src/main/java/org/stellar/sdk/xdr/PathPaymentStrictReceiveResultCode.java +++ b/src/main/java/org/stellar/sdk/xdr/PathPaymentStrictReceiveResultCode.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -113,8 +113,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -126,8 +125,7 @@ public byte[] toXdrByteArray() throws IOException { } public static PathPaymentStrictReceiveResultCode fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/PathPaymentStrictSendOp.java b/src/main/java/org/stellar/sdk/xdr/PathPaymentStrictSendOp.java index 109b4cf11..f1dab1086 100644 --- a/src/main/java/org/stellar/sdk/xdr/PathPaymentStrictSendOp.java +++ b/src/main/java/org/stellar/sdk/xdr/PathPaymentStrictSendOp.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -128,7 +128,7 @@ public static PathPaymentStrictSendOp decode(XdrDataInputStream stream) throws I @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.sendAsset, this.sendAmount, this.destination, @@ -144,18 +144,17 @@ public boolean equals(Object object) { } PathPaymentStrictSendOp other = (PathPaymentStrictSendOp) object; - return Objects.equal(this.sendAsset, other.sendAsset) - && Objects.equal(this.sendAmount, other.sendAmount) - && Objects.equal(this.destination, other.destination) - && Objects.equal(this.destAsset, other.destAsset) - && Objects.equal(this.destMin, other.destMin) + return Objects.equals(this.sendAsset, other.sendAsset) + && Objects.equals(this.sendAmount, other.sendAmount) + && Objects.equals(this.destination, other.destination) + && Objects.equals(this.destAsset, other.destAsset) + && Objects.equals(this.destMin, other.destMin) && Arrays.equals(this.path, other.path); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -167,8 +166,7 @@ public byte[] toXdrByteArray() throws IOException { } public static PathPaymentStrictSendOp fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/PathPaymentStrictSendResult.java b/src/main/java/org/stellar/sdk/xdr/PathPaymentStrictSendResult.java index d8300ef8c..3346740cc 100644 --- a/src/main/java/org/stellar/sdk/xdr/PathPaymentStrictSendResult.java +++ b/src/main/java/org/stellar/sdk/xdr/PathPaymentStrictSendResult.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -168,7 +168,7 @@ public static PathPaymentStrictSendResult decode(XdrDataInputStream stream) thro @Override public int hashCode() { - return Objects.hashCode(this.success, this.noIssuer, this.code); + return Objects.hash(this.success, this.noIssuer, this.code); } @Override @@ -178,15 +178,14 @@ public boolean equals(Object object) { } PathPaymentStrictSendResult other = (PathPaymentStrictSendResult) object; - return Objects.equal(this.success, other.success) - && Objects.equal(this.noIssuer, other.noIssuer) - && Objects.equal(this.code, other.code); + return Objects.equals(this.success, other.success) + && Objects.equals(this.noIssuer, other.noIssuer) + && Objects.equals(this.code, other.code); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -198,8 +197,7 @@ public byte[] toXdrByteArray() throws IOException { } public static PathPaymentStrictSendResult fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -263,7 +261,7 @@ public static PathPaymentStrictSendResultSuccess decode(XdrDataInputStream strea @Override public int hashCode() { - return Objects.hashCode(Arrays.hashCode(this.offers), this.last); + return Objects.hash(Arrays.hashCode(this.offers), this.last); } @Override @@ -273,13 +271,12 @@ public boolean equals(Object object) { } PathPaymentStrictSendResultSuccess other = (PathPaymentStrictSendResultSuccess) object; - return Arrays.equals(this.offers, other.offers) && Objects.equal(this.last, other.last); + return Arrays.equals(this.offers, other.offers) && Objects.equals(this.last, other.last); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -291,8 +288,7 @@ public byte[] toXdrByteArray() throws IOException { } public static PathPaymentStrictSendResultSuccess fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/PathPaymentStrictSendResultCode.java b/src/main/java/org/stellar/sdk/xdr/PathPaymentStrictSendResultCode.java index fef80eff2..e4624b50b 100644 --- a/src/main/java/org/stellar/sdk/xdr/PathPaymentStrictSendResultCode.java +++ b/src/main/java/org/stellar/sdk/xdr/PathPaymentStrictSendResultCode.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -112,8 +112,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -125,8 +124,7 @@ public byte[] toXdrByteArray() throws IOException { } public static PathPaymentStrictSendResultCode fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/PaymentOp.java b/src/main/java/org/stellar/sdk/xdr/PaymentOp.java index 4e159bf9f..28fe5418a 100644 --- a/src/main/java/org/stellar/sdk/xdr/PaymentOp.java +++ b/src/main/java/org/stellar/sdk/xdr/PaymentOp.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -75,7 +75,7 @@ public static PaymentOp decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.destination, this.asset, this.amount); + return Objects.hash(this.destination, this.asset, this.amount); } @Override @@ -85,15 +85,14 @@ public boolean equals(Object object) { } PaymentOp other = (PaymentOp) object; - return Objects.equal(this.destination, other.destination) - && Objects.equal(this.asset, other.asset) - && Objects.equal(this.amount, other.amount); + return Objects.equals(this.destination, other.destination) + && Objects.equals(this.asset, other.asset) + && Objects.equals(this.amount, other.amount); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -105,8 +104,7 @@ public byte[] toXdrByteArray() throws IOException { } public static PaymentOp fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/PaymentResult.java b/src/main/java/org/stellar/sdk/xdr/PaymentResult.java index 879831a58..35a798897 100644 --- a/src/main/java/org/stellar/sdk/xdr/PaymentResult.java +++ b/src/main/java/org/stellar/sdk/xdr/PaymentResult.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -106,7 +106,7 @@ public static PaymentResult decode(XdrDataInputStream stream) throws IOException @Override public int hashCode() { - return Objects.hashCode(this.code); + return Objects.hash(this.code); } @Override @@ -116,13 +116,12 @@ public boolean equals(Object object) { } PaymentResult other = (PaymentResult) object; - return Objects.equal(this.code, other.code); + return Objects.equals(this.code, other.code); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -134,8 +133,7 @@ public byte[] toXdrByteArray() throws IOException { } public static PaymentResult fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/PaymentResultCode.java b/src/main/java/org/stellar/sdk/xdr/PaymentResultCode.java index aa8b3e88b..5bd68c860 100644 --- a/src/main/java/org/stellar/sdk/xdr/PaymentResultCode.java +++ b/src/main/java/org/stellar/sdk/xdr/PaymentResultCode.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -91,8 +91,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -104,8 +103,7 @@ public byte[] toXdrByteArray() throws IOException { } public static PaymentResultCode fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/PeerAddress.java b/src/main/java/org/stellar/sdk/xdr/PeerAddress.java index 59171a0dd..97f2421b4 100644 --- a/src/main/java/org/stellar/sdk/xdr/PeerAddress.java +++ b/src/main/java/org/stellar/sdk/xdr/PeerAddress.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -83,7 +83,7 @@ public static PeerAddress decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.ip, this.port, this.numFailures); + return Objects.hash(this.ip, this.port, this.numFailures); } @Override @@ -93,15 +93,14 @@ public boolean equals(Object object) { } PeerAddress other = (PeerAddress) object; - return Objects.equal(this.ip, other.ip) - && Objects.equal(this.port, other.port) - && Objects.equal(this.numFailures, other.numFailures); + return Objects.equals(this.ip, other.ip) + && Objects.equals(this.port, other.port) + && Objects.equals(this.numFailures, other.numFailures); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -113,8 +112,7 @@ public byte[] toXdrByteArray() throws IOException { } public static PeerAddress fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -257,7 +255,7 @@ public static PeerAddressIp decode(XdrDataInputStream stream) throws IOException @Override public int hashCode() { - return Objects.hashCode(Arrays.hashCode(this.ipv4), Arrays.hashCode(this.ipv6), this.type); + return Objects.hash(Arrays.hashCode(this.ipv4), Arrays.hashCode(this.ipv6), this.type); } @Override @@ -269,13 +267,12 @@ public boolean equals(Object object) { PeerAddressIp other = (PeerAddressIp) object; return Arrays.equals(this.ipv4, other.ipv4) && Arrays.equals(this.ipv6, other.ipv6) - && Objects.equal(this.type, other.type); + && Objects.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -287,8 +284,7 @@ public byte[] toXdrByteArray() throws IOException { } public static PeerAddressIp fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/PeerStatList.java b/src/main/java/org/stellar/sdk/xdr/PeerStatList.java index 365b758a5..4065a0d27 100644 --- a/src/main/java/org/stellar/sdk/xdr/PeerStatList.java +++ b/src/main/java/org/stellar/sdk/xdr/PeerStatList.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; // === xdr source ============================================================ @@ -73,8 +73,7 @@ public boolean equals(Object object) { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -86,8 +85,7 @@ public byte[] toXdrByteArray() throws IOException { } public static PeerStatList fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/PeerStats.java b/src/main/java/org/stellar/sdk/xdr/PeerStats.java index 993a13257..ac31be23b 100644 --- a/src/main/java/org/stellar/sdk/xdr/PeerStats.java +++ b/src/main/java/org/stellar/sdk/xdr/PeerStats.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -233,7 +233,7 @@ public static PeerStats decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.id, this.versionStr, this.messagesRead, @@ -258,27 +258,26 @@ public boolean equals(Object object) { } PeerStats other = (PeerStats) object; - return Objects.equal(this.id, other.id) - && Objects.equal(this.versionStr, other.versionStr) - && Objects.equal(this.messagesRead, other.messagesRead) - && Objects.equal(this.messagesWritten, other.messagesWritten) - && Objects.equal(this.bytesRead, other.bytesRead) - && Objects.equal(this.bytesWritten, other.bytesWritten) - && Objects.equal(this.secondsConnected, other.secondsConnected) - && Objects.equal(this.uniqueFloodBytesRecv, other.uniqueFloodBytesRecv) - && Objects.equal(this.duplicateFloodBytesRecv, other.duplicateFloodBytesRecv) - && Objects.equal(this.uniqueFetchBytesRecv, other.uniqueFetchBytesRecv) - && Objects.equal(this.duplicateFetchBytesRecv, other.duplicateFetchBytesRecv) - && Objects.equal(this.uniqueFloodMessageRecv, other.uniqueFloodMessageRecv) - && Objects.equal(this.duplicateFloodMessageRecv, other.duplicateFloodMessageRecv) - && Objects.equal(this.uniqueFetchMessageRecv, other.uniqueFetchMessageRecv) - && Objects.equal(this.duplicateFetchMessageRecv, other.duplicateFetchMessageRecv); + return Objects.equals(this.id, other.id) + && Objects.equals(this.versionStr, other.versionStr) + && Objects.equals(this.messagesRead, other.messagesRead) + && Objects.equals(this.messagesWritten, other.messagesWritten) + && Objects.equals(this.bytesRead, other.bytesRead) + && Objects.equals(this.bytesWritten, other.bytesWritten) + && Objects.equals(this.secondsConnected, other.secondsConnected) + && Objects.equals(this.uniqueFloodBytesRecv, other.uniqueFloodBytesRecv) + && Objects.equals(this.duplicateFloodBytesRecv, other.duplicateFloodBytesRecv) + && Objects.equals(this.uniqueFetchBytesRecv, other.uniqueFetchBytesRecv) + && Objects.equals(this.duplicateFetchBytesRecv, other.duplicateFetchBytesRecv) + && Objects.equals(this.uniqueFloodMessageRecv, other.uniqueFloodMessageRecv) + && Objects.equals(this.duplicateFloodMessageRecv, other.duplicateFloodMessageRecv) + && Objects.equals(this.uniqueFetchMessageRecv, other.uniqueFetchMessageRecv) + && Objects.equals(this.duplicateFetchMessageRecv, other.duplicateFetchMessageRecv); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -290,8 +289,7 @@ public byte[] toXdrByteArray() throws IOException { } public static PeerStats fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/PersistedSCPState.java b/src/main/java/org/stellar/sdk/xdr/PersistedSCPState.java index 9e8ab197b..5094b3fd0 100644 --- a/src/main/java/org/stellar/sdk/xdr/PersistedSCPState.java +++ b/src/main/java/org/stellar/sdk/xdr/PersistedSCPState.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -120,7 +120,7 @@ public static PersistedSCPState decode(XdrDataInputStream stream) throws IOExcep @Override public int hashCode() { - return Objects.hashCode(this.v0, this.v1, this.v); + return Objects.hash(this.v0, this.v1, this.v); } @Override @@ -130,15 +130,14 @@ public boolean equals(Object object) { } PersistedSCPState other = (PersistedSCPState) object; - return Objects.equal(this.v0, other.v0) - && Objects.equal(this.v1, other.v1) - && Objects.equal(this.v, other.v); + return Objects.equals(this.v0, other.v0) + && Objects.equals(this.v1, other.v1) + && Objects.equals(this.v, other.v); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -150,8 +149,7 @@ public byte[] toXdrByteArray() throws IOException { } public static PersistedSCPState fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/PersistedSCPStateV0.java b/src/main/java/org/stellar/sdk/xdr/PersistedSCPStateV0.java index e2a8592dc..b2021a440 100644 --- a/src/main/java/org/stellar/sdk/xdr/PersistedSCPStateV0.java +++ b/src/main/java/org/stellar/sdk/xdr/PersistedSCPStateV0.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -101,7 +101,7 @@ public static PersistedSCPStateV0 decode(XdrDataInputStream stream) throws IOExc @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( Arrays.hashCode(this.scpEnvelopes), Arrays.hashCode(this.quorumSets), Arrays.hashCode(this.txSets)); @@ -121,8 +121,7 @@ public boolean equals(Object object) { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -134,8 +133,7 @@ public byte[] toXdrByteArray() throws IOException { } public static PersistedSCPStateV0 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/PersistedSCPStateV1.java b/src/main/java/org/stellar/sdk/xdr/PersistedSCPStateV1.java index 5ae64e598..ca660fa19 100644 --- a/src/main/java/org/stellar/sdk/xdr/PersistedSCPStateV1.java +++ b/src/main/java/org/stellar/sdk/xdr/PersistedSCPStateV1.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -81,7 +81,7 @@ public static PersistedSCPStateV1 decode(XdrDataInputStream stream) throws IOExc @Override public int hashCode() { - return Objects.hashCode(Arrays.hashCode(this.scpEnvelopes), Arrays.hashCode(this.quorumSets)); + return Objects.hash(Arrays.hashCode(this.scpEnvelopes), Arrays.hashCode(this.quorumSets)); } @Override @@ -97,8 +97,7 @@ public boolean equals(Object object) { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -110,8 +109,7 @@ public byte[] toXdrByteArray() throws IOException { } public static PersistedSCPStateV1 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/PoolID.java b/src/main/java/org/stellar/sdk/xdr/PoolID.java index c0457ace9..dcf3f8b9c 100644 --- a/src/main/java/org/stellar/sdk/xdr/PoolID.java +++ b/src/main/java/org/stellar/sdk/xdr/PoolID.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -49,7 +49,7 @@ public static PoolID decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.PoolID); + return Objects.hash(this.PoolID); } @Override @@ -59,13 +59,12 @@ public boolean equals(Object object) { } PoolID other = (PoolID) object; - return Objects.equal(this.PoolID, other.PoolID); + return Objects.equals(this.PoolID, other.PoolID); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -77,8 +76,7 @@ public byte[] toXdrByteArray() throws IOException { } public static PoolID fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/PreconditionType.java b/src/main/java/org/stellar/sdk/xdr/PreconditionType.java index 353f87188..0c0baa105 100644 --- a/src/main/java/org/stellar/sdk/xdr/PreconditionType.java +++ b/src/main/java/org/stellar/sdk/xdr/PreconditionType.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -59,8 +59,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -72,8 +71,7 @@ public byte[] toXdrByteArray() throws IOException { } public static PreconditionType fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/Preconditions.java b/src/main/java/org/stellar/sdk/xdr/Preconditions.java index 587eab130..f50752ae5 100644 --- a/src/main/java/org/stellar/sdk/xdr/Preconditions.java +++ b/src/main/java/org/stellar/sdk/xdr/Preconditions.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -126,7 +126,7 @@ public static Preconditions decode(XdrDataInputStream stream) throws IOException @Override public int hashCode() { - return Objects.hashCode(this.timeBounds, this.v2, this.type); + return Objects.hash(this.timeBounds, this.v2, this.type); } @Override @@ -136,15 +136,14 @@ public boolean equals(Object object) { } Preconditions other = (Preconditions) object; - return Objects.equal(this.timeBounds, other.timeBounds) - && Objects.equal(this.v2, other.v2) - && Objects.equal(this.type, other.type); + return Objects.equals(this.timeBounds, other.timeBounds) + && Objects.equals(this.v2, other.v2) + && Objects.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -156,8 +155,7 @@ public byte[] toXdrByteArray() throws IOException { } public static Preconditions fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/PreconditionsV2.java b/src/main/java/org/stellar/sdk/xdr/PreconditionsV2.java index 7f95d06e3..80f001c7a 100644 --- a/src/main/java/org/stellar/sdk/xdr/PreconditionsV2.java +++ b/src/main/java/org/stellar/sdk/xdr/PreconditionsV2.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -170,7 +170,7 @@ public static PreconditionsV2 decode(XdrDataInputStream stream) throws IOExcepti @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.timeBounds, this.ledgerBounds, this.minSeqNum, @@ -186,18 +186,17 @@ public boolean equals(Object object) { } PreconditionsV2 other = (PreconditionsV2) object; - return Objects.equal(this.timeBounds, other.timeBounds) - && Objects.equal(this.ledgerBounds, other.ledgerBounds) - && Objects.equal(this.minSeqNum, other.minSeqNum) - && Objects.equal(this.minSeqAge, other.minSeqAge) - && Objects.equal(this.minSeqLedgerGap, other.minSeqLedgerGap) + return Objects.equals(this.timeBounds, other.timeBounds) + && Objects.equals(this.ledgerBounds, other.ledgerBounds) + && Objects.equals(this.minSeqNum, other.minSeqNum) + && Objects.equals(this.minSeqAge, other.minSeqAge) + && Objects.equals(this.minSeqLedgerGap, other.minSeqLedgerGap) && Arrays.equals(this.extraSigners, other.extraSigners); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -209,8 +208,7 @@ public byte[] toXdrByteArray() throws IOException { } public static PreconditionsV2 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/Price.java b/src/main/java/org/stellar/sdk/xdr/Price.java index a6831d043..e3f0da8fb 100644 --- a/src/main/java/org/stellar/sdk/xdr/Price.java +++ b/src/main/java/org/stellar/sdk/xdr/Price.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -61,7 +61,7 @@ public static Price decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.n, this.d); + return Objects.hash(this.n, this.d); } @Override @@ -71,13 +71,12 @@ public boolean equals(Object object) { } Price other = (Price) object; - return Objects.equal(this.n, other.n) && Objects.equal(this.d, other.d); + return Objects.equals(this.n, other.n) && Objects.equals(this.d, other.d); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -89,8 +88,7 @@ public byte[] toXdrByteArray() throws IOException { } public static Price fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/PublicKey.java b/src/main/java/org/stellar/sdk/xdr/PublicKey.java index cfe9b4d70..1447caac4 100644 --- a/src/main/java/org/stellar/sdk/xdr/PublicKey.java +++ b/src/main/java/org/stellar/sdk/xdr/PublicKey.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -95,7 +95,7 @@ public static PublicKey decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.ed25519, this.type); + return Objects.hash(this.ed25519, this.type); } @Override @@ -105,13 +105,12 @@ public boolean equals(Object object) { } PublicKey other = (PublicKey) object; - return Objects.equal(this.ed25519, other.ed25519) && Objects.equal(this.type, other.type); + return Objects.equals(this.ed25519, other.ed25519) && Objects.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -123,8 +122,7 @@ public byte[] toXdrByteArray() throws IOException { } public static PublicKey fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/PublicKeyType.java b/src/main/java/org/stellar/sdk/xdr/PublicKeyType.java index 9ce503ee7..5bfd65570 100644 --- a/src/main/java/org/stellar/sdk/xdr/PublicKeyType.java +++ b/src/main/java/org/stellar/sdk/xdr/PublicKeyType.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -51,8 +51,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -64,8 +63,7 @@ public byte[] toXdrByteArray() throws IOException { } public static PublicKeyType fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/RestoreFootprintOp.java b/src/main/java/org/stellar/sdk/xdr/RestoreFootprintOp.java index b46ef9800..ece865ed7 100644 --- a/src/main/java/org/stellar/sdk/xdr/RestoreFootprintOp.java +++ b/src/main/java/org/stellar/sdk/xdr/RestoreFootprintOp.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -49,7 +49,7 @@ public static RestoreFootprintOp decode(XdrDataInputStream stream) throws IOExce @Override public int hashCode() { - return Objects.hashCode(this.ext); + return Objects.hash(this.ext); } @Override @@ -59,13 +59,12 @@ public boolean equals(Object object) { } RestoreFootprintOp other = (RestoreFootprintOp) object; - return Objects.equal(this.ext, other.ext); + return Objects.equals(this.ext, other.ext); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -77,8 +76,7 @@ public byte[] toXdrByteArray() throws IOException { } public static RestoreFootprintOp fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/RestoreFootprintResult.java b/src/main/java/org/stellar/sdk/xdr/RestoreFootprintResult.java index 992cb6da2..454fcd591 100644 --- a/src/main/java/org/stellar/sdk/xdr/RestoreFootprintResult.java +++ b/src/main/java/org/stellar/sdk/xdr/RestoreFootprintResult.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -86,7 +86,7 @@ public static RestoreFootprintResult decode(XdrDataInputStream stream) throws IO @Override public int hashCode() { - return Objects.hashCode(this.code); + return Objects.hash(this.code); } @Override @@ -96,13 +96,12 @@ public boolean equals(Object object) { } RestoreFootprintResult other = (RestoreFootprintResult) object; - return Objects.equal(this.code, other.code); + return Objects.equals(this.code, other.code); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -114,8 +113,7 @@ public byte[] toXdrByteArray() throws IOException { } public static RestoreFootprintResult fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/RestoreFootprintResultCode.java b/src/main/java/org/stellar/sdk/xdr/RestoreFootprintResultCode.java index 03005accb..2f08de039 100644 --- a/src/main/java/org/stellar/sdk/xdr/RestoreFootprintResultCode.java +++ b/src/main/java/org/stellar/sdk/xdr/RestoreFootprintResultCode.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -63,8 +63,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -76,8 +75,7 @@ public byte[] toXdrByteArray() throws IOException { } public static RestoreFootprintResultCode fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/RevokeSponsorshipOp.java b/src/main/java/org/stellar/sdk/xdr/RevokeSponsorshipOp.java index 9c626c763..c10a0ba19 100644 --- a/src/main/java/org/stellar/sdk/xdr/RevokeSponsorshipOp.java +++ b/src/main/java/org/stellar/sdk/xdr/RevokeSponsorshipOp.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -125,7 +125,7 @@ public static RevokeSponsorshipOp decode(XdrDataInputStream stream) throws IOExc @Override public int hashCode() { - return Objects.hashCode(this.ledgerKey, this.signer, this.type); + return Objects.hash(this.ledgerKey, this.signer, this.type); } @Override @@ -135,15 +135,14 @@ public boolean equals(Object object) { } RevokeSponsorshipOp other = (RevokeSponsorshipOp) object; - return Objects.equal(this.ledgerKey, other.ledgerKey) - && Objects.equal(this.signer, other.signer) - && Objects.equal(this.type, other.type); + return Objects.equals(this.ledgerKey, other.ledgerKey) + && Objects.equals(this.signer, other.signer) + && Objects.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -155,8 +154,7 @@ public byte[] toXdrByteArray() throws IOException { } public static RevokeSponsorshipOp fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -209,7 +207,7 @@ public static RevokeSponsorshipOpSigner decode(XdrDataInputStream stream) throws @Override public int hashCode() { - return Objects.hashCode(this.accountID, this.signerKey); + return Objects.hash(this.accountID, this.signerKey); } @Override @@ -219,14 +217,13 @@ public boolean equals(Object object) { } RevokeSponsorshipOpSigner other = (RevokeSponsorshipOpSigner) object; - return Objects.equal(this.accountID, other.accountID) - && Objects.equal(this.signerKey, other.signerKey); + return Objects.equals(this.accountID, other.accountID) + && Objects.equals(this.signerKey, other.signerKey); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -238,8 +235,7 @@ public byte[] toXdrByteArray() throws IOException { } public static RevokeSponsorshipOpSigner fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/RevokeSponsorshipResult.java b/src/main/java/org/stellar/sdk/xdr/RevokeSponsorshipResult.java index ad6aa5555..b5a027ea4 100644 --- a/src/main/java/org/stellar/sdk/xdr/RevokeSponsorshipResult.java +++ b/src/main/java/org/stellar/sdk/xdr/RevokeSponsorshipResult.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -95,7 +95,7 @@ public static RevokeSponsorshipResult decode(XdrDataInputStream stream) throws I @Override public int hashCode() { - return Objects.hashCode(this.code); + return Objects.hash(this.code); } @Override @@ -105,13 +105,12 @@ public boolean equals(Object object) { } RevokeSponsorshipResult other = (RevokeSponsorshipResult) object; - return Objects.equal(this.code, other.code); + return Objects.equals(this.code, other.code); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -123,8 +122,7 @@ public byte[] toXdrByteArray() throws IOException { } public static RevokeSponsorshipResult fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/RevokeSponsorshipResultCode.java b/src/main/java/org/stellar/sdk/xdr/RevokeSponsorshipResultCode.java index 2f8ca595e..edcf6ee99 100644 --- a/src/main/java/org/stellar/sdk/xdr/RevokeSponsorshipResultCode.java +++ b/src/main/java/org/stellar/sdk/xdr/RevokeSponsorshipResultCode.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -75,8 +75,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -88,8 +87,7 @@ public byte[] toXdrByteArray() throws IOException { } public static RevokeSponsorshipResultCode fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/RevokeSponsorshipType.java b/src/main/java/org/stellar/sdk/xdr/RevokeSponsorshipType.java index 5b568419d..a24bed2e7 100644 --- a/src/main/java/org/stellar/sdk/xdr/RevokeSponsorshipType.java +++ b/src/main/java/org/stellar/sdk/xdr/RevokeSponsorshipType.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -56,8 +56,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -69,8 +68,7 @@ public byte[] toXdrByteArray() throws IOException { } public static RevokeSponsorshipType fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCAddress.java b/src/main/java/org/stellar/sdk/xdr/SCAddress.java index e3217a128..c238538d2 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCAddress.java +++ b/src/main/java/org/stellar/sdk/xdr/SCAddress.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -120,7 +120,7 @@ public static SCAddress decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.accountId, this.contractId, this.type); + return Objects.hash(this.accountId, this.contractId, this.type); } @Override @@ -130,15 +130,14 @@ public boolean equals(Object object) { } SCAddress other = (SCAddress) object; - return Objects.equal(this.accountId, other.accountId) - && Objects.equal(this.contractId, other.contractId) - && Objects.equal(this.type, other.type); + return Objects.equals(this.accountId, other.accountId) + && Objects.equals(this.contractId, other.contractId) + && Objects.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -150,8 +149,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCAddress fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCAddressType.java b/src/main/java/org/stellar/sdk/xdr/SCAddressType.java index f80ce3068..05dabef98 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCAddressType.java +++ b/src/main/java/org/stellar/sdk/xdr/SCAddressType.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -55,8 +55,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -68,8 +67,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCAddressType fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCBytes.java b/src/main/java/org/stellar/sdk/xdr/SCBytes.java index 0b111ada5..4fdd71f07 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCBytes.java +++ b/src/main/java/org/stellar/sdk/xdr/SCBytes.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; // === xdr source ============================================================ @@ -68,8 +68,7 @@ public boolean equals(Object object) { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -81,8 +80,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCBytes fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCContractInstance.java b/src/main/java/org/stellar/sdk/xdr/SCContractInstance.java index d9fe5b6e0..8a6bf8816 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCContractInstance.java +++ b/src/main/java/org/stellar/sdk/xdr/SCContractInstance.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -69,7 +69,7 @@ public static SCContractInstance decode(XdrDataInputStream stream) throws IOExce @Override public int hashCode() { - return Objects.hashCode(this.executable, this.storage); + return Objects.hash(this.executable, this.storage); } @Override @@ -79,14 +79,13 @@ public boolean equals(Object object) { } SCContractInstance other = (SCContractInstance) object; - return Objects.equal(this.executable, other.executable) - && Objects.equal(this.storage, other.storage); + return Objects.equals(this.executable, other.executable) + && Objects.equals(this.storage, other.storage); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -98,8 +97,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCContractInstance fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCEnvMetaEntry.java b/src/main/java/org/stellar/sdk/xdr/SCEnvMetaEntry.java index 64ac8f1c3..add97d7f0 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCEnvMetaEntry.java +++ b/src/main/java/org/stellar/sdk/xdr/SCEnvMetaEntry.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -95,7 +95,7 @@ public static SCEnvMetaEntry decode(XdrDataInputStream stream) throws IOExceptio @Override public int hashCode() { - return Objects.hashCode(this.interfaceVersion, this.kind); + return Objects.hash(this.interfaceVersion, this.kind); } @Override @@ -105,14 +105,13 @@ public boolean equals(Object object) { } SCEnvMetaEntry other = (SCEnvMetaEntry) object; - return Objects.equal(this.interfaceVersion, other.interfaceVersion) - && Objects.equal(this.kind, other.kind); + return Objects.equals(this.interfaceVersion, other.interfaceVersion) + && Objects.equals(this.kind, other.kind); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -124,8 +123,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCEnvMetaEntry fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCEnvMetaKind.java b/src/main/java/org/stellar/sdk/xdr/SCEnvMetaKind.java index 97c82d4d7..20d25b485 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCEnvMetaKind.java +++ b/src/main/java/org/stellar/sdk/xdr/SCEnvMetaKind.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -51,8 +51,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -64,8 +63,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCEnvMetaKind fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCError.java b/src/main/java/org/stellar/sdk/xdr/SCError.java index c41c9f840..b5900b0f8 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCError.java +++ b/src/main/java/org/stellar/sdk/xdr/SCError.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -61,7 +61,7 @@ public static SCError decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.type, this.code); + return Objects.hash(this.type, this.code); } @Override @@ -71,13 +71,12 @@ public boolean equals(Object object) { } SCError other = (SCError) object; - return Objects.equal(this.type, other.type) && Objects.equal(this.code, other.code); + return Objects.equals(this.type, other.type) && Objects.equals(this.code, other.code); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -89,8 +88,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCError fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCErrorCode.java b/src/main/java/org/stellar/sdk/xdr/SCErrorCode.java index 635a68f20..7fe7c9a8f 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCErrorCode.java +++ b/src/main/java/org/stellar/sdk/xdr/SCErrorCode.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -87,8 +87,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -100,8 +99,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCErrorCode fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCErrorType.java b/src/main/java/org/stellar/sdk/xdr/SCErrorType.java index 8637ebee6..83b3fd462 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCErrorType.java +++ b/src/main/java/org/stellar/sdk/xdr/SCErrorType.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -87,8 +87,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -100,8 +99,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCErrorType fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCMap.java b/src/main/java/org/stellar/sdk/xdr/SCMap.java index 18579f452..40c395a5e 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCMap.java +++ b/src/main/java/org/stellar/sdk/xdr/SCMap.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; // === xdr source ============================================================ @@ -72,8 +72,7 @@ public boolean equals(Object object) { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -85,8 +84,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCMap fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCMapEntry.java b/src/main/java/org/stellar/sdk/xdr/SCMapEntry.java index 953813bf6..65c5de935 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCMapEntry.java +++ b/src/main/java/org/stellar/sdk/xdr/SCMapEntry.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -62,7 +62,7 @@ public static SCMapEntry decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.key, this.val); + return Objects.hash(this.key, this.val); } @Override @@ -72,13 +72,12 @@ public boolean equals(Object object) { } SCMapEntry other = (SCMapEntry) object; - return Objects.equal(this.key, other.key) && Objects.equal(this.val, other.val); + return Objects.equals(this.key, other.key) && Objects.equals(this.val, other.val); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -90,8 +89,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCMapEntry fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCMetaEntry.java b/src/main/java/org/stellar/sdk/xdr/SCMetaEntry.java index 66006bccf..bcf2ddcfe 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCMetaEntry.java +++ b/src/main/java/org/stellar/sdk/xdr/SCMetaEntry.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -95,7 +95,7 @@ public static SCMetaEntry decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.v0, this.kind); + return Objects.hash(this.v0, this.kind); } @Override @@ -105,13 +105,12 @@ public boolean equals(Object object) { } SCMetaEntry other = (SCMetaEntry) object; - return Objects.equal(this.v0, other.v0) && Objects.equal(this.kind, other.kind); + return Objects.equals(this.v0, other.v0) && Objects.equals(this.kind, other.kind); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -123,8 +122,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCMetaEntry fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCMetaKind.java b/src/main/java/org/stellar/sdk/xdr/SCMetaKind.java index 519e5c416..b4712e4c3 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCMetaKind.java +++ b/src/main/java/org/stellar/sdk/xdr/SCMetaKind.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -51,8 +51,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -64,8 +63,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCMetaKind fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCMetaV0.java b/src/main/java/org/stellar/sdk/xdr/SCMetaV0.java index 65a032f11..3629a2ec0 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCMetaV0.java +++ b/src/main/java/org/stellar/sdk/xdr/SCMetaV0.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -62,7 +62,7 @@ public static SCMetaV0 decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.key, this.val); + return Objects.hash(this.key, this.val); } @Override @@ -72,13 +72,12 @@ public boolean equals(Object object) { } SCMetaV0 other = (SCMetaV0) object; - return Objects.equal(this.key, other.key) && Objects.equal(this.val, other.val); + return Objects.equals(this.key, other.key) && Objects.equals(this.val, other.val); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -90,8 +89,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCMetaV0 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCNonceKey.java b/src/main/java/org/stellar/sdk/xdr/SCNonceKey.java index 7033ae777..494b0c357 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCNonceKey.java +++ b/src/main/java/org/stellar/sdk/xdr/SCNonceKey.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -48,7 +48,7 @@ public static SCNonceKey decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.nonce); + return Objects.hash(this.nonce); } @Override @@ -58,13 +58,12 @@ public boolean equals(Object object) { } SCNonceKey other = (SCNonceKey) object; - return Objects.equal(this.nonce, other.nonce); + return Objects.equals(this.nonce, other.nonce); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -76,8 +75,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCNonceKey fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCPBallot.java b/src/main/java/org/stellar/sdk/xdr/SCPBallot.java index ecafbfbb8..905329573 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCPBallot.java +++ b/src/main/java/org/stellar/sdk/xdr/SCPBallot.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -62,7 +62,7 @@ public static SCPBallot decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.counter, this.value); + return Objects.hash(this.counter, this.value); } @Override @@ -72,13 +72,12 @@ public boolean equals(Object object) { } SCPBallot other = (SCPBallot) object; - return Objects.equal(this.counter, other.counter) && Objects.equal(this.value, other.value); + return Objects.equals(this.counter, other.counter) && Objects.equals(this.value, other.value); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -90,8 +89,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCPBallot fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCPEnvelope.java b/src/main/java/org/stellar/sdk/xdr/SCPEnvelope.java index ba74c4a19..90edd5797 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCPEnvelope.java +++ b/src/main/java/org/stellar/sdk/xdr/SCPEnvelope.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -62,7 +62,7 @@ public static SCPEnvelope decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.statement, this.signature); + return Objects.hash(this.statement, this.signature); } @Override @@ -72,14 +72,13 @@ public boolean equals(Object object) { } SCPEnvelope other = (SCPEnvelope) object; - return Objects.equal(this.statement, other.statement) - && Objects.equal(this.signature, other.signature); + return Objects.equals(this.statement, other.statement) + && Objects.equals(this.signature, other.signature); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -91,8 +90,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCPEnvelope fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCPHistoryEntry.java b/src/main/java/org/stellar/sdk/xdr/SCPHistoryEntry.java index 8aa74c90b..c59786ec9 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCPHistoryEntry.java +++ b/src/main/java/org/stellar/sdk/xdr/SCPHistoryEntry.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -95,7 +95,7 @@ public static SCPHistoryEntry decode(XdrDataInputStream stream) throws IOExcepti @Override public int hashCode() { - return Objects.hashCode(this.v0, this.v); + return Objects.hash(this.v0, this.v); } @Override @@ -105,13 +105,12 @@ public boolean equals(Object object) { } SCPHistoryEntry other = (SCPHistoryEntry) object; - return Objects.equal(this.v0, other.v0) && Objects.equal(this.v, other.v); + return Objects.equals(this.v0, other.v0) && Objects.equals(this.v, other.v); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -123,8 +122,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCPHistoryEntry fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCPHistoryEntryV0.java b/src/main/java/org/stellar/sdk/xdr/SCPHistoryEntryV0.java index d566c0d16..f260ac8ba 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCPHistoryEntryV0.java +++ b/src/main/java/org/stellar/sdk/xdr/SCPHistoryEntryV0.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -71,7 +71,7 @@ public static SCPHistoryEntryV0 decode(XdrDataInputStream stream) throws IOExcep @Override public int hashCode() { - return Objects.hashCode(Arrays.hashCode(this.quorumSets), this.ledgerMessages); + return Objects.hash(Arrays.hashCode(this.quorumSets), this.ledgerMessages); } @Override @@ -82,13 +82,12 @@ public boolean equals(Object object) { SCPHistoryEntryV0 other = (SCPHistoryEntryV0) object; return Arrays.equals(this.quorumSets, other.quorumSets) - && Objects.equal(this.ledgerMessages, other.ledgerMessages); + && Objects.equals(this.ledgerMessages, other.ledgerMessages); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -100,8 +99,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCPHistoryEntryV0 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCPNomination.java b/src/main/java/org/stellar/sdk/xdr/SCPNomination.java index 83f6acab3..a09a7654a 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCPNomination.java +++ b/src/main/java/org/stellar/sdk/xdr/SCPNomination.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -92,7 +92,7 @@ public static SCPNomination decode(XdrDataInputStream stream) throws IOException @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.quorumSetHash, Arrays.hashCode(this.votes), Arrays.hashCode(this.accepted)); } @@ -103,15 +103,14 @@ public boolean equals(Object object) { } SCPNomination other = (SCPNomination) object; - return Objects.equal(this.quorumSetHash, other.quorumSetHash) + return Objects.equals(this.quorumSetHash, other.quorumSetHash) && Arrays.equals(this.votes, other.votes) && Arrays.equals(this.accepted, other.accepted); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -123,8 +122,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCPNomination fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCPQuorumSet.java b/src/main/java/org/stellar/sdk/xdr/SCPQuorumSet.java index de5e595ad..3868ce6e2 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCPQuorumSet.java +++ b/src/main/java/org/stellar/sdk/xdr/SCPQuorumSet.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -92,7 +92,7 @@ public static SCPQuorumSet decode(XdrDataInputStream stream) throws IOException @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.threshold, Arrays.hashCode(this.validators), Arrays.hashCode(this.innerSets)); } @@ -103,15 +103,14 @@ public boolean equals(Object object) { } SCPQuorumSet other = (SCPQuorumSet) object; - return Objects.equal(this.threshold, other.threshold) + return Objects.equals(this.threshold, other.threshold) && Arrays.equals(this.validators, other.validators) && Arrays.equals(this.innerSets, other.innerSets); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -123,8 +122,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCPQuorumSet fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCPStatement.java b/src/main/java/org/stellar/sdk/xdr/SCPStatement.java index 19afe3ad8..4829a04f1 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCPStatement.java +++ b/src/main/java/org/stellar/sdk/xdr/SCPStatement.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -107,7 +107,7 @@ public static SCPStatement decode(XdrDataInputStream stream) throws IOException @Override public int hashCode() { - return Objects.hashCode(this.nodeID, this.slotIndex, this.pledges); + return Objects.hash(this.nodeID, this.slotIndex, this.pledges); } @Override @@ -117,15 +117,14 @@ public boolean equals(Object object) { } SCPStatement other = (SCPStatement) object; - return Objects.equal(this.nodeID, other.nodeID) - && Objects.equal(this.slotIndex, other.slotIndex) - && Objects.equal(this.pledges, other.pledges); + return Objects.equals(this.nodeID, other.nodeID) + && Objects.equals(this.slotIndex, other.slotIndex) + && Objects.equals(this.pledges, other.pledges); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -137,8 +136,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCPStatement fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -322,8 +320,7 @@ public static SCPStatementPledges decode(XdrDataInputStream stream) throws IOExc @Override public int hashCode() { - return Objects.hashCode( - this.prepare, this.confirm, this.externalize, this.nominate, this.type); + return Objects.hash(this.prepare, this.confirm, this.externalize, this.nominate, this.type); } @Override @@ -333,17 +330,16 @@ public boolean equals(Object object) { } SCPStatementPledges other = (SCPStatementPledges) object; - return Objects.equal(this.prepare, other.prepare) - && Objects.equal(this.confirm, other.confirm) - && Objects.equal(this.externalize, other.externalize) - && Objects.equal(this.nominate, other.nominate) - && Objects.equal(this.type, other.type); + return Objects.equals(this.prepare, other.prepare) + && Objects.equals(this.confirm, other.confirm) + && Objects.equals(this.externalize, other.externalize) + && Objects.equals(this.nominate, other.nominate) + && Objects.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -355,8 +351,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCPStatementPledges fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -473,7 +468,7 @@ public static SCPStatementPrepare decode(XdrDataInputStream stream) throws IOExc @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.quorumSetHash, this.ballot, this.prepared, this.preparedPrime, this.nC, this.nH); } @@ -484,18 +479,17 @@ public boolean equals(Object object) { } SCPStatementPrepare other = (SCPStatementPrepare) object; - return Objects.equal(this.quorumSetHash, other.quorumSetHash) - && Objects.equal(this.ballot, other.ballot) - && Objects.equal(this.prepared, other.prepared) - && Objects.equal(this.preparedPrime, other.preparedPrime) - && Objects.equal(this.nC, other.nC) - && Objects.equal(this.nH, other.nH); + return Objects.equals(this.quorumSetHash, other.quorumSetHash) + && Objects.equals(this.ballot, other.ballot) + && Objects.equals(this.prepared, other.prepared) + && Objects.equals(this.preparedPrime, other.preparedPrime) + && Objects.equals(this.nC, other.nC) + && Objects.equals(this.nH, other.nH); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -507,8 +501,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCPStatementPrepare fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -648,8 +641,7 @@ public static SCPStatementConfirm decode(XdrDataInputStream stream) throws IOExc @Override public int hashCode() { - return Objects.hashCode( - this.ballot, this.nPrepared, this.nCommit, this.nH, this.quorumSetHash); + return Objects.hash(this.ballot, this.nPrepared, this.nCommit, this.nH, this.quorumSetHash); } @Override @@ -659,17 +651,16 @@ public boolean equals(Object object) { } SCPStatementConfirm other = (SCPStatementConfirm) object; - return Objects.equal(this.ballot, other.ballot) - && Objects.equal(this.nPrepared, other.nPrepared) - && Objects.equal(this.nCommit, other.nCommit) - && Objects.equal(this.nH, other.nH) - && Objects.equal(this.quorumSetHash, other.quorumSetHash); + return Objects.equals(this.ballot, other.ballot) + && Objects.equals(this.nPrepared, other.nPrepared) + && Objects.equals(this.nCommit, other.nCommit) + && Objects.equals(this.nH, other.nH) + && Objects.equals(this.quorumSetHash, other.quorumSetHash); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -681,8 +672,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCPStatementConfirm fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -791,7 +781,7 @@ public static SCPStatementExternalize decode(XdrDataInputStream stream) throws I @Override public int hashCode() { - return Objects.hashCode(this.commit, this.nH, this.commitQuorumSetHash); + return Objects.hash(this.commit, this.nH, this.commitQuorumSetHash); } @Override @@ -801,15 +791,14 @@ public boolean equals(Object object) { } SCPStatementExternalize other = (SCPStatementExternalize) object; - return Objects.equal(this.commit, other.commit) - && Objects.equal(this.nH, other.nH) - && Objects.equal(this.commitQuorumSetHash, other.commitQuorumSetHash); + return Objects.equals(this.commit, other.commit) + && Objects.equals(this.nH, other.nH) + && Objects.equals(this.commitQuorumSetHash, other.commitQuorumSetHash); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -821,8 +810,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCPStatementExternalize fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCPStatementType.java b/src/main/java/org/stellar/sdk/xdr/SCPStatementType.java index f5c30b6ba..4afeed5d1 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCPStatementType.java +++ b/src/main/java/org/stellar/sdk/xdr/SCPStatementType.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -63,8 +63,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -76,8 +75,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCPStatementType fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCSpecEntry.java b/src/main/java/org/stellar/sdk/xdr/SCSpecEntry.java index ce6ecb4f7..14cc67e05 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCSpecEntry.java +++ b/src/main/java/org/stellar/sdk/xdr/SCSpecEntry.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -195,7 +195,7 @@ public static SCSpecEntry decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.functionV0, this.udtStructV0, this.udtUnionV0, @@ -211,18 +211,17 @@ public boolean equals(Object object) { } SCSpecEntry other = (SCSpecEntry) object; - return Objects.equal(this.functionV0, other.functionV0) - && Objects.equal(this.udtStructV0, other.udtStructV0) - && Objects.equal(this.udtUnionV0, other.udtUnionV0) - && Objects.equal(this.udtEnumV0, other.udtEnumV0) - && Objects.equal(this.udtErrorEnumV0, other.udtErrorEnumV0) - && Objects.equal(this.kind, other.kind); + return Objects.equals(this.functionV0, other.functionV0) + && Objects.equals(this.udtStructV0, other.udtStructV0) + && Objects.equals(this.udtUnionV0, other.udtUnionV0) + && Objects.equals(this.udtEnumV0, other.udtEnumV0) + && Objects.equals(this.udtErrorEnumV0, other.udtErrorEnumV0) + && Objects.equals(this.kind, other.kind); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -234,8 +233,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCSpecEntry fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCSpecEntryKind.java b/src/main/java/org/stellar/sdk/xdr/SCSpecEntryKind.java index f8dd60ab4..939af0447 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCSpecEntryKind.java +++ b/src/main/java/org/stellar/sdk/xdr/SCSpecEntryKind.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -67,8 +67,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -80,8 +79,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCSpecEntryKind fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCSpecFunctionInputV0.java b/src/main/java/org/stellar/sdk/xdr/SCSpecFunctionInputV0.java index a228df41b..e3b5e378b 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCSpecFunctionInputV0.java +++ b/src/main/java/org/stellar/sdk/xdr/SCSpecFunctionInputV0.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -76,7 +76,7 @@ public static SCSpecFunctionInputV0 decode(XdrDataInputStream stream) throws IOE @Override public int hashCode() { - return Objects.hashCode(this.doc, this.name, this.type); + return Objects.hash(this.doc, this.name, this.type); } @Override @@ -86,15 +86,14 @@ public boolean equals(Object object) { } SCSpecFunctionInputV0 other = (SCSpecFunctionInputV0) object; - return Objects.equal(this.doc, other.doc) - && Objects.equal(this.name, other.name) - && Objects.equal(this.type, other.type); + return Objects.equals(this.doc, other.doc) + && Objects.equals(this.name, other.name) + && Objects.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -106,8 +105,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCSpecFunctionInputV0 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCSpecFunctionV0.java b/src/main/java/org/stellar/sdk/xdr/SCSpecFunctionV0.java index aab785d87..12100314c 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCSpecFunctionV0.java +++ b/src/main/java/org/stellar/sdk/xdr/SCSpecFunctionV0.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -105,7 +105,7 @@ public static SCSpecFunctionV0 decode(XdrDataInputStream stream) throws IOExcept @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.doc, this.name, Arrays.hashCode(this.inputs), Arrays.hashCode(this.outputs)); } @@ -116,16 +116,15 @@ public boolean equals(Object object) { } SCSpecFunctionV0 other = (SCSpecFunctionV0) object; - return Objects.equal(this.doc, other.doc) - && Objects.equal(this.name, other.name) + return Objects.equals(this.doc, other.doc) + && Objects.equals(this.name, other.name) && Arrays.equals(this.inputs, other.inputs) && Arrays.equals(this.outputs, other.outputs); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -137,8 +136,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCSpecFunctionV0 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCSpecType.java b/src/main/java/org/stellar/sdk/xdr/SCSpecType.java index ea4bd7f66..c1bf910b6 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCSpecType.java +++ b/src/main/java/org/stellar/sdk/xdr/SCSpecType.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -157,8 +157,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -170,8 +169,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCSpecType fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCSpecTypeBytesN.java b/src/main/java/org/stellar/sdk/xdr/SCSpecTypeBytesN.java index e375d69e6..55092cd1f 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCSpecTypeBytesN.java +++ b/src/main/java/org/stellar/sdk/xdr/SCSpecTypeBytesN.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -49,7 +49,7 @@ public static SCSpecTypeBytesN decode(XdrDataInputStream stream) throws IOExcept @Override public int hashCode() { - return Objects.hashCode(this.n); + return Objects.hash(this.n); } @Override @@ -59,13 +59,12 @@ public boolean equals(Object object) { } SCSpecTypeBytesN other = (SCSpecTypeBytesN) object; - return Objects.equal(this.n, other.n); + return Objects.equals(this.n, other.n); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -77,8 +76,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCSpecTypeBytesN fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCSpecTypeDef.java b/src/main/java/org/stellar/sdk/xdr/SCSpecTypeDef.java index 8688a209f..055787260 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCSpecTypeDef.java +++ b/src/main/java/org/stellar/sdk/xdr/SCSpecTypeDef.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -327,7 +327,7 @@ public static SCSpecTypeDef decode(XdrDataInputStream stream) throws IOException @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.option, this.result, this.vec, @@ -346,21 +346,20 @@ public boolean equals(Object object) { } SCSpecTypeDef other = (SCSpecTypeDef) object; - return Objects.equal(this.option, other.option) - && Objects.equal(this.result, other.result) - && Objects.equal(this.vec, other.vec) - && Objects.equal(this.map, other.map) - && Objects.equal(this.set, other.set) - && Objects.equal(this.tuple, other.tuple) - && Objects.equal(this.bytesN, other.bytesN) - && Objects.equal(this.udt, other.udt) - && Objects.equal(this.type, other.type); + return Objects.equals(this.option, other.option) + && Objects.equals(this.result, other.result) + && Objects.equals(this.vec, other.vec) + && Objects.equals(this.map, other.map) + && Objects.equals(this.set, other.set) + && Objects.equals(this.tuple, other.tuple) + && Objects.equals(this.bytesN, other.bytesN) + && Objects.equals(this.udt, other.udt) + && Objects.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -372,8 +371,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCSpecTypeDef fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCSpecTypeMap.java b/src/main/java/org/stellar/sdk/xdr/SCSpecTypeMap.java index 951bd127e..1a2547271 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCSpecTypeMap.java +++ b/src/main/java/org/stellar/sdk/xdr/SCSpecTypeMap.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -62,7 +62,7 @@ public static SCSpecTypeMap decode(XdrDataInputStream stream) throws IOException @Override public int hashCode() { - return Objects.hashCode(this.keyType, this.valueType); + return Objects.hash(this.keyType, this.valueType); } @Override @@ -72,14 +72,13 @@ public boolean equals(Object object) { } SCSpecTypeMap other = (SCSpecTypeMap) object; - return Objects.equal(this.keyType, other.keyType) - && Objects.equal(this.valueType, other.valueType); + return Objects.equals(this.keyType, other.keyType) + && Objects.equals(this.valueType, other.valueType); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -91,8 +90,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCSpecTypeMap fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCSpecTypeOption.java b/src/main/java/org/stellar/sdk/xdr/SCSpecTypeOption.java index d1d0cb123..4bc06f4a4 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCSpecTypeOption.java +++ b/src/main/java/org/stellar/sdk/xdr/SCSpecTypeOption.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -49,7 +49,7 @@ public static SCSpecTypeOption decode(XdrDataInputStream stream) throws IOExcept @Override public int hashCode() { - return Objects.hashCode(this.valueType); + return Objects.hash(this.valueType); } @Override @@ -59,13 +59,12 @@ public boolean equals(Object object) { } SCSpecTypeOption other = (SCSpecTypeOption) object; - return Objects.equal(this.valueType, other.valueType); + return Objects.equals(this.valueType, other.valueType); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -77,8 +76,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCSpecTypeOption fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCSpecTypeResult.java b/src/main/java/org/stellar/sdk/xdr/SCSpecTypeResult.java index 6f30f380f..a1f6d84ac 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCSpecTypeResult.java +++ b/src/main/java/org/stellar/sdk/xdr/SCSpecTypeResult.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -62,7 +62,7 @@ public static SCSpecTypeResult decode(XdrDataInputStream stream) throws IOExcept @Override public int hashCode() { - return Objects.hashCode(this.okType, this.errorType); + return Objects.hash(this.okType, this.errorType); } @Override @@ -72,14 +72,13 @@ public boolean equals(Object object) { } SCSpecTypeResult other = (SCSpecTypeResult) object; - return Objects.equal(this.okType, other.okType) - && Objects.equal(this.errorType, other.errorType); + return Objects.equals(this.okType, other.okType) + && Objects.equals(this.errorType, other.errorType); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -91,8 +90,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCSpecTypeResult fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCSpecTypeSet.java b/src/main/java/org/stellar/sdk/xdr/SCSpecTypeSet.java index 067604074..e410cda91 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCSpecTypeSet.java +++ b/src/main/java/org/stellar/sdk/xdr/SCSpecTypeSet.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -49,7 +49,7 @@ public static SCSpecTypeSet decode(XdrDataInputStream stream) throws IOException @Override public int hashCode() { - return Objects.hashCode(this.elementType); + return Objects.hash(this.elementType); } @Override @@ -59,13 +59,12 @@ public boolean equals(Object object) { } SCSpecTypeSet other = (SCSpecTypeSet) object; - return Objects.equal(this.elementType, other.elementType); + return Objects.equals(this.elementType, other.elementType); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -77,8 +76,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCSpecTypeSet fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCSpecTypeTuple.java b/src/main/java/org/stellar/sdk/xdr/SCSpecTypeTuple.java index 553ec02dd..ba25be63e 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCSpecTypeTuple.java +++ b/src/main/java/org/stellar/sdk/xdr/SCSpecTypeTuple.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; // === xdr source ============================================================ @@ -72,8 +72,7 @@ public boolean equals(Object object) { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -85,8 +84,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCSpecTypeTuple fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCSpecTypeUDT.java b/src/main/java/org/stellar/sdk/xdr/SCSpecTypeUDT.java index 83bf40eca..b22748df9 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCSpecTypeUDT.java +++ b/src/main/java/org/stellar/sdk/xdr/SCSpecTypeUDT.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -49,7 +49,7 @@ public static SCSpecTypeUDT decode(XdrDataInputStream stream) throws IOException @Override public int hashCode() { - return Objects.hashCode(this.name); + return Objects.hash(this.name); } @Override @@ -59,13 +59,12 @@ public boolean equals(Object object) { } SCSpecTypeUDT other = (SCSpecTypeUDT) object; - return Objects.equal(this.name, other.name); + return Objects.equals(this.name, other.name); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -77,8 +76,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCSpecTypeUDT fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCSpecTypeVec.java b/src/main/java/org/stellar/sdk/xdr/SCSpecTypeVec.java index 5ec71dd5f..10c3a41b6 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCSpecTypeVec.java +++ b/src/main/java/org/stellar/sdk/xdr/SCSpecTypeVec.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -49,7 +49,7 @@ public static SCSpecTypeVec decode(XdrDataInputStream stream) throws IOException @Override public int hashCode() { - return Objects.hashCode(this.elementType); + return Objects.hash(this.elementType); } @Override @@ -59,13 +59,12 @@ public boolean equals(Object object) { } SCSpecTypeVec other = (SCSpecTypeVec) object; - return Objects.equal(this.elementType, other.elementType); + return Objects.equals(this.elementType, other.elementType); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -77,8 +76,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCSpecTypeVec fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCSpecUDTEnumCaseV0.java b/src/main/java/org/stellar/sdk/xdr/SCSpecUDTEnumCaseV0.java index a43a8c8cb..c26d9d35a 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCSpecUDTEnumCaseV0.java +++ b/src/main/java/org/stellar/sdk/xdr/SCSpecUDTEnumCaseV0.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -76,7 +76,7 @@ public static SCSpecUDTEnumCaseV0 decode(XdrDataInputStream stream) throws IOExc @Override public int hashCode() { - return Objects.hashCode(this.doc, this.name, this.value); + return Objects.hash(this.doc, this.name, this.value); } @Override @@ -86,15 +86,14 @@ public boolean equals(Object object) { } SCSpecUDTEnumCaseV0 other = (SCSpecUDTEnumCaseV0) object; - return Objects.equal(this.doc, other.doc) - && Objects.equal(this.name, other.name) - && Objects.equal(this.value, other.value); + return Objects.equals(this.doc, other.doc) + && Objects.equals(this.name, other.name) + && Objects.equals(this.value, other.value); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -106,8 +105,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCSpecUDTEnumCaseV0 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCSpecUDTEnumV0.java b/src/main/java/org/stellar/sdk/xdr/SCSpecUDTEnumV0.java index 11fa51cc4..3397a0b72 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCSpecUDTEnumV0.java +++ b/src/main/java/org/stellar/sdk/xdr/SCSpecUDTEnumV0.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -97,7 +97,7 @@ public static SCSpecUDTEnumV0 decode(XdrDataInputStream stream) throws IOExcepti @Override public int hashCode() { - return Objects.hashCode(this.doc, this.lib, this.name, Arrays.hashCode(this.cases)); + return Objects.hash(this.doc, this.lib, this.name, Arrays.hashCode(this.cases)); } @Override @@ -107,16 +107,15 @@ public boolean equals(Object object) { } SCSpecUDTEnumV0 other = (SCSpecUDTEnumV0) object; - return Objects.equal(this.doc, other.doc) - && Objects.equal(this.lib, other.lib) - && Objects.equal(this.name, other.name) + return Objects.equals(this.doc, other.doc) + && Objects.equals(this.lib, other.lib) + && Objects.equals(this.name, other.name) && Arrays.equals(this.cases, other.cases); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -128,8 +127,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCSpecUDTEnumV0 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCSpecUDTErrorEnumCaseV0.java b/src/main/java/org/stellar/sdk/xdr/SCSpecUDTErrorEnumCaseV0.java index dcb4f669b..1148aa476 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCSpecUDTErrorEnumCaseV0.java +++ b/src/main/java/org/stellar/sdk/xdr/SCSpecUDTErrorEnumCaseV0.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -76,7 +76,7 @@ public static SCSpecUDTErrorEnumCaseV0 decode(XdrDataInputStream stream) throws @Override public int hashCode() { - return Objects.hashCode(this.doc, this.name, this.value); + return Objects.hash(this.doc, this.name, this.value); } @Override @@ -86,15 +86,14 @@ public boolean equals(Object object) { } SCSpecUDTErrorEnumCaseV0 other = (SCSpecUDTErrorEnumCaseV0) object; - return Objects.equal(this.doc, other.doc) - && Objects.equal(this.name, other.name) - && Objects.equal(this.value, other.value); + return Objects.equals(this.doc, other.doc) + && Objects.equals(this.name, other.name) + && Objects.equals(this.value, other.value); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -106,8 +105,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCSpecUDTErrorEnumCaseV0 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCSpecUDTErrorEnumV0.java b/src/main/java/org/stellar/sdk/xdr/SCSpecUDTErrorEnumV0.java index aa15970bd..9e55c65fb 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCSpecUDTErrorEnumV0.java +++ b/src/main/java/org/stellar/sdk/xdr/SCSpecUDTErrorEnumV0.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -98,7 +98,7 @@ public static SCSpecUDTErrorEnumV0 decode(XdrDataInputStream stream) throws IOEx @Override public int hashCode() { - return Objects.hashCode(this.doc, this.lib, this.name, Arrays.hashCode(this.cases)); + return Objects.hash(this.doc, this.lib, this.name, Arrays.hashCode(this.cases)); } @Override @@ -108,16 +108,15 @@ public boolean equals(Object object) { } SCSpecUDTErrorEnumV0 other = (SCSpecUDTErrorEnumV0) object; - return Objects.equal(this.doc, other.doc) - && Objects.equal(this.lib, other.lib) - && Objects.equal(this.name, other.name) + return Objects.equals(this.doc, other.doc) + && Objects.equals(this.lib, other.lib) + && Objects.equals(this.name, other.name) && Arrays.equals(this.cases, other.cases); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -129,8 +128,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCSpecUDTErrorEnumV0 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCSpecUDTStructFieldV0.java b/src/main/java/org/stellar/sdk/xdr/SCSpecUDTStructFieldV0.java index 015a73b4c..ccd0d1bae 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCSpecUDTStructFieldV0.java +++ b/src/main/java/org/stellar/sdk/xdr/SCSpecUDTStructFieldV0.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -76,7 +76,7 @@ public static SCSpecUDTStructFieldV0 decode(XdrDataInputStream stream) throws IO @Override public int hashCode() { - return Objects.hashCode(this.doc, this.name, this.type); + return Objects.hash(this.doc, this.name, this.type); } @Override @@ -86,15 +86,14 @@ public boolean equals(Object object) { } SCSpecUDTStructFieldV0 other = (SCSpecUDTStructFieldV0) object; - return Objects.equal(this.doc, other.doc) - && Objects.equal(this.name, other.name) - && Objects.equal(this.type, other.type); + return Objects.equals(this.doc, other.doc) + && Objects.equals(this.name, other.name) + && Objects.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -106,8 +105,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCSpecUDTStructFieldV0 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCSpecUDTStructV0.java b/src/main/java/org/stellar/sdk/xdr/SCSpecUDTStructV0.java index ba72eb34f..2fc3a43f3 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCSpecUDTStructV0.java +++ b/src/main/java/org/stellar/sdk/xdr/SCSpecUDTStructV0.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -97,7 +97,7 @@ public static SCSpecUDTStructV0 decode(XdrDataInputStream stream) throws IOExcep @Override public int hashCode() { - return Objects.hashCode(this.doc, this.lib, this.name, Arrays.hashCode(this.fields)); + return Objects.hash(this.doc, this.lib, this.name, Arrays.hashCode(this.fields)); } @Override @@ -107,16 +107,15 @@ public boolean equals(Object object) { } SCSpecUDTStructV0 other = (SCSpecUDTStructV0) object; - return Objects.equal(this.doc, other.doc) - && Objects.equal(this.lib, other.lib) - && Objects.equal(this.name, other.name) + return Objects.equals(this.doc, other.doc) + && Objects.equals(this.lib, other.lib) + && Objects.equals(this.name, other.name) && Arrays.equals(this.fields, other.fields); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -128,8 +127,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCSpecUDTStructV0 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCSpecUDTUnionCaseTupleV0.java b/src/main/java/org/stellar/sdk/xdr/SCSpecUDTUnionCaseTupleV0.java index 8f66aea79..60c0a065a 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCSpecUDTUnionCaseTupleV0.java +++ b/src/main/java/org/stellar/sdk/xdr/SCSpecUDTUnionCaseTupleV0.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -85,7 +85,7 @@ public static SCSpecUDTUnionCaseTupleV0 decode(XdrDataInputStream stream) throws @Override public int hashCode() { - return Objects.hashCode(this.doc, this.name, Arrays.hashCode(this.type)); + return Objects.hash(this.doc, this.name, Arrays.hashCode(this.type)); } @Override @@ -95,15 +95,14 @@ public boolean equals(Object object) { } SCSpecUDTUnionCaseTupleV0 other = (SCSpecUDTUnionCaseTupleV0) object; - return Objects.equal(this.doc, other.doc) - && Objects.equal(this.name, other.name) + return Objects.equals(this.doc, other.doc) + && Objects.equals(this.name, other.name) && Arrays.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -115,8 +114,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCSpecUDTUnionCaseTupleV0 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCSpecUDTUnionCaseV0.java b/src/main/java/org/stellar/sdk/xdr/SCSpecUDTUnionCaseV0.java index 14eb90fc9..dde5eac73 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCSpecUDTUnionCaseV0.java +++ b/src/main/java/org/stellar/sdk/xdr/SCSpecUDTUnionCaseV0.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -121,7 +121,7 @@ public static SCSpecUDTUnionCaseV0 decode(XdrDataInputStream stream) throws IOEx @Override public int hashCode() { - return Objects.hashCode(this.voidCase, this.tupleCase, this.kind); + return Objects.hash(this.voidCase, this.tupleCase, this.kind); } @Override @@ -131,15 +131,14 @@ public boolean equals(Object object) { } SCSpecUDTUnionCaseV0 other = (SCSpecUDTUnionCaseV0) object; - return Objects.equal(this.voidCase, other.voidCase) - && Objects.equal(this.tupleCase, other.tupleCase) - && Objects.equal(this.kind, other.kind); + return Objects.equals(this.voidCase, other.voidCase) + && Objects.equals(this.tupleCase, other.tupleCase) + && Objects.equals(this.kind, other.kind); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -151,8 +150,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCSpecUDTUnionCaseV0 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCSpecUDTUnionCaseV0Kind.java b/src/main/java/org/stellar/sdk/xdr/SCSpecUDTUnionCaseV0Kind.java index 378dd6293..a3f701587 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCSpecUDTUnionCaseV0Kind.java +++ b/src/main/java/org/stellar/sdk/xdr/SCSpecUDTUnionCaseV0Kind.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -56,8 +56,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -69,8 +68,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCSpecUDTUnionCaseV0Kind fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCSpecUDTUnionCaseVoidV0.java b/src/main/java/org/stellar/sdk/xdr/SCSpecUDTUnionCaseVoidV0.java index 0e4387425..21f3e12cf 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCSpecUDTUnionCaseVoidV0.java +++ b/src/main/java/org/stellar/sdk/xdr/SCSpecUDTUnionCaseVoidV0.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -63,7 +63,7 @@ public static SCSpecUDTUnionCaseVoidV0 decode(XdrDataInputStream stream) throws @Override public int hashCode() { - return Objects.hashCode(this.doc, this.name); + return Objects.hash(this.doc, this.name); } @Override @@ -73,13 +73,12 @@ public boolean equals(Object object) { } SCSpecUDTUnionCaseVoidV0 other = (SCSpecUDTUnionCaseVoidV0) object; - return Objects.equal(this.doc, other.doc) && Objects.equal(this.name, other.name); + return Objects.equals(this.doc, other.doc) && Objects.equals(this.name, other.name); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -91,8 +90,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCSpecUDTUnionCaseVoidV0 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCSpecUDTUnionV0.java b/src/main/java/org/stellar/sdk/xdr/SCSpecUDTUnionV0.java index 2f6f311f4..6ef52f7bd 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCSpecUDTUnionV0.java +++ b/src/main/java/org/stellar/sdk/xdr/SCSpecUDTUnionV0.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -97,7 +97,7 @@ public static SCSpecUDTUnionV0 decode(XdrDataInputStream stream) throws IOExcept @Override public int hashCode() { - return Objects.hashCode(this.doc, this.lib, this.name, Arrays.hashCode(this.cases)); + return Objects.hash(this.doc, this.lib, this.name, Arrays.hashCode(this.cases)); } @Override @@ -107,16 +107,15 @@ public boolean equals(Object object) { } SCSpecUDTUnionV0 other = (SCSpecUDTUnionV0) object; - return Objects.equal(this.doc, other.doc) - && Objects.equal(this.lib, other.lib) - && Objects.equal(this.name, other.name) + return Objects.equals(this.doc, other.doc) + && Objects.equals(this.lib, other.lib) + && Objects.equals(this.name, other.name) && Arrays.equals(this.cases, other.cases); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -128,8 +127,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCSpecUDTUnionV0 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCString.java b/src/main/java/org/stellar/sdk/xdr/SCString.java index ed1a0f5e0..5e3690af7 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCString.java +++ b/src/main/java/org/stellar/sdk/xdr/SCString.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -50,7 +50,7 @@ public static SCString decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.SCString); + return Objects.hash(this.SCString); } @Override @@ -60,13 +60,12 @@ public boolean equals(Object object) { } SCString other = (SCString) object; - return Objects.equal(this.SCString, other.SCString); + return Objects.equals(this.SCString, other.SCString); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -78,8 +77,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCString fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCSymbol.java b/src/main/java/org/stellar/sdk/xdr/SCSymbol.java index 4ffd515fa..63d2867d3 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCSymbol.java +++ b/src/main/java/org/stellar/sdk/xdr/SCSymbol.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -50,7 +50,7 @@ public static SCSymbol decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.SCSymbol); + return Objects.hash(this.SCSymbol); } @Override @@ -60,13 +60,12 @@ public boolean equals(Object object) { } SCSymbol other = (SCSymbol) object; - return Objects.equal(this.SCSymbol, other.SCSymbol); + return Objects.equals(this.SCSymbol, other.SCSymbol); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -78,8 +77,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCSymbol fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCVal.java b/src/main/java/org/stellar/sdk/xdr/SCVal.java index 94838a0d6..18ac123c4 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCVal.java +++ b/src/main/java/org/stellar/sdk/xdr/SCVal.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -611,7 +611,7 @@ public static SCVal decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.b, this.error, this.u32, @@ -642,33 +642,32 @@ public boolean equals(Object object) { } SCVal other = (SCVal) object; - return Objects.equal(this.b, other.b) - && Objects.equal(this.error, other.error) - && Objects.equal(this.u32, other.u32) - && Objects.equal(this.i32, other.i32) - && Objects.equal(this.u64, other.u64) - && Objects.equal(this.i64, other.i64) - && Objects.equal(this.timepoint, other.timepoint) - && Objects.equal(this.duration, other.duration) - && Objects.equal(this.u128, other.u128) - && Objects.equal(this.i128, other.i128) - && Objects.equal(this.u256, other.u256) - && Objects.equal(this.i256, other.i256) - && Objects.equal(this.bytes, other.bytes) - && Objects.equal(this.str, other.str) - && Objects.equal(this.sym, other.sym) - && Objects.equal(this.vec, other.vec) - && Objects.equal(this.map, other.map) - && Objects.equal(this.address, other.address) - && Objects.equal(this.nonce_key, other.nonce_key) - && Objects.equal(this.instance, other.instance) - && Objects.equal(this.type, other.type); + return Objects.equals(this.b, other.b) + && Objects.equals(this.error, other.error) + && Objects.equals(this.u32, other.u32) + && Objects.equals(this.i32, other.i32) + && Objects.equals(this.u64, other.u64) + && Objects.equals(this.i64, other.i64) + && Objects.equals(this.timepoint, other.timepoint) + && Objects.equals(this.duration, other.duration) + && Objects.equals(this.u128, other.u128) + && Objects.equals(this.i128, other.i128) + && Objects.equals(this.u256, other.u256) + && Objects.equals(this.i256, other.i256) + && Objects.equals(this.bytes, other.bytes) + && Objects.equals(this.str, other.str) + && Objects.equals(this.sym, other.sym) + && Objects.equals(this.vec, other.vec) + && Objects.equals(this.map, other.map) + && Objects.equals(this.address, other.address) + && Objects.equals(this.nonce_key, other.nonce_key) + && Objects.equals(this.instance, other.instance) + && Objects.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -680,8 +679,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCVal fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCValType.java b/src/main/java/org/stellar/sdk/xdr/SCValType.java index 5a37a337d..6cbcd9697 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCValType.java +++ b/src/main/java/org/stellar/sdk/xdr/SCValType.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -165,8 +165,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -178,8 +177,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCValType fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SCVec.java b/src/main/java/org/stellar/sdk/xdr/SCVec.java index 9a1ba2fd5..3de069d23 100644 --- a/src/main/java/org/stellar/sdk/xdr/SCVec.java +++ b/src/main/java/org/stellar/sdk/xdr/SCVec.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; // === xdr source ============================================================ @@ -72,8 +72,7 @@ public boolean equals(Object object) { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -85,8 +84,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SCVec fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SendMore.java b/src/main/java/org/stellar/sdk/xdr/SendMore.java index eae1eb499..a9c02b09d 100644 --- a/src/main/java/org/stellar/sdk/xdr/SendMore.java +++ b/src/main/java/org/stellar/sdk/xdr/SendMore.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -49,7 +49,7 @@ public static SendMore decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.numMessages); + return Objects.hash(this.numMessages); } @Override @@ -59,13 +59,12 @@ public boolean equals(Object object) { } SendMore other = (SendMore) object; - return Objects.equal(this.numMessages, other.numMessages); + return Objects.equals(this.numMessages, other.numMessages); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -77,8 +76,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SendMore fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SendMoreExtended.java b/src/main/java/org/stellar/sdk/xdr/SendMoreExtended.java index 2336ed9ff..95a345899 100644 --- a/src/main/java/org/stellar/sdk/xdr/SendMoreExtended.java +++ b/src/main/java/org/stellar/sdk/xdr/SendMoreExtended.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -62,7 +62,7 @@ public static SendMoreExtended decode(XdrDataInputStream stream) throws IOExcept @Override public int hashCode() { - return Objects.hashCode(this.numMessages, this.numBytes); + return Objects.hash(this.numMessages, this.numBytes); } @Override @@ -72,14 +72,13 @@ public boolean equals(Object object) { } SendMoreExtended other = (SendMoreExtended) object; - return Objects.equal(this.numMessages, other.numMessages) - && Objects.equal(this.numBytes, other.numBytes); + return Objects.equals(this.numMessages, other.numMessages) + && Objects.equals(this.numBytes, other.numBytes); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -91,8 +90,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SendMoreExtended fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SequenceNumber.java b/src/main/java/org/stellar/sdk/xdr/SequenceNumber.java index 8254459d9..e7c6e02f6 100644 --- a/src/main/java/org/stellar/sdk/xdr/SequenceNumber.java +++ b/src/main/java/org/stellar/sdk/xdr/SequenceNumber.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -50,7 +50,7 @@ public static SequenceNumber decode(XdrDataInputStream stream) throws IOExceptio @Override public int hashCode() { - return Objects.hashCode(this.SequenceNumber); + return Objects.hash(this.SequenceNumber); } @Override @@ -60,13 +60,12 @@ public boolean equals(Object object) { } SequenceNumber other = (SequenceNumber) object; - return Objects.equal(this.SequenceNumber, other.SequenceNumber); + return Objects.equals(this.SequenceNumber, other.SequenceNumber); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -78,8 +77,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SequenceNumber fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SetOptionsOp.java b/src/main/java/org/stellar/sdk/xdr/SetOptionsOp.java index d5270c794..c34720e5e 100644 --- a/src/main/java/org/stellar/sdk/xdr/SetOptionsOp.java +++ b/src/main/java/org/stellar/sdk/xdr/SetOptionsOp.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -232,7 +232,7 @@ public static SetOptionsOp decode(XdrDataInputStream stream) throws IOException @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.inflationDest, this.clearFlags, this.setFlags, @@ -251,21 +251,20 @@ public boolean equals(Object object) { } SetOptionsOp other = (SetOptionsOp) object; - return Objects.equal(this.inflationDest, other.inflationDest) - && Objects.equal(this.clearFlags, other.clearFlags) - && Objects.equal(this.setFlags, other.setFlags) - && Objects.equal(this.masterWeight, other.masterWeight) - && Objects.equal(this.lowThreshold, other.lowThreshold) - && Objects.equal(this.medThreshold, other.medThreshold) - && Objects.equal(this.highThreshold, other.highThreshold) - && Objects.equal(this.homeDomain, other.homeDomain) - && Objects.equal(this.signer, other.signer); + return Objects.equals(this.inflationDest, other.inflationDest) + && Objects.equals(this.clearFlags, other.clearFlags) + && Objects.equals(this.setFlags, other.setFlags) + && Objects.equals(this.masterWeight, other.masterWeight) + && Objects.equals(this.lowThreshold, other.lowThreshold) + && Objects.equals(this.medThreshold, other.medThreshold) + && Objects.equals(this.highThreshold, other.highThreshold) + && Objects.equals(this.homeDomain, other.homeDomain) + && Objects.equals(this.signer, other.signer); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -277,8 +276,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SetOptionsOp fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SetOptionsResult.java b/src/main/java/org/stellar/sdk/xdr/SetOptionsResult.java index ca3b917a5..068a83427 100644 --- a/src/main/java/org/stellar/sdk/xdr/SetOptionsResult.java +++ b/src/main/java/org/stellar/sdk/xdr/SetOptionsResult.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -109,7 +109,7 @@ public static SetOptionsResult decode(XdrDataInputStream stream) throws IOExcept @Override public int hashCode() { - return Objects.hashCode(this.code); + return Objects.hash(this.code); } @Override @@ -119,13 +119,12 @@ public boolean equals(Object object) { } SetOptionsResult other = (SetOptionsResult) object; - return Objects.equal(this.code, other.code); + return Objects.equals(this.code, other.code); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -137,8 +136,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SetOptionsResult fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SetOptionsResultCode.java b/src/main/java/org/stellar/sdk/xdr/SetOptionsResultCode.java index 4d7eb1c5b..be73b41b9 100644 --- a/src/main/java/org/stellar/sdk/xdr/SetOptionsResultCode.java +++ b/src/main/java/org/stellar/sdk/xdr/SetOptionsResultCode.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -95,8 +95,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -108,8 +107,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SetOptionsResultCode fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SetTrustLineFlagsOp.java b/src/main/java/org/stellar/sdk/xdr/SetTrustLineFlagsOp.java index 3b7723965..6766e4fcd 100644 --- a/src/main/java/org/stellar/sdk/xdr/SetTrustLineFlagsOp.java +++ b/src/main/java/org/stellar/sdk/xdr/SetTrustLineFlagsOp.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -90,7 +90,7 @@ public static SetTrustLineFlagsOp decode(XdrDataInputStream stream) throws IOExc @Override public int hashCode() { - return Objects.hashCode(this.trustor, this.asset, this.clearFlags, this.setFlags); + return Objects.hash(this.trustor, this.asset, this.clearFlags, this.setFlags); } @Override @@ -100,16 +100,15 @@ public boolean equals(Object object) { } SetTrustLineFlagsOp other = (SetTrustLineFlagsOp) object; - return Objects.equal(this.trustor, other.trustor) - && Objects.equal(this.asset, other.asset) - && Objects.equal(this.clearFlags, other.clearFlags) - && Objects.equal(this.setFlags, other.setFlags); + return Objects.equals(this.trustor, other.trustor) + && Objects.equals(this.asset, other.asset) + && Objects.equals(this.clearFlags, other.clearFlags) + && Objects.equals(this.setFlags, other.setFlags); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -121,8 +120,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SetTrustLineFlagsOp fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SetTrustLineFlagsResult.java b/src/main/java/org/stellar/sdk/xdr/SetTrustLineFlagsResult.java index 87b30607d..4ded3bedc 100644 --- a/src/main/java/org/stellar/sdk/xdr/SetTrustLineFlagsResult.java +++ b/src/main/java/org/stellar/sdk/xdr/SetTrustLineFlagsResult.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -95,7 +95,7 @@ public static SetTrustLineFlagsResult decode(XdrDataInputStream stream) throws I @Override public int hashCode() { - return Objects.hashCode(this.code); + return Objects.hash(this.code); } @Override @@ -105,13 +105,12 @@ public boolean equals(Object object) { } SetTrustLineFlagsResult other = (SetTrustLineFlagsResult) object; - return Objects.equal(this.code, other.code); + return Objects.equals(this.code, other.code); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -123,8 +122,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SetTrustLineFlagsResult fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SetTrustLineFlagsResultCode.java b/src/main/java/org/stellar/sdk/xdr/SetTrustLineFlagsResultCode.java index 68a9e5466..7deb5e653 100644 --- a/src/main/java/org/stellar/sdk/xdr/SetTrustLineFlagsResultCode.java +++ b/src/main/java/org/stellar/sdk/xdr/SetTrustLineFlagsResultCode.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -76,8 +76,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -89,8 +88,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SetTrustLineFlagsResultCode fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/Signature.java b/src/main/java/org/stellar/sdk/xdr/Signature.java index ece133856..42103a825 100644 --- a/src/main/java/org/stellar/sdk/xdr/Signature.java +++ b/src/main/java/org/stellar/sdk/xdr/Signature.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; // === xdr source ============================================================ @@ -69,8 +69,7 @@ public boolean equals(Object object) { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -82,8 +81,7 @@ public byte[] toXdrByteArray() throws IOException { } public static Signature fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SignatureHint.java b/src/main/java/org/stellar/sdk/xdr/SignatureHint.java index f4b48399a..28e138563 100644 --- a/src/main/java/org/stellar/sdk/xdr/SignatureHint.java +++ b/src/main/java/org/stellar/sdk/xdr/SignatureHint.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; // === xdr source ============================================================ @@ -68,8 +68,7 @@ public boolean equals(Object object) { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -81,8 +80,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SignatureHint fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SignedSurveyRequestMessage.java b/src/main/java/org/stellar/sdk/xdr/SignedSurveyRequestMessage.java index 0a44490ae..ba6c35ec5 100644 --- a/src/main/java/org/stellar/sdk/xdr/SignedSurveyRequestMessage.java +++ b/src/main/java/org/stellar/sdk/xdr/SignedSurveyRequestMessage.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -63,7 +63,7 @@ public static SignedSurveyRequestMessage decode(XdrDataInputStream stream) throw @Override public int hashCode() { - return Objects.hashCode(this.requestSignature, this.request); + return Objects.hash(this.requestSignature, this.request); } @Override @@ -73,14 +73,13 @@ public boolean equals(Object object) { } SignedSurveyRequestMessage other = (SignedSurveyRequestMessage) object; - return Objects.equal(this.requestSignature, other.requestSignature) - && Objects.equal(this.request, other.request); + return Objects.equals(this.requestSignature, other.requestSignature) + && Objects.equals(this.request, other.request); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -92,8 +91,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SignedSurveyRequestMessage fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SignedSurveyResponseMessage.java b/src/main/java/org/stellar/sdk/xdr/SignedSurveyResponseMessage.java index 44f44e13b..85c1083ea 100644 --- a/src/main/java/org/stellar/sdk/xdr/SignedSurveyResponseMessage.java +++ b/src/main/java/org/stellar/sdk/xdr/SignedSurveyResponseMessage.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -64,7 +64,7 @@ public static SignedSurveyResponseMessage decode(XdrDataInputStream stream) thro @Override public int hashCode() { - return Objects.hashCode(this.responseSignature, this.response); + return Objects.hash(this.responseSignature, this.response); } @Override @@ -74,14 +74,13 @@ public boolean equals(Object object) { } SignedSurveyResponseMessage other = (SignedSurveyResponseMessage) object; - return Objects.equal(this.responseSignature, other.responseSignature) - && Objects.equal(this.response, other.response); + return Objects.equals(this.responseSignature, other.responseSignature) + && Objects.equals(this.response, other.response); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -93,8 +92,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SignedSurveyResponseMessage fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/Signer.java b/src/main/java/org/stellar/sdk/xdr/Signer.java index 484e661b7..1d8918247 100644 --- a/src/main/java/org/stellar/sdk/xdr/Signer.java +++ b/src/main/java/org/stellar/sdk/xdr/Signer.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -61,7 +61,7 @@ public static Signer decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.key, this.weight); + return Objects.hash(this.key, this.weight); } @Override @@ -71,13 +71,12 @@ public boolean equals(Object object) { } Signer other = (Signer) object; - return Objects.equal(this.key, other.key) && Objects.equal(this.weight, other.weight); + return Objects.equals(this.key, other.key) && Objects.equals(this.weight, other.weight); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -89,8 +88,7 @@ public byte[] toXdrByteArray() throws IOException { } public static Signer fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SignerKey.java b/src/main/java/org/stellar/sdk/xdr/SignerKey.java index d91d722e6..9a73e3a8d 100644 --- a/src/main/java/org/stellar/sdk/xdr/SignerKey.java +++ b/src/main/java/org/stellar/sdk/xdr/SignerKey.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -179,7 +179,7 @@ public static SignerKey decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.ed25519, this.preAuthTx, this.hashX, this.ed25519SignedPayload, this.type); } @@ -190,17 +190,16 @@ public boolean equals(Object object) { } SignerKey other = (SignerKey) object; - return Objects.equal(this.ed25519, other.ed25519) - && Objects.equal(this.preAuthTx, other.preAuthTx) - && Objects.equal(this.hashX, other.hashX) - && Objects.equal(this.ed25519SignedPayload, other.ed25519SignedPayload) - && Objects.equal(this.type, other.type); + return Objects.equals(this.ed25519, other.ed25519) + && Objects.equals(this.preAuthTx, other.preAuthTx) + && Objects.equals(this.hashX, other.hashX) + && Objects.equals(this.ed25519SignedPayload, other.ed25519SignedPayload) + && Objects.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -212,8 +211,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SignerKey fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -273,7 +271,7 @@ public static SignerKeyEd25519SignedPayload decode(XdrDataInputStream stream) @Override public int hashCode() { - return Objects.hashCode(this.ed25519, Arrays.hashCode(this.payload)); + return Objects.hash(this.ed25519, Arrays.hashCode(this.payload)); } @Override @@ -283,14 +281,13 @@ public boolean equals(Object object) { } SignerKeyEd25519SignedPayload other = (SignerKeyEd25519SignedPayload) object; - return Objects.equal(this.ed25519, other.ed25519) + return Objects.equals(this.ed25519, other.ed25519) && Arrays.equals(this.payload, other.payload); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -302,8 +299,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SignerKeyEd25519SignedPayload fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SignerKeyType.java b/src/main/java/org/stellar/sdk/xdr/SignerKeyType.java index 85e62c944..90453dcf0 100644 --- a/src/main/java/org/stellar/sdk/xdr/SignerKeyType.java +++ b/src/main/java/org/stellar/sdk/xdr/SignerKeyType.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -63,8 +63,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -76,8 +75,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SignerKeyType fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SimplePaymentResult.java b/src/main/java/org/stellar/sdk/xdr/SimplePaymentResult.java index ff690be75..43825f1e7 100644 --- a/src/main/java/org/stellar/sdk/xdr/SimplePaymentResult.java +++ b/src/main/java/org/stellar/sdk/xdr/SimplePaymentResult.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -76,7 +76,7 @@ public static SimplePaymentResult decode(XdrDataInputStream stream) throws IOExc @Override public int hashCode() { - return Objects.hashCode(this.destination, this.asset, this.amount); + return Objects.hash(this.destination, this.asset, this.amount); } @Override @@ -86,15 +86,14 @@ public boolean equals(Object object) { } SimplePaymentResult other = (SimplePaymentResult) object; - return Objects.equal(this.destination, other.destination) - && Objects.equal(this.asset, other.asset) - && Objects.equal(this.amount, other.amount); + return Objects.equals(this.destination, other.destination) + && Objects.equals(this.asset, other.asset) + && Objects.equals(this.amount, other.amount); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -106,8 +105,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SimplePaymentResult fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SorobanAddressCredentials.java b/src/main/java/org/stellar/sdk/xdr/SorobanAddressCredentials.java index 4ee671117..e504ebf0d 100644 --- a/src/main/java/org/stellar/sdk/xdr/SorobanAddressCredentials.java +++ b/src/main/java/org/stellar/sdk/xdr/SorobanAddressCredentials.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -89,7 +89,7 @@ public static SorobanAddressCredentials decode(XdrDataInputStream stream) throws @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.address, this.nonce, this.signatureExpirationLedger, this.signatureArgs); } @@ -100,16 +100,15 @@ public boolean equals(Object object) { } SorobanAddressCredentials other = (SorobanAddressCredentials) object; - return Objects.equal(this.address, other.address) - && Objects.equal(this.nonce, other.nonce) - && Objects.equal(this.signatureExpirationLedger, other.signatureExpirationLedger) - && Objects.equal(this.signatureArgs, other.signatureArgs); + return Objects.equals(this.address, other.address) + && Objects.equals(this.nonce, other.nonce) + && Objects.equals(this.signatureExpirationLedger, other.signatureExpirationLedger) + && Objects.equals(this.signatureArgs, other.signatureArgs); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -121,8 +120,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SorobanAddressCredentials fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SorobanAuthorizationEntry.java b/src/main/java/org/stellar/sdk/xdr/SorobanAuthorizationEntry.java index 14458a411..49476b3f7 100644 --- a/src/main/java/org/stellar/sdk/xdr/SorobanAuthorizationEntry.java +++ b/src/main/java/org/stellar/sdk/xdr/SorobanAuthorizationEntry.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -63,7 +63,7 @@ public static SorobanAuthorizationEntry decode(XdrDataInputStream stream) throws @Override public int hashCode() { - return Objects.hashCode(this.credentials, this.rootInvocation); + return Objects.hash(this.credentials, this.rootInvocation); } @Override @@ -73,14 +73,13 @@ public boolean equals(Object object) { } SorobanAuthorizationEntry other = (SorobanAuthorizationEntry) object; - return Objects.equal(this.credentials, other.credentials) - && Objects.equal(this.rootInvocation, other.rootInvocation); + return Objects.equals(this.credentials, other.credentials) + && Objects.equals(this.rootInvocation, other.rootInvocation); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -92,8 +91,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SorobanAuthorizationEntry fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SorobanAuthorizedContractFunction.java b/src/main/java/org/stellar/sdk/xdr/SorobanAuthorizedContractFunction.java index 5b2c29bb5..f9d78cfe8 100644 --- a/src/main/java/org/stellar/sdk/xdr/SorobanAuthorizedContractFunction.java +++ b/src/main/java/org/stellar/sdk/xdr/SorobanAuthorizedContractFunction.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -79,7 +79,7 @@ public static SorobanAuthorizedContractFunction decode(XdrDataInputStream stream @Override public int hashCode() { - return Objects.hashCode(this.contractAddress, this.functionName, this.args); + return Objects.hash(this.contractAddress, this.functionName, this.args); } @Override @@ -89,15 +89,14 @@ public boolean equals(Object object) { } SorobanAuthorizedContractFunction other = (SorobanAuthorizedContractFunction) object; - return Objects.equal(this.contractAddress, other.contractAddress) - && Objects.equal(this.functionName, other.functionName) - && Objects.equal(this.args, other.args); + return Objects.equals(this.contractAddress, other.contractAddress) + && Objects.equals(this.functionName, other.functionName) + && Objects.equals(this.args, other.args); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -109,8 +108,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SorobanAuthorizedContractFunction fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SorobanAuthorizedFunction.java b/src/main/java/org/stellar/sdk/xdr/SorobanAuthorizedFunction.java index b988e570d..b87c3cb9a 100644 --- a/src/main/java/org/stellar/sdk/xdr/SorobanAuthorizedFunction.java +++ b/src/main/java/org/stellar/sdk/xdr/SorobanAuthorizedFunction.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -123,7 +123,7 @@ public static SorobanAuthorizedFunction decode(XdrDataInputStream stream) throws @Override public int hashCode() { - return Objects.hashCode(this.contractFn, this.createContractHostFn, this.type); + return Objects.hash(this.contractFn, this.createContractHostFn, this.type); } @Override @@ -133,15 +133,14 @@ public boolean equals(Object object) { } SorobanAuthorizedFunction other = (SorobanAuthorizedFunction) object; - return Objects.equal(this.contractFn, other.contractFn) - && Objects.equal(this.createContractHostFn, other.createContractHostFn) - && Objects.equal(this.type, other.type); + return Objects.equals(this.contractFn, other.contractFn) + && Objects.equals(this.createContractHostFn, other.createContractHostFn) + && Objects.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -153,8 +152,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SorobanAuthorizedFunction fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SorobanAuthorizedFunctionType.java b/src/main/java/org/stellar/sdk/xdr/SorobanAuthorizedFunctionType.java index c6b379c35..d1d22f9fe 100644 --- a/src/main/java/org/stellar/sdk/xdr/SorobanAuthorizedFunctionType.java +++ b/src/main/java/org/stellar/sdk/xdr/SorobanAuthorizedFunctionType.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -56,8 +56,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -69,8 +68,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SorobanAuthorizedFunctionType fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SorobanAuthorizedInvocation.java b/src/main/java/org/stellar/sdk/xdr/SorobanAuthorizedInvocation.java index 1a2ffb74a..3e874354d 100644 --- a/src/main/java/org/stellar/sdk/xdr/SorobanAuthorizedInvocation.java +++ b/src/main/java/org/stellar/sdk/xdr/SorobanAuthorizedInvocation.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -76,7 +76,7 @@ public static SorobanAuthorizedInvocation decode(XdrDataInputStream stream) thro @Override public int hashCode() { - return Objects.hashCode(this.function, Arrays.hashCode(this.subInvocations)); + return Objects.hash(this.function, Arrays.hashCode(this.subInvocations)); } @Override @@ -86,14 +86,13 @@ public boolean equals(Object object) { } SorobanAuthorizedInvocation other = (SorobanAuthorizedInvocation) object; - return Objects.equal(this.function, other.function) + return Objects.equals(this.function, other.function) && Arrays.equals(this.subInvocations, other.subInvocations); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -105,8 +104,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SorobanAuthorizedInvocation fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SorobanCredentials.java b/src/main/java/org/stellar/sdk/xdr/SorobanCredentials.java index 3500dedef..e982dc68d 100644 --- a/src/main/java/org/stellar/sdk/xdr/SorobanCredentials.java +++ b/src/main/java/org/stellar/sdk/xdr/SorobanCredentials.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -101,7 +101,7 @@ public static SorobanCredentials decode(XdrDataInputStream stream) throws IOExce @Override public int hashCode() { - return Objects.hashCode(this.address, this.type); + return Objects.hash(this.address, this.type); } @Override @@ -111,13 +111,12 @@ public boolean equals(Object object) { } SorobanCredentials other = (SorobanCredentials) object; - return Objects.equal(this.address, other.address) && Objects.equal(this.type, other.type); + return Objects.equals(this.address, other.address) && Objects.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -129,8 +128,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SorobanCredentials fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SorobanCredentialsType.java b/src/main/java/org/stellar/sdk/xdr/SorobanCredentialsType.java index 2b802b010..80718d95d 100644 --- a/src/main/java/org/stellar/sdk/xdr/SorobanCredentialsType.java +++ b/src/main/java/org/stellar/sdk/xdr/SorobanCredentialsType.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -56,8 +56,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -69,8 +68,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SorobanCredentialsType fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SorobanResources.java b/src/main/java/org/stellar/sdk/xdr/SorobanResources.java index 9ebacdd0e..24495e617 100644 --- a/src/main/java/org/stellar/sdk/xdr/SorobanResources.java +++ b/src/main/java/org/stellar/sdk/xdr/SorobanResources.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -109,7 +109,7 @@ public static SorobanResources decode(XdrDataInputStream stream) throws IOExcept @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.footprint, this.instructions, this.readBytes, @@ -124,17 +124,16 @@ public boolean equals(Object object) { } SorobanResources other = (SorobanResources) object; - return Objects.equal(this.footprint, other.footprint) - && Objects.equal(this.instructions, other.instructions) - && Objects.equal(this.readBytes, other.readBytes) - && Objects.equal(this.writeBytes, other.writeBytes) - && Objects.equal(this.extendedMetaDataSizeBytes, other.extendedMetaDataSizeBytes); + return Objects.equals(this.footprint, other.footprint) + && Objects.equals(this.instructions, other.instructions) + && Objects.equals(this.readBytes, other.readBytes) + && Objects.equals(this.writeBytes, other.writeBytes) + && Objects.equals(this.extendedMetaDataSizeBytes, other.extendedMetaDataSizeBytes); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -146,8 +145,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SorobanResources fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SorobanTransactionData.java b/src/main/java/org/stellar/sdk/xdr/SorobanTransactionData.java index 87db2f534..1885f4450 100644 --- a/src/main/java/org/stellar/sdk/xdr/SorobanTransactionData.java +++ b/src/main/java/org/stellar/sdk/xdr/SorobanTransactionData.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -77,7 +77,7 @@ public static SorobanTransactionData decode(XdrDataInputStream stream) throws IO @Override public int hashCode() { - return Objects.hashCode(this.ext, this.resources, this.refundableFee); + return Objects.hash(this.ext, this.resources, this.refundableFee); } @Override @@ -87,15 +87,14 @@ public boolean equals(Object object) { } SorobanTransactionData other = (SorobanTransactionData) object; - return Objects.equal(this.ext, other.ext) - && Objects.equal(this.resources, other.resources) - && Objects.equal(this.refundableFee, other.refundableFee); + return Objects.equals(this.ext, other.ext) + && Objects.equals(this.resources, other.resources) + && Objects.equals(this.refundableFee, other.refundableFee); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -107,8 +106,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SorobanTransactionData fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SorobanTransactionMeta.java b/src/main/java/org/stellar/sdk/xdr/SorobanTransactionMeta.java index 018214361..5fea572eb 100644 --- a/src/main/java/org/stellar/sdk/xdr/SorobanTransactionMeta.java +++ b/src/main/java/org/stellar/sdk/xdr/SorobanTransactionMeta.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -112,7 +112,7 @@ public static SorobanTransactionMeta decode(XdrDataInputStream stream) throws IO @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.ext, Arrays.hashCode(this.events), this.returnValue, @@ -126,16 +126,15 @@ public boolean equals(Object object) { } SorobanTransactionMeta other = (SorobanTransactionMeta) object; - return Objects.equal(this.ext, other.ext) + return Objects.equals(this.ext, other.ext) && Arrays.equals(this.events, other.events) - && Objects.equal(this.returnValue, other.returnValue) + && Objects.equals(this.returnValue, other.returnValue) && Arrays.equals(this.diagnosticEvents, other.diagnosticEvents); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -147,8 +146,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SorobanTransactionMeta fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SponsorshipDescriptor.java b/src/main/java/org/stellar/sdk/xdr/SponsorshipDescriptor.java index d93cf6a51..a02fd20f4 100644 --- a/src/main/java/org/stellar/sdk/xdr/SponsorshipDescriptor.java +++ b/src/main/java/org/stellar/sdk/xdr/SponsorshipDescriptor.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -59,7 +59,7 @@ public static SponsorshipDescriptor decode(XdrDataInputStream stream) throws IOE @Override public int hashCode() { - return Objects.hashCode(this.SponsorshipDescriptor); + return Objects.hash(this.SponsorshipDescriptor); } @Override @@ -69,13 +69,12 @@ public boolean equals(Object object) { } SponsorshipDescriptor other = (SponsorshipDescriptor) object; - return Objects.equal(this.SponsorshipDescriptor, other.SponsorshipDescriptor); + return Objects.equals(this.SponsorshipDescriptor, other.SponsorshipDescriptor); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -87,8 +86,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SponsorshipDescriptor fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/StateExpirationSettings.java b/src/main/java/org/stellar/sdk/xdr/StateExpirationSettings.java index 5fb509169..768b98f0b 100644 --- a/src/main/java/org/stellar/sdk/xdr/StateExpirationSettings.java +++ b/src/main/java/org/stellar/sdk/xdr/StateExpirationSettings.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -161,7 +161,7 @@ public static StateExpirationSettings decode(XdrDataInputStream stream) throws I @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.maxEntryExpiration, this.minTempEntryExpiration, this.minPersistentEntryExpiration, @@ -180,21 +180,20 @@ public boolean equals(Object object) { } StateExpirationSettings other = (StateExpirationSettings) object; - return Objects.equal(this.maxEntryExpiration, other.maxEntryExpiration) - && Objects.equal(this.minTempEntryExpiration, other.minTempEntryExpiration) - && Objects.equal(this.minPersistentEntryExpiration, other.minPersistentEntryExpiration) - && Objects.equal(this.autoBumpLedgers, other.autoBumpLedgers) - && Objects.equal(this.persistentRentRateDenominator, other.persistentRentRateDenominator) - && Objects.equal(this.tempRentRateDenominator, other.tempRentRateDenominator) - && Objects.equal(this.maxEntriesToExpire, other.maxEntriesToExpire) - && Objects.equal(this.bucketListSizeWindowSampleSize, other.bucketListSizeWindowSampleSize) - && Objects.equal(this.evictionScanSize, other.evictionScanSize); + return Objects.equals(this.maxEntryExpiration, other.maxEntryExpiration) + && Objects.equals(this.minTempEntryExpiration, other.minTempEntryExpiration) + && Objects.equals(this.minPersistentEntryExpiration, other.minPersistentEntryExpiration) + && Objects.equals(this.autoBumpLedgers, other.autoBumpLedgers) + && Objects.equals(this.persistentRentRateDenominator, other.persistentRentRateDenominator) + && Objects.equals(this.tempRentRateDenominator, other.tempRentRateDenominator) + && Objects.equals(this.maxEntriesToExpire, other.maxEntriesToExpire) + && Objects.equals(this.bucketListSizeWindowSampleSize, other.bucketListSizeWindowSampleSize) + && Objects.equals(this.evictionScanSize, other.evictionScanSize); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -206,8 +205,7 @@ public byte[] toXdrByteArray() throws IOException { } public static StateExpirationSettings fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/StellarMessage.java b/src/main/java/org/stellar/sdk/xdr/StellarMessage.java index 28f2fd92e..0ab193c4b 100644 --- a/src/main/java/org/stellar/sdk/xdr/StellarMessage.java +++ b/src/main/java/org/stellar/sdk/xdr/StellarMessage.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -572,7 +572,7 @@ public static StellarMessage decode(XdrDataInputStream stream) throws IOExceptio @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.error, this.hello, this.auth, @@ -602,32 +602,31 @@ public boolean equals(Object object) { } StellarMessage other = (StellarMessage) object; - return Objects.equal(this.error, other.error) - && Objects.equal(this.hello, other.hello) - && Objects.equal(this.auth, other.auth) - && Objects.equal(this.dontHave, other.dontHave) + return Objects.equals(this.error, other.error) + && Objects.equals(this.hello, other.hello) + && Objects.equals(this.auth, other.auth) + && Objects.equals(this.dontHave, other.dontHave) && Arrays.equals(this.peers, other.peers) - && Objects.equal(this.txSetHash, other.txSetHash) - && Objects.equal(this.txSet, other.txSet) - && Objects.equal(this.generalizedTxSet, other.generalizedTxSet) - && Objects.equal(this.transaction, other.transaction) - && Objects.equal(this.signedSurveyRequestMessage, other.signedSurveyRequestMessage) - && Objects.equal(this.signedSurveyResponseMessage, other.signedSurveyResponseMessage) - && Objects.equal(this.qSetHash, other.qSetHash) - && Objects.equal(this.qSet, other.qSet) - && Objects.equal(this.envelope, other.envelope) - && Objects.equal(this.getSCPLedgerSeq, other.getSCPLedgerSeq) - && Objects.equal(this.sendMoreMessage, other.sendMoreMessage) - && Objects.equal(this.sendMoreExtendedMessage, other.sendMoreExtendedMessage) - && Objects.equal(this.floodAdvert, other.floodAdvert) - && Objects.equal(this.floodDemand, other.floodDemand) - && Objects.equal(this.type, other.type); + && Objects.equals(this.txSetHash, other.txSetHash) + && Objects.equals(this.txSet, other.txSet) + && Objects.equals(this.generalizedTxSet, other.generalizedTxSet) + && Objects.equals(this.transaction, other.transaction) + && Objects.equals(this.signedSurveyRequestMessage, other.signedSurveyRequestMessage) + && Objects.equals(this.signedSurveyResponseMessage, other.signedSurveyResponseMessage) + && Objects.equals(this.qSetHash, other.qSetHash) + && Objects.equals(this.qSet, other.qSet) + && Objects.equals(this.envelope, other.envelope) + && Objects.equals(this.getSCPLedgerSeq, other.getSCPLedgerSeq) + && Objects.equals(this.sendMoreMessage, other.sendMoreMessage) + && Objects.equals(this.sendMoreExtendedMessage, other.sendMoreExtendedMessage) + && Objects.equals(this.floodAdvert, other.floodAdvert) + && Objects.equals(this.floodDemand, other.floodDemand) + && Objects.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -639,8 +638,7 @@ public byte[] toXdrByteArray() throws IOException { } public static StellarMessage fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/StellarValue.java b/src/main/java/org/stellar/sdk/xdr/StellarValue.java index 881eafb0d..3aa932c61 100644 --- a/src/main/java/org/stellar/sdk/xdr/StellarValue.java +++ b/src/main/java/org/stellar/sdk/xdr/StellarValue.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -112,8 +112,7 @@ public static StellarValue decode(XdrDataInputStream stream) throws IOException @Override public int hashCode() { - return Objects.hashCode( - this.txSetHash, this.closeTime, Arrays.hashCode(this.upgrades), this.ext); + return Objects.hash(this.txSetHash, this.closeTime, Arrays.hashCode(this.upgrades), this.ext); } @Override @@ -123,16 +122,15 @@ public boolean equals(Object object) { } StellarValue other = (StellarValue) object; - return Objects.equal(this.txSetHash, other.txSetHash) - && Objects.equal(this.closeTime, other.closeTime) + return Objects.equals(this.txSetHash, other.txSetHash) + && Objects.equals(this.closeTime, other.closeTime) && Arrays.equals(this.upgrades, other.upgrades) - && Objects.equal(this.ext, other.ext); + && Objects.equals(this.ext, other.ext); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -144,8 +142,7 @@ public byte[] toXdrByteArray() throws IOException { } public static StellarValue fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -270,7 +267,7 @@ public static StellarValueExt decode(XdrDataInputStream stream) throws IOExcepti @Override public int hashCode() { - return Objects.hashCode(this.lcValueSignature, this.v); + return Objects.hash(this.lcValueSignature, this.v); } @Override @@ -280,14 +277,13 @@ public boolean equals(Object object) { } StellarValueExt other = (StellarValueExt) object; - return Objects.equal(this.lcValueSignature, other.lcValueSignature) - && Objects.equal(this.v, other.v); + return Objects.equals(this.lcValueSignature, other.lcValueSignature) + && Objects.equals(this.v, other.v); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -299,8 +295,7 @@ public byte[] toXdrByteArray() throws IOException { } public static StellarValueExt fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/StellarValueType.java b/src/main/java/org/stellar/sdk/xdr/StellarValueType.java index 510dc3f6c..8af9f42a7 100644 --- a/src/main/java/org/stellar/sdk/xdr/StellarValueType.java +++ b/src/main/java/org/stellar/sdk/xdr/StellarValueType.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -55,8 +55,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -68,8 +67,7 @@ public byte[] toXdrByteArray() throws IOException { } public static StellarValueType fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/StoredTransactionSet.java b/src/main/java/org/stellar/sdk/xdr/StoredTransactionSet.java index ae3c5ad03..ae0839212 100644 --- a/src/main/java/org/stellar/sdk/xdr/StoredTransactionSet.java +++ b/src/main/java/org/stellar/sdk/xdr/StoredTransactionSet.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -121,7 +121,7 @@ public static StoredTransactionSet decode(XdrDataInputStream stream) throws IOEx @Override public int hashCode() { - return Objects.hashCode(this.txSet, this.generalizedTxSet, this.v); + return Objects.hash(this.txSet, this.generalizedTxSet, this.v); } @Override @@ -131,15 +131,14 @@ public boolean equals(Object object) { } StoredTransactionSet other = (StoredTransactionSet) object; - return Objects.equal(this.txSet, other.txSet) - && Objects.equal(this.generalizedTxSet, other.generalizedTxSet) - && Objects.equal(this.v, other.v); + return Objects.equals(this.txSet, other.txSet) + && Objects.equals(this.generalizedTxSet, other.generalizedTxSet) + && Objects.equals(this.v, other.v); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -151,8 +150,7 @@ public byte[] toXdrByteArray() throws IOException { } public static StoredTransactionSet fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/String32.java b/src/main/java/org/stellar/sdk/xdr/String32.java index 9fa8f9320..21182a0b8 100644 --- a/src/main/java/org/stellar/sdk/xdr/String32.java +++ b/src/main/java/org/stellar/sdk/xdr/String32.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -50,7 +50,7 @@ public static String32 decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.string32); + return Objects.hash(this.string32); } @Override @@ -60,13 +60,12 @@ public boolean equals(Object object) { } String32 other = (String32) object; - return Objects.equal(this.string32, other.string32); + return Objects.equals(this.string32, other.string32); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -78,8 +77,7 @@ public byte[] toXdrByteArray() throws IOException { } public static String32 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/String64.java b/src/main/java/org/stellar/sdk/xdr/String64.java index 497f0e732..9fc11681a 100644 --- a/src/main/java/org/stellar/sdk/xdr/String64.java +++ b/src/main/java/org/stellar/sdk/xdr/String64.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -50,7 +50,7 @@ public static String64 decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.string64); + return Objects.hash(this.string64); } @Override @@ -60,13 +60,12 @@ public boolean equals(Object object) { } String64 other = (String64) object; - return Objects.equal(this.string64, other.string64); + return Objects.equals(this.string64, other.string64); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -78,8 +77,7 @@ public byte[] toXdrByteArray() throws IOException { } public static String64 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SurveyMessageCommandType.java b/src/main/java/org/stellar/sdk/xdr/SurveyMessageCommandType.java index c72db98a1..0c2d57183 100644 --- a/src/main/java/org/stellar/sdk/xdr/SurveyMessageCommandType.java +++ b/src/main/java/org/stellar/sdk/xdr/SurveyMessageCommandType.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -52,8 +52,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -65,8 +64,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SurveyMessageCommandType fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SurveyMessageResponseType.java b/src/main/java/org/stellar/sdk/xdr/SurveyMessageResponseType.java index 2df60adfd..95b33dc5e 100644 --- a/src/main/java/org/stellar/sdk/xdr/SurveyMessageResponseType.java +++ b/src/main/java/org/stellar/sdk/xdr/SurveyMessageResponseType.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -56,8 +56,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -69,8 +68,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SurveyMessageResponseType fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SurveyRequestMessage.java b/src/main/java/org/stellar/sdk/xdr/SurveyRequestMessage.java index 81f92b543..a4172172b 100644 --- a/src/main/java/org/stellar/sdk/xdr/SurveyRequestMessage.java +++ b/src/main/java/org/stellar/sdk/xdr/SurveyRequestMessage.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -102,7 +102,7 @@ public static SurveyRequestMessage decode(XdrDataInputStream stream) throws IOEx @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.surveyorPeerID, this.surveyedPeerID, this.ledgerNum, @@ -117,17 +117,16 @@ public boolean equals(Object object) { } SurveyRequestMessage other = (SurveyRequestMessage) object; - return Objects.equal(this.surveyorPeerID, other.surveyorPeerID) - && Objects.equal(this.surveyedPeerID, other.surveyedPeerID) - && Objects.equal(this.ledgerNum, other.ledgerNum) - && Objects.equal(this.encryptionKey, other.encryptionKey) - && Objects.equal(this.commandType, other.commandType); + return Objects.equals(this.surveyorPeerID, other.surveyorPeerID) + && Objects.equals(this.surveyedPeerID, other.surveyedPeerID) + && Objects.equals(this.ledgerNum, other.ledgerNum) + && Objects.equals(this.encryptionKey, other.encryptionKey) + && Objects.equals(this.commandType, other.commandType); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -139,8 +138,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SurveyRequestMessage fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SurveyResponseBody.java b/src/main/java/org/stellar/sdk/xdr/SurveyResponseBody.java index 75cd873c5..1f5217d97 100644 --- a/src/main/java/org/stellar/sdk/xdr/SurveyResponseBody.java +++ b/src/main/java/org/stellar/sdk/xdr/SurveyResponseBody.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -120,7 +120,7 @@ public static SurveyResponseBody decode(XdrDataInputStream stream) throws IOExce @Override public int hashCode() { - return Objects.hashCode(this.topologyResponseBodyV0, this.topologyResponseBodyV1, this.type); + return Objects.hash(this.topologyResponseBodyV0, this.topologyResponseBodyV1, this.type); } @Override @@ -130,15 +130,14 @@ public boolean equals(Object object) { } SurveyResponseBody other = (SurveyResponseBody) object; - return Objects.equal(this.topologyResponseBodyV0, other.topologyResponseBodyV0) - && Objects.equal(this.topologyResponseBodyV1, other.topologyResponseBodyV1) - && Objects.equal(this.type, other.type); + return Objects.equals(this.topologyResponseBodyV0, other.topologyResponseBodyV0) + && Objects.equals(this.topologyResponseBodyV1, other.topologyResponseBodyV1) + && Objects.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -150,8 +149,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SurveyResponseBody fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/SurveyResponseMessage.java b/src/main/java/org/stellar/sdk/xdr/SurveyResponseMessage.java index 843f1d6b4..cc8ee37bc 100644 --- a/src/main/java/org/stellar/sdk/xdr/SurveyResponseMessage.java +++ b/src/main/java/org/stellar/sdk/xdr/SurveyResponseMessage.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -102,7 +102,7 @@ public static SurveyResponseMessage decode(XdrDataInputStream stream) throws IOE @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.surveyorPeerID, this.surveyedPeerID, this.ledgerNum, @@ -117,17 +117,16 @@ public boolean equals(Object object) { } SurveyResponseMessage other = (SurveyResponseMessage) object; - return Objects.equal(this.surveyorPeerID, other.surveyorPeerID) - && Objects.equal(this.surveyedPeerID, other.surveyedPeerID) - && Objects.equal(this.ledgerNum, other.ledgerNum) - && Objects.equal(this.commandType, other.commandType) - && Objects.equal(this.encryptedBody, other.encryptedBody); + return Objects.equals(this.surveyorPeerID, other.surveyorPeerID) + && Objects.equals(this.surveyedPeerID, other.surveyedPeerID) + && Objects.equals(this.ledgerNum, other.ledgerNum) + && Objects.equals(this.commandType, other.commandType) + && Objects.equals(this.encryptedBody, other.encryptedBody); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -139,8 +138,7 @@ public byte[] toXdrByteArray() throws IOException { } public static SurveyResponseMessage fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/ThresholdIndexes.java b/src/main/java/org/stellar/sdk/xdr/ThresholdIndexes.java index 5702020c0..eb7ced745 100644 --- a/src/main/java/org/stellar/sdk/xdr/ThresholdIndexes.java +++ b/src/main/java/org/stellar/sdk/xdr/ThresholdIndexes.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -63,8 +63,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -76,8 +75,7 @@ public byte[] toXdrByteArray() throws IOException { } public static ThresholdIndexes fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/Thresholds.java b/src/main/java/org/stellar/sdk/xdr/Thresholds.java index 3c32de1bf..288853d4c 100644 --- a/src/main/java/org/stellar/sdk/xdr/Thresholds.java +++ b/src/main/java/org/stellar/sdk/xdr/Thresholds.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; // === xdr source ============================================================ @@ -68,8 +68,7 @@ public boolean equals(Object object) { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -81,8 +80,7 @@ public byte[] toXdrByteArray() throws IOException { } public static Thresholds fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/TimeBounds.java b/src/main/java/org/stellar/sdk/xdr/TimeBounds.java index 875b3d0f5..f7d00a24b 100644 --- a/src/main/java/org/stellar/sdk/xdr/TimeBounds.java +++ b/src/main/java/org/stellar/sdk/xdr/TimeBounds.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -62,7 +62,7 @@ public static TimeBounds decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.minTime, this.maxTime); + return Objects.hash(this.minTime, this.maxTime); } @Override @@ -72,13 +72,13 @@ public boolean equals(Object object) { } TimeBounds other = (TimeBounds) object; - return Objects.equal(this.minTime, other.minTime) && Objects.equal(this.maxTime, other.maxTime); + return Objects.equals(this.minTime, other.minTime) + && Objects.equals(this.maxTime, other.maxTime); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -90,8 +90,7 @@ public byte[] toXdrByteArray() throws IOException { } public static TimeBounds fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/TimePoint.java b/src/main/java/org/stellar/sdk/xdr/TimePoint.java index f82679331..e093806fc 100644 --- a/src/main/java/org/stellar/sdk/xdr/TimePoint.java +++ b/src/main/java/org/stellar/sdk/xdr/TimePoint.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -50,7 +50,7 @@ public static TimePoint decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.TimePoint); + return Objects.hash(this.TimePoint); } @Override @@ -60,13 +60,12 @@ public boolean equals(Object object) { } TimePoint other = (TimePoint) object; - return Objects.equal(this.TimePoint, other.TimePoint); + return Objects.equals(this.TimePoint, other.TimePoint); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -78,8 +77,7 @@ public byte[] toXdrByteArray() throws IOException { } public static TimePoint fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/TopologyResponseBodyV0.java b/src/main/java/org/stellar/sdk/xdr/TopologyResponseBodyV0.java index 7a43b161f..ad3b33eb3 100644 --- a/src/main/java/org/stellar/sdk/xdr/TopologyResponseBodyV0.java +++ b/src/main/java/org/stellar/sdk/xdr/TopologyResponseBodyV0.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -90,7 +90,7 @@ public static TopologyResponseBodyV0 decode(XdrDataInputStream stream) throws IO @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.inboundPeers, this.outboundPeers, this.totalInboundPeerCount, @@ -104,16 +104,15 @@ public boolean equals(Object object) { } TopologyResponseBodyV0 other = (TopologyResponseBodyV0) object; - return Objects.equal(this.inboundPeers, other.inboundPeers) - && Objects.equal(this.outboundPeers, other.outboundPeers) - && Objects.equal(this.totalInboundPeerCount, other.totalInboundPeerCount) - && Objects.equal(this.totalOutboundPeerCount, other.totalOutboundPeerCount); + return Objects.equals(this.inboundPeers, other.inboundPeers) + && Objects.equals(this.outboundPeers, other.outboundPeers) + && Objects.equals(this.totalInboundPeerCount, other.totalInboundPeerCount) + && Objects.equals(this.totalOutboundPeerCount, other.totalOutboundPeerCount); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -125,8 +124,7 @@ public byte[] toXdrByteArray() throws IOException { } public static TopologyResponseBodyV0 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/TopologyResponseBodyV1.java b/src/main/java/org/stellar/sdk/xdr/TopologyResponseBodyV1.java index c8059f697..cc9713013 100644 --- a/src/main/java/org/stellar/sdk/xdr/TopologyResponseBodyV1.java +++ b/src/main/java/org/stellar/sdk/xdr/TopologyResponseBodyV1.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -117,7 +117,7 @@ public static TopologyResponseBodyV1 decode(XdrDataInputStream stream) throws IO @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.inboundPeers, this.outboundPeers, this.totalInboundPeerCount, @@ -133,18 +133,17 @@ public boolean equals(Object object) { } TopologyResponseBodyV1 other = (TopologyResponseBodyV1) object; - return Objects.equal(this.inboundPeers, other.inboundPeers) - && Objects.equal(this.outboundPeers, other.outboundPeers) - && Objects.equal(this.totalInboundPeerCount, other.totalInboundPeerCount) - && Objects.equal(this.totalOutboundPeerCount, other.totalOutboundPeerCount) - && Objects.equal(this.maxInboundPeerCount, other.maxInboundPeerCount) - && Objects.equal(this.maxOutboundPeerCount, other.maxOutboundPeerCount); + return Objects.equals(this.inboundPeers, other.inboundPeers) + && Objects.equals(this.outboundPeers, other.outboundPeers) + && Objects.equals(this.totalInboundPeerCount, other.totalInboundPeerCount) + && Objects.equals(this.totalOutboundPeerCount, other.totalOutboundPeerCount) + && Objects.equals(this.maxInboundPeerCount, other.maxInboundPeerCount) + && Objects.equals(this.maxOutboundPeerCount, other.maxOutboundPeerCount); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -156,8 +155,7 @@ public byte[] toXdrByteArray() throws IOException { } public static TopologyResponseBodyV1 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/Transaction.java b/src/main/java/org/stellar/sdk/xdr/Transaction.java index f5cf25588..b5896d5b2 100644 --- a/src/main/java/org/stellar/sdk/xdr/Transaction.java +++ b/src/main/java/org/stellar/sdk/xdr/Transaction.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -154,7 +154,7 @@ public static Transaction decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.sourceAccount, this.fee, this.seqNum, @@ -171,19 +171,18 @@ public boolean equals(Object object) { } Transaction other = (Transaction) object; - return Objects.equal(this.sourceAccount, other.sourceAccount) - && Objects.equal(this.fee, other.fee) - && Objects.equal(this.seqNum, other.seqNum) - && Objects.equal(this.cond, other.cond) - && Objects.equal(this.memo, other.memo) + return Objects.equals(this.sourceAccount, other.sourceAccount) + && Objects.equals(this.fee, other.fee) + && Objects.equals(this.seqNum, other.seqNum) + && Objects.equals(this.cond, other.cond) + && Objects.equals(this.memo, other.memo) && Arrays.equals(this.operations, other.operations) - && Objects.equal(this.ext, other.ext); + && Objects.equals(this.ext, other.ext); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -195,8 +194,7 @@ public byte[] toXdrByteArray() throws IOException { } public static Transaction fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -342,7 +340,7 @@ public static TransactionExt decode(XdrDataInputStream stream) throws IOExceptio @Override public int hashCode() { - return Objects.hashCode(this.sorobanData, this.v); + return Objects.hash(this.sorobanData, this.v); } @Override @@ -352,13 +350,12 @@ public boolean equals(Object object) { } TransactionExt other = (TransactionExt) object; - return Objects.equal(this.sorobanData, other.sorobanData) && Objects.equal(this.v, other.v); + return Objects.equals(this.sorobanData, other.sorobanData) && Objects.equals(this.v, other.v); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -370,8 +367,7 @@ public byte[] toXdrByteArray() throws IOException { } public static TransactionExt fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/TransactionEnvelope.java b/src/main/java/org/stellar/sdk/xdr/TransactionEnvelope.java index c837b112c..b8c9fe213 100644 --- a/src/main/java/org/stellar/sdk/xdr/TransactionEnvelope.java +++ b/src/main/java/org/stellar/sdk/xdr/TransactionEnvelope.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -146,7 +146,7 @@ public static TransactionEnvelope decode(XdrDataInputStream stream) throws IOExc @Override public int hashCode() { - return Objects.hashCode(this.v0, this.v1, this.feeBump, this.type); + return Objects.hash(this.v0, this.v1, this.feeBump, this.type); } @Override @@ -156,16 +156,15 @@ public boolean equals(Object object) { } TransactionEnvelope other = (TransactionEnvelope) object; - return Objects.equal(this.v0, other.v0) - && Objects.equal(this.v1, other.v1) - && Objects.equal(this.feeBump, other.feeBump) - && Objects.equal(this.type, other.type); + return Objects.equals(this.v0, other.v0) + && Objects.equals(this.v1, other.v1) + && Objects.equals(this.feeBump, other.feeBump) + && Objects.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -177,8 +176,7 @@ public byte[] toXdrByteArray() throws IOException { } public static TransactionEnvelope fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/TransactionHistoryEntry.java b/src/main/java/org/stellar/sdk/xdr/TransactionHistoryEntry.java index f270ef9c8..3b3bc9d16 100644 --- a/src/main/java/org/stellar/sdk/xdr/TransactionHistoryEntry.java +++ b/src/main/java/org/stellar/sdk/xdr/TransactionHistoryEntry.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -85,7 +85,7 @@ public static TransactionHistoryEntry decode(XdrDataInputStream stream) throws I @Override public int hashCode() { - return Objects.hashCode(this.ledgerSeq, this.txSet, this.ext); + return Objects.hash(this.ledgerSeq, this.txSet, this.ext); } @Override @@ -95,15 +95,14 @@ public boolean equals(Object object) { } TransactionHistoryEntry other = (TransactionHistoryEntry) object; - return Objects.equal(this.ledgerSeq, other.ledgerSeq) - && Objects.equal(this.txSet, other.txSet) - && Objects.equal(this.ext, other.ext); + return Objects.equals(this.ledgerSeq, other.ledgerSeq) + && Objects.equals(this.txSet, other.txSet) + && Objects.equals(this.ext, other.ext); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -115,8 +114,7 @@ public byte[] toXdrByteArray() throws IOException { } public static TransactionHistoryEntry fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -238,7 +236,7 @@ public static TransactionHistoryEntryExt decode(XdrDataInputStream stream) throw @Override public int hashCode() { - return Objects.hashCode(this.generalizedTxSet, this.v); + return Objects.hash(this.generalizedTxSet, this.v); } @Override @@ -248,14 +246,13 @@ public boolean equals(Object object) { } TransactionHistoryEntryExt other = (TransactionHistoryEntryExt) object; - return Objects.equal(this.generalizedTxSet, other.generalizedTxSet) - && Objects.equal(this.v, other.v); + return Objects.equals(this.generalizedTxSet, other.generalizedTxSet) + && Objects.equals(this.v, other.v); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -267,8 +264,7 @@ public byte[] toXdrByteArray() throws IOException { } public static TransactionHistoryEntryExt fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/TransactionHistoryResultEntry.java b/src/main/java/org/stellar/sdk/xdr/TransactionHistoryResultEntry.java index c4431b7bb..3f85fdfaf 100644 --- a/src/main/java/org/stellar/sdk/xdr/TransactionHistoryResultEntry.java +++ b/src/main/java/org/stellar/sdk/xdr/TransactionHistoryResultEntry.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -85,7 +85,7 @@ public static TransactionHistoryResultEntry decode(XdrDataInputStream stream) th @Override public int hashCode() { - return Objects.hashCode(this.ledgerSeq, this.txResultSet, this.ext); + return Objects.hash(this.ledgerSeq, this.txResultSet, this.ext); } @Override @@ -95,15 +95,14 @@ public boolean equals(Object object) { } TransactionHistoryResultEntry other = (TransactionHistoryResultEntry) object; - return Objects.equal(this.ledgerSeq, other.ledgerSeq) - && Objects.equal(this.txResultSet, other.txResultSet) - && Objects.equal(this.ext, other.ext); + return Objects.equals(this.ledgerSeq, other.ledgerSeq) + && Objects.equals(this.txResultSet, other.txResultSet) + && Objects.equals(this.ext, other.ext); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -115,8 +114,7 @@ public byte[] toXdrByteArray() throws IOException { } public static TransactionHistoryResultEntry fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -215,7 +213,7 @@ public static TransactionHistoryResultEntryExt decode(XdrDataInputStream stream) @Override public int hashCode() { - return Objects.hashCode(this.v); + return Objects.hash(this.v); } @Override @@ -225,13 +223,12 @@ public boolean equals(Object object) { } TransactionHistoryResultEntryExt other = (TransactionHistoryResultEntryExt) object; - return Objects.equal(this.v, other.v); + return Objects.equals(this.v, other.v); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -243,8 +240,7 @@ public byte[] toXdrByteArray() throws IOException { } public static TransactionHistoryResultEntryExt fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/TransactionMeta.java b/src/main/java/org/stellar/sdk/xdr/TransactionMeta.java index e774bf88e..a5f901e5f 100644 --- a/src/main/java/org/stellar/sdk/xdr/TransactionMeta.java +++ b/src/main/java/org/stellar/sdk/xdr/TransactionMeta.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -179,7 +179,7 @@ public static TransactionMeta decode(XdrDataInputStream stream) throws IOExcepti @Override public int hashCode() { - return Objects.hashCode(Arrays.hashCode(this.operations), this.v1, this.v2, this.v3, this.v); + return Objects.hash(Arrays.hashCode(this.operations), this.v1, this.v2, this.v3, this.v); } @Override @@ -190,16 +190,15 @@ public boolean equals(Object object) { TransactionMeta other = (TransactionMeta) object; return Arrays.equals(this.operations, other.operations) - && Objects.equal(this.v1, other.v1) - && Objects.equal(this.v2, other.v2) - && Objects.equal(this.v3, other.v3) - && Objects.equal(this.v, other.v); + && Objects.equals(this.v1, other.v1) + && Objects.equals(this.v2, other.v2) + && Objects.equals(this.v3, other.v3) + && Objects.equals(this.v, other.v); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -211,8 +210,7 @@ public byte[] toXdrByteArray() throws IOException { } public static TransactionMeta fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/TransactionMetaV1.java b/src/main/java/org/stellar/sdk/xdr/TransactionMetaV1.java index 5e1eacca0..304753da3 100644 --- a/src/main/java/org/stellar/sdk/xdr/TransactionMetaV1.java +++ b/src/main/java/org/stellar/sdk/xdr/TransactionMetaV1.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -71,7 +71,7 @@ public static TransactionMetaV1 decode(XdrDataInputStream stream) throws IOExcep @Override public int hashCode() { - return Objects.hashCode(this.txChanges, Arrays.hashCode(this.operations)); + return Objects.hash(this.txChanges, Arrays.hashCode(this.operations)); } @Override @@ -81,14 +81,13 @@ public boolean equals(Object object) { } TransactionMetaV1 other = (TransactionMetaV1) object; - return Objects.equal(this.txChanges, other.txChanges) + return Objects.equals(this.txChanges, other.txChanges) && Arrays.equals(this.operations, other.operations); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -100,8 +99,7 @@ public byte[] toXdrByteArray() throws IOException { } public static TransactionMetaV1 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/TransactionMetaV2.java b/src/main/java/org/stellar/sdk/xdr/TransactionMetaV2.java index 08e04a479..c7f68ba44 100644 --- a/src/main/java/org/stellar/sdk/xdr/TransactionMetaV2.java +++ b/src/main/java/org/stellar/sdk/xdr/TransactionMetaV2.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -86,7 +86,7 @@ public static TransactionMetaV2 decode(XdrDataInputStream stream) throws IOExcep @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.txChangesBefore, Arrays.hashCode(this.operations), this.txChangesAfter); } @@ -97,15 +97,14 @@ public boolean equals(Object object) { } TransactionMetaV2 other = (TransactionMetaV2) object; - return Objects.equal(this.txChangesBefore, other.txChangesBefore) + return Objects.equals(this.txChangesBefore, other.txChangesBefore) && Arrays.equals(this.operations, other.operations) - && Objects.equal(this.txChangesAfter, other.txChangesAfter); + && Objects.equals(this.txChangesAfter, other.txChangesAfter); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -117,8 +116,7 @@ public byte[] toXdrByteArray() throws IOException { } public static TransactionMetaV2 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/TransactionMetaV3.java b/src/main/java/org/stellar/sdk/xdr/TransactionMetaV3.java index fa335d95d..33b525771 100644 --- a/src/main/java/org/stellar/sdk/xdr/TransactionMetaV3.java +++ b/src/main/java/org/stellar/sdk/xdr/TransactionMetaV3.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -122,7 +122,7 @@ public static TransactionMetaV3 decode(XdrDataInputStream stream) throws IOExcep @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.ext, this.txChangesBefore, Arrays.hashCode(this.operations), @@ -137,17 +137,16 @@ public boolean equals(Object object) { } TransactionMetaV3 other = (TransactionMetaV3) object; - return Objects.equal(this.ext, other.ext) - && Objects.equal(this.txChangesBefore, other.txChangesBefore) + return Objects.equals(this.ext, other.ext) + && Objects.equals(this.txChangesBefore, other.txChangesBefore) && Arrays.equals(this.operations, other.operations) - && Objects.equal(this.txChangesAfter, other.txChangesAfter) - && Objects.equal(this.sorobanMeta, other.sorobanMeta); + && Objects.equals(this.txChangesAfter, other.txChangesAfter) + && Objects.equals(this.sorobanMeta, other.sorobanMeta); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -159,8 +158,7 @@ public byte[] toXdrByteArray() throws IOException { } public static TransactionMetaV3 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/TransactionPhase.java b/src/main/java/org/stellar/sdk/xdr/TransactionPhase.java index fdda2be93..8df20aff5 100644 --- a/src/main/java/org/stellar/sdk/xdr/TransactionPhase.java +++ b/src/main/java/org/stellar/sdk/xdr/TransactionPhase.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -104,7 +104,7 @@ public static TransactionPhase decode(XdrDataInputStream stream) throws IOExcept @Override public int hashCode() { - return Objects.hashCode(Arrays.hashCode(this.v0Components), this.v); + return Objects.hash(Arrays.hashCode(this.v0Components), this.v); } @Override @@ -114,13 +114,12 @@ public boolean equals(Object object) { } TransactionPhase other = (TransactionPhase) object; - return Arrays.equals(this.v0Components, other.v0Components) && Objects.equal(this.v, other.v); + return Arrays.equals(this.v0Components, other.v0Components) && Objects.equals(this.v, other.v); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -132,8 +131,7 @@ public byte[] toXdrByteArray() throws IOException { } public static TransactionPhase fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/TransactionResult.java b/src/main/java/org/stellar/sdk/xdr/TransactionResult.java index d4f310bf5..2d7c24545 100644 --- a/src/main/java/org/stellar/sdk/xdr/TransactionResult.java +++ b/src/main/java/org/stellar/sdk/xdr/TransactionResult.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -110,7 +110,7 @@ public static TransactionResult decode(XdrDataInputStream stream) throws IOExcep @Override public int hashCode() { - return Objects.hashCode(this.feeCharged, this.result, this.ext); + return Objects.hash(this.feeCharged, this.result, this.ext); } @Override @@ -120,15 +120,14 @@ public boolean equals(Object object) { } TransactionResult other = (TransactionResult) object; - return Objects.equal(this.feeCharged, other.feeCharged) - && Objects.equal(this.result, other.result) - && Objects.equal(this.ext, other.ext); + return Objects.equals(this.feeCharged, other.feeCharged) + && Objects.equals(this.result, other.result) + && Objects.equals(this.ext, other.ext); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -140,8 +139,7 @@ public byte[] toXdrByteArray() throws IOException { } public static TransactionResult fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -324,7 +322,7 @@ public static TransactionResultResult decode(XdrDataInputStream stream) throws I @Override public int hashCode() { - return Objects.hashCode(this.innerResultPair, Arrays.hashCode(this.results), this.code); + return Objects.hash(this.innerResultPair, Arrays.hashCode(this.results), this.code); } @Override @@ -334,15 +332,14 @@ public boolean equals(Object object) { } TransactionResultResult other = (TransactionResultResult) object; - return Objects.equal(this.innerResultPair, other.innerResultPair) + return Objects.equals(this.innerResultPair, other.innerResultPair) && Arrays.equals(this.results, other.results) - && Objects.equal(this.code, other.code); + && Objects.equals(this.code, other.code); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -354,8 +351,7 @@ public byte[] toXdrByteArray() throws IOException { } public static TransactionResultResult fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -423,7 +419,7 @@ public static TransactionResultExt decode(XdrDataInputStream stream) throws IOEx @Override public int hashCode() { - return Objects.hashCode(this.v); + return Objects.hash(this.v); } @Override @@ -433,13 +429,12 @@ public boolean equals(Object object) { } TransactionResultExt other = (TransactionResultExt) object; - return Objects.equal(this.v, other.v); + return Objects.equals(this.v, other.v); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -451,8 +446,7 @@ public byte[] toXdrByteArray() throws IOException { } public static TransactionResultExt fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/TransactionResultCode.java b/src/main/java/org/stellar/sdk/xdr/TransactionResultCode.java index 8f0d827df..2dad2fd7b 100644 --- a/src/main/java/org/stellar/sdk/xdr/TransactionResultCode.java +++ b/src/main/java/org/stellar/sdk/xdr/TransactionResultCode.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -130,8 +130,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -143,8 +142,7 @@ public byte[] toXdrByteArray() throws IOException { } public static TransactionResultCode fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/TransactionResultMeta.java b/src/main/java/org/stellar/sdk/xdr/TransactionResultMeta.java index 5c2009027..a1c031ba4 100644 --- a/src/main/java/org/stellar/sdk/xdr/TransactionResultMeta.java +++ b/src/main/java/org/stellar/sdk/xdr/TransactionResultMeta.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -76,7 +76,7 @@ public static TransactionResultMeta decode(XdrDataInputStream stream) throws IOE @Override public int hashCode() { - return Objects.hashCode(this.result, this.feeProcessing, this.txApplyProcessing); + return Objects.hash(this.result, this.feeProcessing, this.txApplyProcessing); } @Override @@ -86,15 +86,14 @@ public boolean equals(Object object) { } TransactionResultMeta other = (TransactionResultMeta) object; - return Objects.equal(this.result, other.result) - && Objects.equal(this.feeProcessing, other.feeProcessing) - && Objects.equal(this.txApplyProcessing, other.txApplyProcessing); + return Objects.equals(this.result, other.result) + && Objects.equals(this.feeProcessing, other.feeProcessing) + && Objects.equals(this.txApplyProcessing, other.txApplyProcessing); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -106,8 +105,7 @@ public byte[] toXdrByteArray() throws IOException { } public static TransactionResultMeta fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/TransactionResultPair.java b/src/main/java/org/stellar/sdk/xdr/TransactionResultPair.java index 261a02976..3ba025093 100644 --- a/src/main/java/org/stellar/sdk/xdr/TransactionResultPair.java +++ b/src/main/java/org/stellar/sdk/xdr/TransactionResultPair.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -63,7 +63,7 @@ public static TransactionResultPair decode(XdrDataInputStream stream) throws IOE @Override public int hashCode() { - return Objects.hashCode(this.transactionHash, this.result); + return Objects.hash(this.transactionHash, this.result); } @Override @@ -73,14 +73,13 @@ public boolean equals(Object object) { } TransactionResultPair other = (TransactionResultPair) object; - return Objects.equal(this.transactionHash, other.transactionHash) - && Objects.equal(this.result, other.result); + return Objects.equals(this.transactionHash, other.transactionHash) + && Objects.equals(this.result, other.result); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -92,8 +91,7 @@ public byte[] toXdrByteArray() throws IOException { } public static TransactionResultPair fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/TransactionResultSet.java b/src/main/java/org/stellar/sdk/xdr/TransactionResultSet.java index 58afcfcc1..4c06be4f1 100644 --- a/src/main/java/org/stellar/sdk/xdr/TransactionResultSet.java +++ b/src/main/java/org/stellar/sdk/xdr/TransactionResultSet.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; // === xdr source ============================================================ @@ -73,8 +73,7 @@ public boolean equals(Object object) { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -86,8 +85,7 @@ public byte[] toXdrByteArray() throws IOException { } public static TransactionResultSet fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/TransactionSet.java b/src/main/java/org/stellar/sdk/xdr/TransactionSet.java index 81fdc7786..8719f592c 100644 --- a/src/main/java/org/stellar/sdk/xdr/TransactionSet.java +++ b/src/main/java/org/stellar/sdk/xdr/TransactionSet.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -71,7 +71,7 @@ public static TransactionSet decode(XdrDataInputStream stream) throws IOExceptio @Override public int hashCode() { - return Objects.hashCode(this.previousLedgerHash, Arrays.hashCode(this.txs)); + return Objects.hash(this.previousLedgerHash, Arrays.hashCode(this.txs)); } @Override @@ -81,14 +81,13 @@ public boolean equals(Object object) { } TransactionSet other = (TransactionSet) object; - return Objects.equal(this.previousLedgerHash, other.previousLedgerHash) + return Objects.equals(this.previousLedgerHash, other.previousLedgerHash) && Arrays.equals(this.txs, other.txs); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -100,8 +99,7 @@ public byte[] toXdrByteArray() throws IOException { } public static TransactionSet fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/TransactionSetV1.java b/src/main/java/org/stellar/sdk/xdr/TransactionSetV1.java index d90406653..3fcd7d818 100644 --- a/src/main/java/org/stellar/sdk/xdr/TransactionSetV1.java +++ b/src/main/java/org/stellar/sdk/xdr/TransactionSetV1.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -71,7 +71,7 @@ public static TransactionSetV1 decode(XdrDataInputStream stream) throws IOExcept @Override public int hashCode() { - return Objects.hashCode(this.previousLedgerHash, Arrays.hashCode(this.phases)); + return Objects.hash(this.previousLedgerHash, Arrays.hashCode(this.phases)); } @Override @@ -81,14 +81,13 @@ public boolean equals(Object object) { } TransactionSetV1 other = (TransactionSetV1) object; - return Objects.equal(this.previousLedgerHash, other.previousLedgerHash) + return Objects.equals(this.previousLedgerHash, other.previousLedgerHash) && Arrays.equals(this.phases, other.phases); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -100,8 +99,7 @@ public byte[] toXdrByteArray() throws IOException { } public static TransactionSetV1 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/TransactionSignaturePayload.java b/src/main/java/org/stellar/sdk/xdr/TransactionSignaturePayload.java index 113063f35..88820c66b 100644 --- a/src/main/java/org/stellar/sdk/xdr/TransactionSignaturePayload.java +++ b/src/main/java/org/stellar/sdk/xdr/TransactionSignaturePayload.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -74,7 +74,7 @@ public static TransactionSignaturePayload decode(XdrDataInputStream stream) thro @Override public int hashCode() { - return Objects.hashCode(this.networkId, this.taggedTransaction); + return Objects.hash(this.networkId, this.taggedTransaction); } @Override @@ -84,14 +84,13 @@ public boolean equals(Object object) { } TransactionSignaturePayload other = (TransactionSignaturePayload) object; - return Objects.equal(this.networkId, other.networkId) - && Objects.equal(this.taggedTransaction, other.taggedTransaction); + return Objects.equals(this.networkId, other.networkId) + && Objects.equals(this.taggedTransaction, other.taggedTransaction); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -103,8 +102,7 @@ public byte[] toXdrByteArray() throws IOException { } public static TransactionSignaturePayload fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -245,7 +243,7 @@ public static TransactionSignaturePayloadTaggedTransaction decode(XdrDataInputSt @Override public int hashCode() { - return Objects.hashCode(this.tx, this.feeBump, this.type); + return Objects.hash(this.tx, this.feeBump, this.type); } @Override @@ -256,15 +254,14 @@ public boolean equals(Object object) { TransactionSignaturePayloadTaggedTransaction other = (TransactionSignaturePayloadTaggedTransaction) object; - return Objects.equal(this.tx, other.tx) - && Objects.equal(this.feeBump, other.feeBump) - && Objects.equal(this.type, other.type); + return Objects.equals(this.tx, other.tx) + && Objects.equals(this.feeBump, other.feeBump) + && Objects.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -277,8 +274,7 @@ public byte[] toXdrByteArray() throws IOException { public static TransactionSignaturePayloadTaggedTransaction fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/TransactionV0.java b/src/main/java/org/stellar/sdk/xdr/TransactionV0.java index 06c46c0c3..9b7d5228f 100644 --- a/src/main/java/org/stellar/sdk/xdr/TransactionV0.java +++ b/src/main/java/org/stellar/sdk/xdr/TransactionV0.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -149,7 +149,7 @@ public static TransactionV0 decode(XdrDataInputStream stream) throws IOException @Override public int hashCode() { - return Objects.hashCode( + return Objects.hash( this.sourceAccountEd25519, this.fee, this.seqNum, @@ -166,19 +166,18 @@ public boolean equals(Object object) { } TransactionV0 other = (TransactionV0) object; - return Objects.equal(this.sourceAccountEd25519, other.sourceAccountEd25519) - && Objects.equal(this.fee, other.fee) - && Objects.equal(this.seqNum, other.seqNum) - && Objects.equal(this.timeBounds, other.timeBounds) - && Objects.equal(this.memo, other.memo) + return Objects.equals(this.sourceAccountEd25519, other.sourceAccountEd25519) + && Objects.equals(this.fee, other.fee) + && Objects.equals(this.seqNum, other.seqNum) + && Objects.equals(this.timeBounds, other.timeBounds) + && Objects.equals(this.memo, other.memo) && Arrays.equals(this.operations, other.operations) - && Objects.equal(this.ext, other.ext); + && Objects.equals(this.ext, other.ext); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -190,8 +189,7 @@ public byte[] toXdrByteArray() throws IOException { } public static TransactionV0 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -314,7 +312,7 @@ public static TransactionV0Ext decode(XdrDataInputStream stream) throws IOExcept @Override public int hashCode() { - return Objects.hashCode(this.v); + return Objects.hash(this.v); } @Override @@ -324,13 +322,12 @@ public boolean equals(Object object) { } TransactionV0Ext other = (TransactionV0Ext) object; - return Objects.equal(this.v, other.v); + return Objects.equals(this.v, other.v); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -342,8 +339,7 @@ public byte[] toXdrByteArray() throws IOException { } public static TransactionV0Ext fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/TransactionV0Envelope.java b/src/main/java/org/stellar/sdk/xdr/TransactionV0Envelope.java index 11b519c33..51b1b870d 100644 --- a/src/main/java/org/stellar/sdk/xdr/TransactionV0Envelope.java +++ b/src/main/java/org/stellar/sdk/xdr/TransactionV0Envelope.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -74,7 +74,7 @@ public static TransactionV0Envelope decode(XdrDataInputStream stream) throws IOE @Override public int hashCode() { - return Objects.hashCode(this.tx, Arrays.hashCode(this.signatures)); + return Objects.hash(this.tx, Arrays.hashCode(this.signatures)); } @Override @@ -84,13 +84,12 @@ public boolean equals(Object object) { } TransactionV0Envelope other = (TransactionV0Envelope) object; - return Objects.equal(this.tx, other.tx) && Arrays.equals(this.signatures, other.signatures); + return Objects.equals(this.tx, other.tx) && Arrays.equals(this.signatures, other.signatures); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -102,8 +101,7 @@ public byte[] toXdrByteArray() throws IOException { } public static TransactionV0Envelope fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/TransactionV1Envelope.java b/src/main/java/org/stellar/sdk/xdr/TransactionV1Envelope.java index 8d88ddd3f..6ea151351 100644 --- a/src/main/java/org/stellar/sdk/xdr/TransactionV1Envelope.java +++ b/src/main/java/org/stellar/sdk/xdr/TransactionV1Envelope.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -74,7 +74,7 @@ public static TransactionV1Envelope decode(XdrDataInputStream stream) throws IOE @Override public int hashCode() { - return Objects.hashCode(this.tx, Arrays.hashCode(this.signatures)); + return Objects.hash(this.tx, Arrays.hashCode(this.signatures)); } @Override @@ -84,13 +84,12 @@ public boolean equals(Object object) { } TransactionV1Envelope other = (TransactionV1Envelope) object; - return Objects.equal(this.tx, other.tx) && Arrays.equals(this.signatures, other.signatures); + return Objects.equals(this.tx, other.tx) && Arrays.equals(this.signatures, other.signatures); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -102,8 +101,7 @@ public byte[] toXdrByteArray() throws IOException { } public static TransactionV1Envelope fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/TrustLineAsset.java b/src/main/java/org/stellar/sdk/xdr/TrustLineAsset.java index 09aab0c9e..00e588e4b 100644 --- a/src/main/java/org/stellar/sdk/xdr/TrustLineAsset.java +++ b/src/main/java/org/stellar/sdk/xdr/TrustLineAsset.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -156,7 +156,7 @@ public static TrustLineAsset decode(XdrDataInputStream stream) throws IOExceptio @Override public int hashCode() { - return Objects.hashCode(this.alphaNum4, this.alphaNum12, this.liquidityPoolID, this.type); + return Objects.hash(this.alphaNum4, this.alphaNum12, this.liquidityPoolID, this.type); } @Override @@ -166,16 +166,15 @@ public boolean equals(Object object) { } TrustLineAsset other = (TrustLineAsset) object; - return Objects.equal(this.alphaNum4, other.alphaNum4) - && Objects.equal(this.alphaNum12, other.alphaNum12) - && Objects.equal(this.liquidityPoolID, other.liquidityPoolID) - && Objects.equal(this.type, other.type); + return Objects.equals(this.alphaNum4, other.alphaNum4) + && Objects.equals(this.alphaNum12, other.alphaNum12) + && Objects.equals(this.liquidityPoolID, other.liquidityPoolID) + && Objects.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -187,8 +186,7 @@ public byte[] toXdrByteArray() throws IOException { } public static TrustLineAsset fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/TrustLineEntry.java b/src/main/java/org/stellar/sdk/xdr/TrustLineEntry.java index 4cfca2ff5..ee1fc1271 100644 --- a/src/main/java/org/stellar/sdk/xdr/TrustLineEntry.java +++ b/src/main/java/org/stellar/sdk/xdr/TrustLineEntry.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -137,8 +137,7 @@ public static TrustLineEntry decode(XdrDataInputStream stream) throws IOExceptio @Override public int hashCode() { - return Objects.hashCode( - this.accountID, this.asset, this.balance, this.limit, this.flags, this.ext); + return Objects.hash(this.accountID, this.asset, this.balance, this.limit, this.flags, this.ext); } @Override @@ -148,18 +147,17 @@ public boolean equals(Object object) { } TrustLineEntry other = (TrustLineEntry) object; - return Objects.equal(this.accountID, other.accountID) - && Objects.equal(this.asset, other.asset) - && Objects.equal(this.balance, other.balance) - && Objects.equal(this.limit, other.limit) - && Objects.equal(this.flags, other.flags) - && Objects.equal(this.ext, other.ext); + return Objects.equals(this.accountID, other.accountID) + && Objects.equals(this.asset, other.asset) + && Objects.equals(this.balance, other.balance) + && Objects.equals(this.limit, other.limit) + && Objects.equals(this.flags, other.flags) + && Objects.equals(this.ext, other.ext); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -171,8 +169,7 @@ public byte[] toXdrByteArray() throws IOException { } public static TrustLineEntry fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -311,7 +308,7 @@ public static TrustLineEntryExt decode(XdrDataInputStream stream) throws IOExcep @Override public int hashCode() { - return Objects.hashCode(this.v1, this.v); + return Objects.hash(this.v1, this.v); } @Override @@ -321,13 +318,12 @@ public boolean equals(Object object) { } TrustLineEntryExt other = (TrustLineEntryExt) object; - return Objects.equal(this.v1, other.v1) && Objects.equal(this.v, other.v); + return Objects.equals(this.v1, other.v1) && Objects.equals(this.v, other.v); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -339,8 +335,7 @@ public byte[] toXdrByteArray() throws IOException { } public static TrustLineEntryExt fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -392,7 +387,7 @@ public static TrustLineEntryV1 decode(XdrDataInputStream stream) throws IOExcept @Override public int hashCode() { - return Objects.hashCode(this.liabilities, this.ext); + return Objects.hash(this.liabilities, this.ext); } @Override @@ -402,14 +397,13 @@ public boolean equals(Object object) { } TrustLineEntryV1 other = (TrustLineEntryV1) object; - return Objects.equal(this.liabilities, other.liabilities) - && Objects.equal(this.ext, other.ext); + return Objects.equals(this.liabilities, other.liabilities) + && Objects.equals(this.ext, other.ext); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -421,8 +415,7 @@ public byte[] toXdrByteArray() throws IOException { } public static TrustLineEntryV1 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -534,7 +527,7 @@ public static TrustLineEntryV1Ext decode(XdrDataInputStream stream) throws IOExc @Override public int hashCode() { - return Objects.hashCode(this.v2, this.v); + return Objects.hash(this.v2, this.v); } @Override @@ -544,13 +537,12 @@ public boolean equals(Object object) { } TrustLineEntryV1Ext other = (TrustLineEntryV1Ext) object; - return Objects.equal(this.v2, other.v2) && Objects.equal(this.v, other.v); + return Objects.equals(this.v2, other.v2) && Objects.equals(this.v, other.v); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -562,8 +554,7 @@ public byte[] toXdrByteArray() throws IOException { } public static TrustLineEntryV1Ext fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/TrustLineEntryExtensionV2.java b/src/main/java/org/stellar/sdk/xdr/TrustLineEntryExtensionV2.java index 35ace927c..57f7b0e2c 100644 --- a/src/main/java/org/stellar/sdk/xdr/TrustLineEntryExtensionV2.java +++ b/src/main/java/org/stellar/sdk/xdr/TrustLineEntryExtensionV2.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -69,7 +69,7 @@ public static TrustLineEntryExtensionV2 decode(XdrDataInputStream stream) throws @Override public int hashCode() { - return Objects.hashCode(this.liquidityPoolUseCount, this.ext); + return Objects.hash(this.liquidityPoolUseCount, this.ext); } @Override @@ -79,14 +79,13 @@ public boolean equals(Object object) { } TrustLineEntryExtensionV2 other = (TrustLineEntryExtensionV2) object; - return Objects.equal(this.liquidityPoolUseCount, other.liquidityPoolUseCount) - && Objects.equal(this.ext, other.ext); + return Objects.equals(this.liquidityPoolUseCount, other.liquidityPoolUseCount) + && Objects.equals(this.ext, other.ext); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -98,8 +97,7 @@ public byte[] toXdrByteArray() throws IOException { } public static TrustLineEntryExtensionV2 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -191,7 +189,7 @@ public static TrustLineEntryExtensionV2Ext decode(XdrDataInputStream stream) @Override public int hashCode() { - return Objects.hashCode(this.v); + return Objects.hash(this.v); } @Override @@ -201,13 +199,12 @@ public boolean equals(Object object) { } TrustLineEntryExtensionV2Ext other = (TrustLineEntryExtensionV2Ext) object; - return Objects.equal(this.v, other.v); + return Objects.equals(this.v, other.v); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -219,8 +216,7 @@ public byte[] toXdrByteArray() throws IOException { } public static TrustLineEntryExtensionV2Ext fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/TrustLineFlags.java b/src/main/java/org/stellar/sdk/xdr/TrustLineFlags.java index 4e3c5698c..78df565f5 100644 --- a/src/main/java/org/stellar/sdk/xdr/TrustLineFlags.java +++ b/src/main/java/org/stellar/sdk/xdr/TrustLineFlags.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -64,8 +64,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -77,8 +76,7 @@ public byte[] toXdrByteArray() throws IOException { } public static TrustLineFlags fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/TxAdvertVector.java b/src/main/java/org/stellar/sdk/xdr/TxAdvertVector.java index 342600868..347eae01b 100644 --- a/src/main/java/org/stellar/sdk/xdr/TxAdvertVector.java +++ b/src/main/java/org/stellar/sdk/xdr/TxAdvertVector.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; // === xdr source ============================================================ @@ -73,8 +73,7 @@ public boolean equals(Object object) { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -86,8 +85,7 @@ public byte[] toXdrByteArray() throws IOException { } public static TxAdvertVector fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/TxDemandVector.java b/src/main/java/org/stellar/sdk/xdr/TxDemandVector.java index 43b3a5b06..7d7d9f989 100644 --- a/src/main/java/org/stellar/sdk/xdr/TxDemandVector.java +++ b/src/main/java/org/stellar/sdk/xdr/TxDemandVector.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; // === xdr source ============================================================ @@ -73,8 +73,7 @@ public boolean equals(Object object) { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -86,8 +85,7 @@ public byte[] toXdrByteArray() throws IOException { } public static TxDemandVector fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/TxSetComponent.java b/src/main/java/org/stellar/sdk/xdr/TxSetComponent.java index 192a9a0e5..ea7cf8189 100644 --- a/src/main/java/org/stellar/sdk/xdr/TxSetComponent.java +++ b/src/main/java/org/stellar/sdk/xdr/TxSetComponent.java @@ -5,12 +5,12 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -103,7 +103,7 @@ public static TxSetComponent decode(XdrDataInputStream stream) throws IOExceptio @Override public int hashCode() { - return Objects.hashCode(this.txsMaybeDiscountedFee, this.type); + return Objects.hash(this.txsMaybeDiscountedFee, this.type); } @Override @@ -113,14 +113,13 @@ public boolean equals(Object object) { } TxSetComponent other = (TxSetComponent) object; - return Objects.equal(this.txsMaybeDiscountedFee, other.txsMaybeDiscountedFee) - && Objects.equal(this.type, other.type); + return Objects.equals(this.txsMaybeDiscountedFee, other.txsMaybeDiscountedFee) + && Objects.equals(this.type, other.type); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -132,8 +131,7 @@ public byte[] toXdrByteArray() throws IOException { } public static TxSetComponent fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -205,7 +203,7 @@ public static TxSetComponentTxsMaybeDiscountedFee decode(XdrDataInputStream stre @Override public int hashCode() { - return Objects.hashCode(this.baseFee, Arrays.hashCode(this.txs)); + return Objects.hash(this.baseFee, Arrays.hashCode(this.txs)); } @Override @@ -215,13 +213,12 @@ public boolean equals(Object object) { } TxSetComponentTxsMaybeDiscountedFee other = (TxSetComponentTxsMaybeDiscountedFee) object; - return Objects.equal(this.baseFee, other.baseFee) && Arrays.equals(this.txs, other.txs); + return Objects.equals(this.baseFee, other.baseFee) && Arrays.equals(this.txs, other.txs); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -233,8 +230,7 @@ public byte[] toXdrByteArray() throws IOException { } public static TxSetComponentTxsMaybeDiscountedFee fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/TxSetComponentType.java b/src/main/java/org/stellar/sdk/xdr/TxSetComponentType.java index 9c9d2e49d..840db4bb7 100644 --- a/src/main/java/org/stellar/sdk/xdr/TxSetComponentType.java +++ b/src/main/java/org/stellar/sdk/xdr/TxSetComponentType.java @@ -5,10 +5,10 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; // === xdr source ============================================================ @@ -54,8 +54,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -67,8 +66,7 @@ public byte[] toXdrByteArray() throws IOException { } public static TxSetComponentType fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/UInt128Parts.java b/src/main/java/org/stellar/sdk/xdr/UInt128Parts.java index 1b3d039f7..e5516d05d 100644 --- a/src/main/java/org/stellar/sdk/xdr/UInt128Parts.java +++ b/src/main/java/org/stellar/sdk/xdr/UInt128Parts.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -61,7 +61,7 @@ public static UInt128Parts decode(XdrDataInputStream stream) throws IOException @Override public int hashCode() { - return Objects.hashCode(this.hi, this.lo); + return Objects.hash(this.hi, this.lo); } @Override @@ -71,13 +71,12 @@ public boolean equals(Object object) { } UInt128Parts other = (UInt128Parts) object; - return Objects.equal(this.hi, other.hi) && Objects.equal(this.lo, other.lo); + return Objects.equals(this.hi, other.hi) && Objects.equals(this.lo, other.lo); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -89,8 +88,7 @@ public byte[] toXdrByteArray() throws IOException { } public static UInt128Parts fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/UInt256Parts.java b/src/main/java/org/stellar/sdk/xdr/UInt256Parts.java index 8f8395708..2b97e6a47 100644 --- a/src/main/java/org/stellar/sdk/xdr/UInt256Parts.java +++ b/src/main/java/org/stellar/sdk/xdr/UInt256Parts.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -87,7 +87,7 @@ public static UInt256Parts decode(XdrDataInputStream stream) throws IOException @Override public int hashCode() { - return Objects.hashCode(this.hi_hi, this.hi_lo, this.lo_hi, this.lo_lo); + return Objects.hash(this.hi_hi, this.hi_lo, this.lo_hi, this.lo_lo); } @Override @@ -97,16 +97,15 @@ public boolean equals(Object object) { } UInt256Parts other = (UInt256Parts) object; - return Objects.equal(this.hi_hi, other.hi_hi) - && Objects.equal(this.hi_lo, other.hi_lo) - && Objects.equal(this.lo_hi, other.lo_hi) - && Objects.equal(this.lo_lo, other.lo_lo); + return Objects.equals(this.hi_hi, other.hi_hi) + && Objects.equals(this.hi_lo, other.hi_lo) + && Objects.equals(this.lo_hi, other.lo_hi) + && Objects.equals(this.lo_lo, other.lo_lo); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -118,8 +117,7 @@ public byte[] toXdrByteArray() throws IOException { } public static UInt256Parts fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/Uint256.java b/src/main/java/org/stellar/sdk/xdr/Uint256.java index a2ae110cc..bc6dd91af 100644 --- a/src/main/java/org/stellar/sdk/xdr/Uint256.java +++ b/src/main/java/org/stellar/sdk/xdr/Uint256.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; // === xdr source ============================================================ @@ -67,8 +67,7 @@ public boolean equals(Object object) { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -80,8 +79,7 @@ public byte[] toXdrByteArray() throws IOException { } public static Uint256 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/Uint32.java b/src/main/java/org/stellar/sdk/xdr/Uint32.java index 3ebbdd803..fc29d318f 100644 --- a/src/main/java/org/stellar/sdk/xdr/Uint32.java +++ b/src/main/java/org/stellar/sdk/xdr/Uint32.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -49,7 +49,7 @@ public static Uint32 decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.uint32); + return Objects.hash(this.uint32); } @Override @@ -59,13 +59,12 @@ public boolean equals(Object object) { } Uint32 other = (Uint32) object; - return Objects.equal(this.uint32, other.uint32); + return Objects.equals(this.uint32, other.uint32); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -77,8 +76,7 @@ public byte[] toXdrByteArray() throws IOException { } public static Uint32 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/Uint64.java b/src/main/java/org/stellar/sdk/xdr/Uint64.java index 698c44ecc..c12f13fbb 100644 --- a/src/main/java/org/stellar/sdk/xdr/Uint64.java +++ b/src/main/java/org/stellar/sdk/xdr/Uint64.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -49,7 +49,7 @@ public static Uint64 decode(XdrDataInputStream stream) throws IOException { @Override public int hashCode() { - return Objects.hashCode(this.uint64); + return Objects.hash(this.uint64); } @Override @@ -59,13 +59,12 @@ public boolean equals(Object object) { } Uint64 other = (Uint64) object; - return Objects.equal(this.uint64, other.uint64); + return Objects.equals(this.uint64, other.uint64); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -77,8 +76,7 @@ public byte[] toXdrByteArray() throws IOException { } public static Uint64 fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/UpgradeEntryMeta.java b/src/main/java/org/stellar/sdk/xdr/UpgradeEntryMeta.java index d85a4b994..a690af049 100644 --- a/src/main/java/org/stellar/sdk/xdr/UpgradeEntryMeta.java +++ b/src/main/java/org/stellar/sdk/xdr/UpgradeEntryMeta.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; // === xdr source ============================================================ @@ -62,7 +62,7 @@ public static UpgradeEntryMeta decode(XdrDataInputStream stream) throws IOExcept @Override public int hashCode() { - return Objects.hashCode(this.upgrade, this.changes); + return Objects.hash(this.upgrade, this.changes); } @Override @@ -72,13 +72,13 @@ public boolean equals(Object object) { } UpgradeEntryMeta other = (UpgradeEntryMeta) object; - return Objects.equal(this.upgrade, other.upgrade) && Objects.equal(this.changes, other.changes); + return Objects.equals(this.upgrade, other.upgrade) + && Objects.equals(this.changes, other.changes); } @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -90,8 +90,7 @@ public byte[] toXdrByteArray() throws IOException { } public static UpgradeEntryMeta fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/UpgradeType.java b/src/main/java/org/stellar/sdk/xdr/UpgradeType.java index 16a090c60..8acd939b1 100644 --- a/src/main/java/org/stellar/sdk/xdr/UpgradeType.java +++ b/src/main/java/org/stellar/sdk/xdr/UpgradeType.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; // === xdr source ============================================================ @@ -69,8 +69,7 @@ public boolean equals(Object object) { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -82,8 +81,7 @@ public byte[] toXdrByteArray() throws IOException { } public static UpgradeType fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/Value.java b/src/main/java/org/stellar/sdk/xdr/Value.java index 86c1b6d04..850f27806 100644 --- a/src/main/java/org/stellar/sdk/xdr/Value.java +++ b/src/main/java/org/stellar/sdk/xdr/Value.java @@ -5,11 +5,11 @@ import static org.stellar.sdk.xdr.Constants.*; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Arrays; +import java.util.Base64; // === xdr source ============================================================ @@ -68,8 +68,7 @@ public boolean equals(Object object) { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -81,8 +80,7 @@ public byte[] toXdrByteArray() throws IOException { } public static Value fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } diff --git a/src/main/java/org/stellar/sdk/xdr/XdrString.java b/src/main/java/org/stellar/sdk/xdr/XdrString.java index df1bdea8b..3320d5bce 100644 --- a/src/main/java/org/stellar/sdk/xdr/XdrString.java +++ b/src/main/java/org/stellar/sdk/xdr/XdrString.java @@ -1,12 +1,12 @@ package org.stellar.sdk.xdr; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InvalidClassException; import java.nio.charset.Charset; import java.util.Arrays; +import java.util.Base64; public class XdrString implements XdrElement { private byte[] bytes; @@ -41,8 +41,7 @@ public byte[] getBytes() { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -54,8 +53,7 @@ public byte[] toXdrByteArray() throws IOException { } public static XdrString fromXdrBase64(String xdr, int maxSize) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes, maxSize); } diff --git a/src/main/java/org/stellar/sdk/xdr/XdrUnsignedHyperInteger.java b/src/main/java/org/stellar/sdk/xdr/XdrUnsignedHyperInteger.java index ada4b6e31..4c570cc4b 100644 --- a/src/main/java/org/stellar/sdk/xdr/XdrUnsignedHyperInteger.java +++ b/src/main/java/org/stellar/sdk/xdr/XdrUnsignedHyperInteger.java @@ -1,11 +1,11 @@ package org.stellar.sdk.xdr; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.math.BigInteger; +import java.util.Base64; +import java.util.Objects; /** * Represents XDR Unsigned Hyper Integer. @@ -61,8 +61,7 @@ public BigInteger getNumber() { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -74,8 +73,7 @@ public byte[] toXdrByteArray() throws IOException { } public static XdrUnsignedHyperInteger fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -87,7 +85,7 @@ public static XdrUnsignedHyperInteger fromXdrByteArray(byte[] xdr) throws IOExce @Override public int hashCode() { - return Objects.hashCode(this.number); + return Objects.hash(this.number); } @Override @@ -97,7 +95,7 @@ public boolean equals(Object object) { } XdrUnsignedHyperInteger other = (XdrUnsignedHyperInteger) object; - return Objects.equal(this.number, other.number); + return Objects.equals(this.number, other.number); } public String toString() { diff --git a/src/main/java/org/stellar/sdk/xdr/XdrUnsignedInteger.java b/src/main/java/org/stellar/sdk/xdr/XdrUnsignedInteger.java index 37c5c3cf9..a3b037db6 100644 --- a/src/main/java/org/stellar/sdk/xdr/XdrUnsignedInteger.java +++ b/src/main/java/org/stellar/sdk/xdr/XdrUnsignedInteger.java @@ -1,10 +1,10 @@ package org.stellar.sdk.xdr; -import com.google.common.base.Objects; -import com.google.common.io.BaseEncoding; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.util.Base64; +import java.util.Objects; /** * Represents XDR Unsigned Integer. @@ -49,8 +49,7 @@ public void encode(XdrDataOutputStream stream) throws IOException { @Override public String toXdrBase64() throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - return base64Encoding.encode(toXdrByteArray()); + return Base64.getEncoder().encodeToString(toXdrByteArray()); } @Override @@ -62,8 +61,7 @@ public byte[] toXdrByteArray() throws IOException { } public static XdrUnsignedInteger fromXdrBase64(String xdr) throws IOException { - BaseEncoding base64Encoding = BaseEncoding.base64(); - byte[] bytes = base64Encoding.decode(xdr); + byte[] bytes = Base64.getDecoder().decode(xdr); return fromXdrByteArray(bytes); } @@ -75,7 +73,7 @@ public static XdrUnsignedInteger fromXdrByteArray(byte[] xdr) throws IOException @Override public int hashCode() { - return Objects.hashCode(this.number); + return Objects.hash(this.number); } @Override @@ -85,7 +83,7 @@ public boolean equals(Object object) { } XdrUnsignedInteger other = (XdrUnsignedInteger) object; - return Objects.equal(this.number, other.number); + return Objects.equals(this.number, other.number); } public String toString() {