From b571cfec0adfc3f7d5433fb7540dfa9629d4acee Mon Sep 17 00:00:00 2001 From: ME1312 Date: Fri, 22 Oct 2021 11:37:47 -0400 Subject: [PATCH] Improvements to ObjectMap extendability --- .../net/ME1312/Galaxi/Library/Container/Pair.java | 3 ++- .../net/ME1312/Galaxi/Library/Container/Value.java | 1 + .../net/ME1312/Galaxi/Library/Map/ObjectMap.java | 14 +++++++------- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/GalaxiAPI/global/src/net/ME1312/Galaxi/Library/Container/Pair.java b/GalaxiAPI/global/src/net/ME1312/Galaxi/Library/Container/Pair.java index 058fdf3..e0bb39f 100644 --- a/GalaxiAPI/global/src/net/ME1312/Galaxi/Library/Container/Pair.java +++ b/GalaxiAPI/global/src/net/ME1312/Galaxi/Library/Container/Pair.java @@ -24,9 +24,10 @@ public abstract class Pair extends Value { @Override public String toString() { - return '[' + String.valueOf(key()) + ", " + String.valueOf(value()) + ')'; + return '[' + String.valueOf(key()) + ", " + super.toString() + ')'; } + @SuppressWarnings("rawtypes") @Override public boolean equals(Object object) { if (object instanceof Pair) { diff --git a/GalaxiAPI/global/src/net/ME1312/Galaxi/Library/Container/Value.java b/GalaxiAPI/global/src/net/ME1312/Galaxi/Library/Container/Value.java index 046877f..152f159 100644 --- a/GalaxiAPI/global/src/net/ME1312/Galaxi/Library/Container/Value.java +++ b/GalaxiAPI/global/src/net/ME1312/Galaxi/Library/Container/Value.java @@ -26,6 +26,7 @@ public String toString() { return String.valueOf(value()); } + @SuppressWarnings("rawtypes") @Override public boolean equals(Object object) { if (object instanceof Value) { diff --git a/GalaxiAPI/global/src/net/ME1312/Galaxi/Library/Map/ObjectMap.java b/GalaxiAPI/global/src/net/ME1312/Galaxi/Library/Map/ObjectMap.java index eaf6c01..1ac3e61 100644 --- a/GalaxiAPI/global/src/net/ME1312/Galaxi/Library/Map/ObjectMap.java +++ b/GalaxiAPI/global/src/net/ME1312/Galaxi/Library/Map/ObjectMap.java @@ -97,7 +97,7 @@ public Set getKeys() { * * @return Values */ - public Collection> getValues() { + public Collection> getValues() { return map.values(); } @@ -332,7 +332,7 @@ public ObjectMapValue get(K handle, ObjectMapValue def) { * @param handle Handle * @return Object */ - public List> getList(K handle) { + public List> getList(K handle) { if (Util.isNull(handle)) throw new NullPointerException(); return map.get(handle).asList(); } @@ -344,7 +344,7 @@ public List> getList(K handle) { * @param def Default * @return Object List */ - public List> getList(K handle, Collection def) { + public List> getList(K handle, Collection def) { if (Util.isNull(handle)) throw new NullPointerException(); if (map.get(handle) != null) { return getList(handle); @@ -364,7 +364,7 @@ public List> getList(K handle, Collection def) { * @param def Default * @return Object List */ - public List> getList(K handle, List> def) { + public List> getList(K handle, List> def) { if (Util.isNull(handle)) throw new NullPointerException(); if (map.get(handle) != null) { return getList(handle); @@ -500,7 +500,7 @@ public ObjectMap getMap(K handle, ObjectMap def) { * @param handle Handle * @return Object Map List */ - public List> getMapList(K handle) { + public List> getMapList(K handle) { return get(handle, x).asMapList(); } @@ -511,7 +511,7 @@ public List> getMapList(K handle) { * @param def Default * @return Object Map List */ - public List> getMapList(K handle, Collection> def) { + public List> getMapList(K handle, Collection> def) { return get(handle, def).asMapList(); } @@ -522,7 +522,7 @@ public List> getMapList(K handle, Collection> getMapList(K handle, List> def) { + public List> getMapList(K handle, List> def) { if (Util.isNull(handle)) throw new NullPointerException(); if (map.get(handle) != null) { return get(handle).asMapList();