public final class Tag extends Object implements Named, Comparable<Tag>, Serializable
Note: Tags print with a leading hash, but this is not part of the tag's name:
// For the tag "#foo/bar"
Tag t = newTag("foo", "bar");
t.getName() => "bar"
t.getPrefix() => "foo"
t.toString() => "#foo/bar"
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Tag o) |
boolean |
equals(Object obj) |
String |
getName()
The name of this named thing, not including any prefix.
|
String |
getPrefix()
The prefix, (also called namespace), which may be empty.
|
int |
hashCode() |
static Tag |
newTag(String name)
This is equivalent to
newTag("", name). |
static Tag |
newTag(String prefix,
String name)
Provide a Tag with the given prefix and name.
|
static Tag |
newTag(Symbol sym)
Return a Tag with the same prefix and name as
sym. |
String |
toString() |
public final String getPrefix()
public final String getName()
public static Tag newTag(Symbol sym)
sym.sym - a Symbol, never nullsym.public static Tag newTag(String prefix, String name)
Bear in mind that tags with no prefix are reserved for use by the edn format itself.
prefix - An empty String or a non-empty String obeying the restrictions
specified by edn. Never null.name - A non-empty string obeying the restrictions specified by edn.
Never null.public static Tag newTag(String name)
newTag("", name).name - A non-empty string obeying the restrictions specified by edn.
Never null.newTag(String, String)public int compareTo(Tag o)
compareTo in interface Comparable<Tag>Copyright © 2019. All rights reserved.