Interface Id<T extends Id>

  • Type Parameters:
    T - concrete implementation class, needed for typesafe implementation of compare interface
    All Superinterfaces:
    Comparable<T>
    All Known Implementing Classes:
    IdLong, IdString

    public interface Id<T extends Id>
    extends Comparable<T>
    the interface that all Id implementations need to implement.
    Author:
    scf, Michael Jacoby
    • Method Detail

      • tryToParse

        static Id tryToParse​(String input)
      • getValue

        Object getValue()
        Get the raw value of this Id.
        Returns:
        the raw value of this Id.
      • getUrl

        String getUrl()
        Get the value, formatted for use in a url. String values will be quoted with single quotes.
        Returns:
        the value, formatted for use in a url.
      • getJson

        String getJson()
        Get the value, formatted for inserting into a JSON document. In general, it is better to use a json mapper, and pass it the Object returned by getValue().
        Returns:
        the value, formatted for use in JSON.
      • writeTo

        void writeTo​(com.fasterxml.jackson.core.JsonGenerator gen)
              throws IOException
        Write the value to the given JsonGenerator.
        Parameters:
        gen - The JsonGenerator to write to.
        Throws:
        IOException - if the generator throws.