Documentation of 'us.bpsm.edn.Keyword' Java class
Keyword
us.bpsm.edn

Class Keyword

  • All Implemented Interfaces:
    java.lang.Comparable<Keyword>, Named


    public final class Keyword
    extends java.lang.Object
    implements Named, java.lang.Comparable<Keyword>
    A Keyword is Named. Additionally it obeys the syntactic restrictions defined for edn Keywords.

    Note: Keywords print with a leading colon, but this is not part of the keyword's name:

      // For the keyword ":foo/bar"
     Keyword k = newKeyword("foo", "bar");
     k.getName()   => "bar"
     k.getPrefix() => "foo"
     k.toString()  => ":foo/bar"
     
    • Field Summary

      • Fields inherited from interface us.bpsm.edn.Named

        EMPTY
    • Method Detail

      • getPrefix

        public final java.lang.String getPrefix()
        The prefix, (also called namespace), which may be empty. A Named object with an empty prefix is said to have no prefix.
        Specified by:
        getPrefix in interface Named
        Returns:
        a possibly empty string; never null.
      • getName

        public final java.lang.String getName()
        The name of this named thing, not including any prefix.
        Specified by:
        getName in interface Named
        Returns:
        a non-empty string.
      • newKeyword

        public static Keyword newKeyword(java.lang.String prefix,
                                         java.lang.String name)
        Provide a Keyword with the given prefix and name.

        Keywords are interned, which means that any two keywords which are equal (by value) will also be identical (by reference).

        Parameters:
        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.
        Returns:
        a Keyword, never null.
      • newKeyword

        public static Keyword newKeyword(java.lang.String name)
        This is equivalent to newKeyword("", name).
        Parameters:
        name - A non-empty string obeying the restrictions specified by edn. Never null.
        Returns:
        a Keyword without a prefix, never null.
        See Also:
        newKeyword(String, String)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • compareTo

        public int compareTo(Keyword o)
        Specified by:
        compareTo in interface java.lang.Comparable<Keyword>

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.