java.lang.Object
com.github.startsmercury.simply.no.shading.util.storage.PathStorage<T>
Type Parameters:
T - the supported type for storing
All Implemented Interfaces:
Storage<T>
Direct Known Subclasses:
JsonPathStorage

public abstract class PathStorage<T> extends Object implements Storage<T>
A PathStorage is an abstract implementation of Storage that will act as a base for states accessed with Java NIO. This class overrides the equals(Object), hashCode(), and toString(), where getPath() is used instead of a direct field access; null returns from the aforementioned #getPath() is properly taken care of.
Since:
6.0.0
  • Constructor Details

    • PathStorage

      protected PathStorage(Path path)
      Creates a new PathStorage with the assigned path to where states are read and written into.
      Parameters:
      path - the assigned path to where states are read and written into
      Implementation Note:
      It is the responsibility of implementing classes, when overriding, in handling null as a parameter.
  • Method Details

    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getPath

      public Path getPath()
      Returns the assigned path to where states are read and written into.
      Returns:
      the assigned path to where states are read and written into
      Implementation Note:
      It is the responsibility of implementing classes, when overriding, in handling nulls .
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object