package net.knarcraft.minigames.container; import org.bukkit.configuration.serialization.ConfigurationSerializable; /** * A container that is serializable * * @param

The type of the contained object

*/ public abstract class SerializableContainer implements ConfigurationSerializable { private final K value; /** * Instantiates a new serializable container * * @param value

The value to contain

*/ public SerializableContainer(K value) { this.value = value; } /** * Gets the raw, non-serializable object * * @return

The raw stored value

*/ public K getRawValue() { return value; } /** * Gets a serializable container containing the given value * * @param value

The value to make serializable

* @return

The serializable value

*/ public abstract SerializableContainer getSerializable(K value); @Override public boolean equals(Object object) { if (object instanceof SerializableContainer) { return this.getRawValue().equals(((SerializableContainer) object).getRawValue()); } else { return false; } } }