diff options
author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2019-12-30 01:48:09 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-30 01:48:09 +0000 |
commit | 5af823e80a611090216375fecd3794d345446830 (patch) | |
tree | c54a19977b4a25cb86f54394eb9711aaf268efe3 /src/Java/gtPlusPlus/api/objects/data/FlexiblePair.java | |
parent | a731e939c6b9a70ac9fd444dbf06243f63f29c06 (diff) | |
parent | cc825179dce70a5f2c4a13730639e3300243e21a (diff) | |
download | GT5-Unofficial-5af823e80a611090216375fecd3794d345446830.tar.gz GT5-Unofficial-5af823e80a611090216375fecd3794d345446830.tar.bz2 GT5-Unofficial-5af823e80a611090216375fecd3794d345446830.zip |
Merge pull request #525 from alkcorp/DevTop
+ 6 Months of work, let's get the ball rolling.
Diffstat (limited to 'src/Java/gtPlusPlus/api/objects/data/FlexiblePair.java')
-rw-r--r-- | src/Java/gtPlusPlus/api/objects/data/FlexiblePair.java | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/Java/gtPlusPlus/api/objects/data/FlexiblePair.java b/src/Java/gtPlusPlus/api/objects/data/FlexiblePair.java new file mode 100644 index 0000000000..64f57b4e5a --- /dev/null +++ b/src/Java/gtPlusPlus/api/objects/data/FlexiblePair.java @@ -0,0 +1,39 @@ +package gtPlusPlus.api.objects.data; + +import java.io.Serializable; + +import com.google.common.base.Objects; + +public class FlexiblePair<K,V> implements Serializable { + + /** + * SVUID + */ + private static final long serialVersionUID = 1250550491092812443L; + private final K key; + private V value; + + public FlexiblePair(final K key, final V value){ + this.key = key; + this.value = value; + } + + final public K getKey(){ + return this.key; + } + + final public V getValue(){ + return this.value; + } + + final public void setValue(V aObj) { + value = aObj; + } + + @Override + public int hashCode() { + Integer aCode = Objects.hashCode(getKey(), getValue()); + return aCode != null ? aCode : super.hashCode(); + } + +}
\ No newline at end of file |