From c7b3f76981320805177bfb60d2d86f02234127cc Mon Sep 17 00:00:00 2001 From: Liam Date: Wed, 17 Apr 2024 21:22:33 +0100 Subject: [PATCH] give all models @ToString --- pom.xml | 2 +- .../xyz/mcutils/models/CachedResponse.java | 38 ++----------------- .../xyz/mcutils/models/dns/DNSRecord.java | 7 +--- .../mojang/CachedMojangEndpointStatus.java | 3 +- .../mcutils/models/player/CachedPlayer.java | 3 +- .../models/player/CachedPlayerSkinPart.java | 3 +- .../models/player/CachedUsernameToUuid.java | 3 +- .../java/xyz/mcutils/models/player/Cape.java | 5 +++ .../java/xyz/mcutils/models/player/Skin.java | 2 + 9 files changed, 21 insertions(+), 45 deletions(-) diff --git a/pom.xml b/pom.xml index b820fdd..e2506f9 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ xyz.mcutils mcutils-java-library - 1.0-SNAPSHOT + 1.1-SNAPSHOT 17 diff --git a/src/main/java/xyz/mcutils/models/CachedResponse.java b/src/main/java/xyz/mcutils/models/CachedResponse.java index 7cc1acb..4251875 100644 --- a/src/main/java/xyz/mcutils/models/CachedResponse.java +++ b/src/main/java/xyz/mcutils/models/CachedResponse.java @@ -1,9 +1,9 @@ package xyz.mcutils.models; -import lombok.AllArgsConstructor; import lombok.Getter; -import lombok.Setter; +import lombok.ToString; +@Getter @ToString public class CachedResponse { /** @@ -11,9 +11,7 @@ public class CachedResponse { */ private Cache cache; - @AllArgsConstructor - @Getter - @Setter + @Getter @ToString public static class Cache { /** * Whether this request is cached. @@ -24,35 +22,5 @@ public class CachedResponse { * The unix timestamp of when this was cached. */ private long cachedTime; - - /** - * Create a new cache information object with the default values. - *

- * The default values are: - *
- *

- *
- *

- * - * @return the default cache information object - */ - public static Cache defaultCache() { - return new Cache(true, System.currentTimeMillis()); - } - - /** - * Sets if this request is cached. - * - * @param cached the new value of if this request is cached - */ - public void setCached(boolean cached) { - this.cached = cached; - if (!cached) { - cachedTime = -1; - } - } } } diff --git a/src/main/java/xyz/mcutils/models/dns/DNSRecord.java b/src/main/java/xyz/mcutils/models/dns/DNSRecord.java index 026c379..5daf405 100644 --- a/src/main/java/xyz/mcutils/models/dns/DNSRecord.java +++ b/src/main/java/xyz/mcutils/models/dns/DNSRecord.java @@ -1,12 +1,9 @@ package xyz.mcutils.models.dns; import io.micrometer.common.lang.NonNull; -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import lombok.Setter; +import lombok.*; -@Setter @Getter +@Setter @Getter @ToString @NoArgsConstructor @AllArgsConstructor public class DNSRecord { /** diff --git a/src/main/java/xyz/mcutils/models/mojang/CachedMojangEndpointStatus.java b/src/main/java/xyz/mcutils/models/mojang/CachedMojangEndpointStatus.java index c7c5ef1..3737cf8 100644 --- a/src/main/java/xyz/mcutils/models/mojang/CachedMojangEndpointStatus.java +++ b/src/main/java/xyz/mcutils/models/mojang/CachedMojangEndpointStatus.java @@ -2,12 +2,13 @@ package xyz.mcutils.models.mojang; import lombok.AllArgsConstructor; import lombok.Getter; +import lombok.ToString; import xyz.mcutils.models.CachedResponse; import java.util.Map; @AllArgsConstructor -@Getter +@Getter @ToString public class CachedMojangEndpointStatus extends CachedResponse { /** diff --git a/src/main/java/xyz/mcutils/models/player/CachedPlayer.java b/src/main/java/xyz/mcutils/models/player/CachedPlayer.java index 55329bf..93fd358 100644 --- a/src/main/java/xyz/mcutils/models/player/CachedPlayer.java +++ b/src/main/java/xyz/mcutils/models/player/CachedPlayer.java @@ -1,11 +1,12 @@ package xyz.mcutils.models.player; import lombok.Getter; +import lombok.ToString; import xyz.mcutils.models.CachedResponse; import java.util.UUID; -@Getter +@Getter @ToString public class CachedPlayer extends CachedResponse { /** diff --git a/src/main/java/xyz/mcutils/models/player/CachedPlayerSkinPart.java b/src/main/java/xyz/mcutils/models/player/CachedPlayerSkinPart.java index 3a0ce2d..098812a 100644 --- a/src/main/java/xyz/mcutils/models/player/CachedPlayerSkinPart.java +++ b/src/main/java/xyz/mcutils/models/player/CachedPlayerSkinPart.java @@ -2,8 +2,9 @@ package xyz.mcutils.models.player; import lombok.AllArgsConstructor; import lombok.Getter; +import lombok.ToString; -@AllArgsConstructor @Getter +@AllArgsConstructor @Getter @ToString public class CachedPlayerSkinPart { /** * The bytes for the skin part diff --git a/src/main/java/xyz/mcutils/models/player/CachedUsernameToUuid.java b/src/main/java/xyz/mcutils/models/player/CachedUsernameToUuid.java index ca08814..5a24f97 100644 --- a/src/main/java/xyz/mcutils/models/player/CachedUsernameToUuid.java +++ b/src/main/java/xyz/mcutils/models/player/CachedUsernameToUuid.java @@ -1,11 +1,12 @@ package xyz.mcutils.models.player; import lombok.Getter; +import lombok.ToString; import xyz.mcutils.models.CachedResponse; import java.util.UUID; -@Getter +@Getter @ToString public class CachedUsernameToUuid extends CachedResponse { /** * The username of the player. diff --git a/src/main/java/xyz/mcutils/models/player/Cape.java b/src/main/java/xyz/mcutils/models/player/Cape.java index bfafc7a..5552b07 100644 --- a/src/main/java/xyz/mcutils/models/player/Cape.java +++ b/src/main/java/xyz/mcutils/models/player/Cape.java @@ -1,5 +1,10 @@ package xyz.mcutils.models.player; +import lombok.Getter; +import lombok.ToString; + +@Getter +@ToString public class Cape { /** * The URL of the cape diff --git a/src/main/java/xyz/mcutils/models/player/Skin.java b/src/main/java/xyz/mcutils/models/player/Skin.java index e709c71..8fc4129 100644 --- a/src/main/java/xyz/mcutils/models/player/Skin.java +++ b/src/main/java/xyz/mcutils/models/player/Skin.java @@ -2,10 +2,12 @@ package xyz.mcutils.models.player; import lombok.AllArgsConstructor; import lombok.Getter; +import lombok.ToString; import java.util.HashMap; import java.util.Map; +@Getter @ToString public class Skin { /** * The URL for the skin