Add GlobalRegionData

This commit is contained in:
2025-12-19 12:02:32 +01:00
parent 7cee11a1ef
commit 5958befced
3 changed files with 72 additions and 4 deletions
@@ -109,9 +109,14 @@ public abstract class RegionData {
@Override
public final String toString() {
return getClass().getSimpleName() + "{" +
"flagMap=" + flagMap +
'}';
StringBuilder st = new StringBuilder();
st.append(getClass().getSimpleName()).append("{");
st.append("flagMap=").append(flagMap);
for (Property<?, ?> p : properties) {
st.append(p);
}
st.append("}");
return st.toString();
}
private final class Property<T, K> {
@@ -148,5 +153,12 @@ public abstract class RegionData {
flagData.put(field, writer.apply(value));
}
}
@Override
public String toString() {
Object value = this.value;
if (value != null) value = writer.apply((T) value);
return ", " + field + "=" + value;
}
}
}