| Constructor and Description |
|---|
SingleKeyRoute(Object key)
Constructs a route from the given non-null key.
|
| Modifier and Type | Method and Description |
|---|---|
Route |
add(Object key)
Adds the given
non-null key to the route and returns the new object. |
boolean |
equals(Object o) |
Object |
get(int i)
Returns key at the given index.
|
int |
hashCode() |
String |
join(char separator)
Joins the route's keys with the given separator.
|
int |
length()
Returns the length of the route (backing array) - amount of keys forming the route.
|
Route |
parent()
Returns the parent route of this one.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitaddTo, from, from, fromSingleKey, fromString, fromString, fromStringpublic SingleKeyRoute(@NotNull
Object key)
As indicated, the given key cannot be null. Such attempt will result in a NullPointerException.
key - the single key in the routeimplementation information@NotNull public String join(char separator)
Routepublic int length()
Route@NotNull public Object get(int i)
Routelength.@NotNull public Route parent()
Route
Per documentation of Route.from(Object...), invoking this method if
will throw an Route.length() == 1IllegalArgumentException.
@NotNull public Route add(@NotNull Object key)
Routenon-null key to the route and returns the new object. The given key must be
immutable; if this cannot be achieved, it is required that the caller never modifies it.
For example, if you add key 1 to route ["a", "b"], the resulting route will be
represented by ["a", "b", 1].
More formally, copies this route's backing array (keys), adds the given key at the end and returns the new route.
public boolean equals(Object o)
public int hashCode()
Copyright © 2022. All rights reserved.