|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.hpi.fgis.dude.util.data.DuDeObjectId
public class DuDeObjectId
DuDeObjectId
encapsulates the identifying information of each DuDeObject
.
Field Summary | |
---|---|
static String |
OBJECT_ID_ATTRIBUTE_NAME
The attribute name of the object id within the Json representation of this DuDeObject . |
static String |
SOURCE_ID_ATTRIBUTE_NAME
The attribute name of the source id within the Json representation of this DuDeObject . |
Constructor Summary | |
---|---|
DuDeObjectId()
Initializes an invalid DuDeObjectId . |
|
DuDeObjectId(String srcId,
JsonArray objId)
Initializes a DuDeObjectId with the passed identifiers. |
Method Summary | |
---|---|
int |
compareTo(DuDeObjectId other)
|
boolean |
equals(Object obj)
|
void |
fromJson(DuDeJsonParser<?> jsonParser)
Initializes the current instance using the passed DuDeJsonParser . |
boolean |
fromSameSource(DuDeObjectId other)
Checks if the passed id has the same source information. |
JsonArray |
getObjectId()
Returns the object identifier. |
String |
getSourceId()
Returns the source identifier. |
int |
hashCode()
|
boolean |
isValid()
Checks if the id is valid. |
void |
toJson(DuDeJsonGenerator jsonGenerator)
Generates the Json code using the passed DuDeJsonGenerator . |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String OBJECT_ID_ATTRIBUTE_NAME
DuDeObject
.
public static final String SOURCE_ID_ATTRIBUTE_NAME
DuDeObject
.
Constructor Detail |
---|
DuDeObjectId()
DuDeObjectId
.
DuDeObjectId(String srcId, JsonArray objId)
DuDeObjectId
with the passed identifiers. If one of the parameters is
null
, the id will be invalid
.
srcId
- The identifier of the corresponding source.objId
- The actual identifier of the object.Method Detail |
---|
public String getSourceId()
null
, if the id is invalid
.public JsonArray getObjectId()
null
, if the id is invalid
.public boolean isValid()
true
, if the id is valid; otherwise false
.public boolean fromSameSource(DuDeObjectId other)
other
- Another DuDeObjectId
.
true
, if both ids contain the same source information; otherwise false
.public String toString()
toString
in class Object
public int compareTo(DuDeObjectId other)
compareTo
in interface Comparable<DuDeObjectId>
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
public void toJson(DuDeJsonGenerator jsonGenerator) throws org.codehaus.jackson.JsonGenerationException, IOException
Jsonable
DuDeJsonGenerator
.
toJson
in interface Jsonable
jsonGenerator
- The DuDeJsonGenerator
that is used internally.
org.codehaus.jackson.JsonGenerationException
- If an error occurs while generating the Json syntax.
IOException
- If an error occurs while writing to the output.public void fromJson(DuDeJsonParser<?> jsonParser) throws org.codehaus.jackson.JsonParseException, IOException
Jsonable
DuDeJsonParser
.
fromJson
in interface Jsonable
jsonParser
- The parser that is used for extracting the data out of the Json.
org.codehaus.jackson.JsonParseException
- If an error occurs while parsing the Json.
IOException
- If an error occurs while reading from the stream.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |