Comparable<Position>, Positionpublic final class Key extends Object implements Position
| Modifier and Type | Method | Description |
|---|---|---|
Index |
asIndex() |
throws UnsupportedOperationException.
|
Key |
asKey() |
Returns this key.
|
int |
compareTo(Position o) |
compares this key with another given position.
|
boolean |
equals(@Nullable Object that) |
Returns true if that is a key and both have the same name.
|
int |
hashCode() |
Returns the hashcode of this key.
|
boolean |
isIndex() |
Returns false.
|
boolean |
isKey() |
Returns true.
|
static Key |
of(String key) |
Returns a new instance which represents a key with the given name in a json object.
|
String |
toString() |
Returns the name of the key.
|
public final String name
public static Key of(String key)
key - the given name of the keypublic int compareTo(Position o)
compareTo in interface Comparable<Position>compareTo in interface Positiono - the given positionpublic Key asKey()
public Index asIndex()
asIndex in interface PositionUnsupportedOperationException - a Key can't be casted into an Indexpublic boolean isIndex()
public String toString()
public boolean equals(@Nullable Object that)
Copyright © 2019. All rights reserved.