java.lang.Object
de.fraunhofer.iosb.ilt.frostclient.model.IdString
All Implemented Interfaces:
Id<IdString>, Comparable<IdString>

public class IdString extends Object implements Id<IdString>
An Id implementation using String values.
  • Constructor Details

    • IdString

      public IdString()
    • IdString

      public IdString(String value)
  • Method Details

    • getValue

      public Object getValue()
      Description copied from interface: Id
      Get the raw value of this Id.
      Specified by:
      getValue in interface Id<IdString>
      Returns:
      the raw value of this Id.
    • getUrl

      public String getUrl()
      Description copied from interface: Id
      Get the value, formatted for use in a url. String values will be quoted with single quotes.
      Specified by:
      getUrl in interface Id<IdString>
      Returns:
      the value, formatted for use in a url.
    • getJson

      public String getJson()
      Description copied from interface: Id
      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().
      Specified by:
      getJson in interface Id<IdString>
      Returns:
      the value, formatted for use in JSON.
    • writeTo

      public void writeTo(com.fasterxml.jackson.core.JsonGenerator gen) throws IOException
      Description copied from interface: Id
      Write the value to the given JsonGenerator.
      Specified by:
      writeTo in interface Id<IdString>
      Parameters:
      gen - The JsonGenerator to write to.
      Throws:
      IOException - if the generator throws.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

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

      public int compareTo(IdString o)
      Specified by:
      compareTo in interface Comparable<IdString>