Interface Id<T extends Id>
- Type Parameters:
T- concrete implementation class, needed for typesafe implementation of compare interface
- All Superinterfaces:
Comparable<T>
the interface that all Id implementations need to implement.
-
Method Summary
Modifier and TypeMethodDescriptiongetJson()Get the value, formatted for inserting into a JSON document.getUrl()Get the value, formatted for use in a url.getValue()Get the raw value of this Id.static IdtryToParse(String input) voidwriteTo(com.fasterxml.jackson.core.JsonGenerator gen) Write the value to the given JsonGenerator.Methods inherited from interface java.lang.Comparable
compareTo
-
Method Details
-
tryToParse
-
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
Write the value to the given JsonGenerator.- Parameters:
gen- The JsonGenerator to write to.- Throws:
IOException- if the generator throws.
-