|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.github.fge.jsonschema.core.tree.key.SchemaKey
@ParametersAreNonnullByDefault public abstract class SchemaKey
Base class for a schema identifier, or "key"
This package offers two ways to load a schema: either directly (that is,
from a JsonNode) or via a URI. The implementation considers that
schemas loaded via the first mechanism are anonymous (that is, they have no
associated URI).
Depending on which of the two ways above you use, a SchemaTree
will be identified either by an AnonymousSchemaKey (using anonymousKey()) or a JsonRefSchemaKey (using forJsonRef(JsonRef)).
| Field Summary | |
|---|---|
protected JsonRef |
loadingRef
|
| Constructor Summary | |
|---|---|
protected |
SchemaKey(JsonRef loadingRef)
|
| Method Summary | |
|---|---|
static SchemaKey |
anonymousKey()
Generate an anonymous key for a SchemaTree |
abstract boolean |
equals(Object obj)
|
static SchemaKey |
forJsonRef(JsonRef ref)
Generate a key for a schema loaded from a JSON Reference |
abstract long |
getId()
Get the identifier, as a long, for this schema -- DO NOT USE DIRECTLY |
JsonRef |
getLoadingRef()
Get the loading URI (as a JSON Reference) for that key |
abstract int |
hashCode()
|
abstract String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final JsonRef loadingRef
| Constructor Detail |
|---|
protected SchemaKey(JsonRef loadingRef)
| Method Detail |
|---|
public static SchemaKey anonymousKey()
SchemaTree
The key is uniquely identified by a long identifier; values
are picked from an AtomicLong.
Note: this means that two identical JSON Schemas loaded anonymously at different points in time (or different threads) will not be considered equal.
public static SchemaKey forJsonRef(@Untainted
JsonRef ref)
JSON Reference
ref - the JSON Reference
URIDownloaderpublic abstract long getId()
Important: this method is here only for backwards
compatibility reasons (see SchemaTree.getId()); you should not
be using it as a reliable identifier, since for all non anonymous
schema keys (ie, instances of JsonRefSchemaKey), this will return
0L.
public final JsonRef getLoadingRef()
JSON Reference) for that key
Important: this method only works reliably for non
anonymous schemas; for anonymous schemas, it will always return JsonRef.emptyRef(). As such, you should not use it directly.
public abstract int hashCode()
hashCode in class Object
public abstract boolean equals(@Nullable
Object obj)
equals in class Object@Nonnull public abstract String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||