Package de.fraunhofer.iosb.ilt.sta.model
Interface Id<T extends Id>
-
- Type Parameters:
T- concrete implementation class, needed for typesafe implementation of compare interface
- All Superinterfaces:
Comparable<T>
public interface Id<T extends Id> extends Comparable<T>
the interface that all Id implementations need to implement.- Author:
- scf, Michael Jacoby
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetJson()Get the value, formatted for inserting into a JSON document.StringgetUrl()Get the value, formatted for use in a url.ObjectgetValue()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 Detail
-
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 IOExceptionWrite the value to the given JsonGenerator.- Parameters:
gen- The JsonGenerator to write to.- Throws:
IOException- if the generator throws.
-
-