Skip to content

Commit c625605

Browse files
committed
chore: add back dropped toString implementations
1 parent e2f7a35 commit c625605

File tree

5 files changed

+54
-0
lines changed

5 files changed

+54
-0
lines changed

api/src/main/java/net/kyori/adventure/sound/SoundImpl.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,17 @@ public int hashCode() {
100100
return result;
101101
}
102102

103+
@Override
104+
public String toString() {
105+
return "SoundImpl{" +
106+
"name=" + this.name() +
107+
", source=" + this.source +
108+
", volume=" + this.volume +
109+
", pitch=" + this.pitch +
110+
", seed=" + this.seed +
111+
'}';
112+
}
113+
103114
static final class BuilderImpl implements Builder {
104115
private static final float DEFAULT_VOLUME = 1f;
105116
private static final float DEFAULT_PITCH = 1f;

api/src/main/java/net/kyori/adventure/text/format/DecorationMap.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,16 @@ public int hashCode() {
200200
return this.bitSet;
201201
}
202202

203+
@Override
204+
public String toString() {
205+
return "DecorationMap{" +
206+
Arrays.stream(DECORATIONS)
207+
.map(decoration -> decoration.toString() + '=' + this.get(decoration))
208+
.reduce((a, b) -> a + ", " + b)
209+
.orElse("") +
210+
'}';
211+
}
212+
203213
final class EntrySet extends AbstractSet<Entry<TextDecoration, TextDecoration.State>> {
204214
@Override
205215
public Iterator<Entry<TextDecoration, TextDecoration.State>> iterator() {

api/src/main/java/net/kyori/adventure/translation/AbstractTranslationStore.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,15 @@ public final int hashCode() {
163163
return this.name.hashCode();
164164
}
165165

166+
@Override
167+
public String toString() {
168+
return "AbstractTranslationStore{" +
169+
"name=" + this.name +
170+
", translations=" + this.translations +
171+
", defaultLocale=" + this.defaultLocale +
172+
'}';
173+
}
174+
166175
private final class Translation {
167176
private final String key;
168177
private final Map<Locale, T> translations;
@@ -203,6 +212,14 @@ public boolean equals(final Object other) {
203212
public int hashCode() {
204213
return Objects.hash(this.key, this.translations);
205214
}
215+
216+
@Override
217+
public String toString() {
218+
return "Translation{" +
219+
"key='" + this.key + '\'' +
220+
", translations=" + this.translations +
221+
'}';
222+
}
206223
}
207224

208225
/**

api/src/main/java/net/kyori/adventure/translation/GlobalTranslatorImpl.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,11 @@ public boolean canTranslate(final String key, final Locale locale) {
108108
}
109109
return null;
110110
}
111+
112+
@Override
113+
public String toString() {
114+
return "GlobalTranslatorImpl{" +
115+
"sources=" + this.sources +
116+
'}';
117+
}
111118
}

text-serializer-legacy/src/main/java/net/kyori/adventure/text/serializer/legacy/LegacyFormat.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,13 @@ public int hashCode() {
111111
result = (31 * result) + Boolean.hashCode(this.reset);
112112
return result;
113113
}
114+
115+
@Override
116+
public String toString() {
117+
return "LegacyFormat{" +
118+
"color=" + this.color +
119+
", decoration=" + this.decoration +
120+
", reset=" + this.reset +
121+
'}';
122+
}
114123
}

0 commit comments

Comments
 (0)