T - the supported type for storingpublic abstract class PathStorage<T> extends java.lang.Object implements Storage<T>
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.| Modifier | Constructor and Description |
|---|---|
protected |
PathStorage(java.nio.file.Path path)
Creates a new
PathStorage with the assigned path to where states are
read and written into. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
java.nio.file.Path |
getPath()
Returns the assigned path to where states are read and written into.
|
int |
hashCode() |
java.lang.String |
toString() |
protected PathStorage(java.nio.file.Path path)
PathStorage with the assigned path to where states are
read and written into.path - the assigned path to where states are read and written intonull as a parameter.public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.nio.file.Path getPath()
nulls .public int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object