public final class Key extends Object implements Position
Modifier and Type | Method and Description |
---|---|
Index |
asIndex()
throws an UserError exception.
|
Key |
asKey()
Returns this key.
|
int |
compareTo(Position o)
compares this key with another given position.
|
boolean |
equals(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>
o
- the given positionpublic Key asKey()
public Index asIndex()
public boolean isIndex()
public int hashCode()
public boolean equals(Object that)
Copyright © 2022. All rights reserved.