Package org.hisp.dhis.model.event
Class Event
java.lang.Object
org.hisp.dhis.model.event.Event
- All Implemented Interfaces:
Serializable
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionEvent(String id, String programStage, String orgUnit, EventStatus status, Date occurredAt, List<EventDataValue> dataValues) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDataValue(String dataElement, String value) Adds a data value.voidaddDataValue(EventDataValue dataValue) Adds a data value.getDataValue(String dataElement) Returns the value of the firstEventDataValuewhich data element matches the given data element identifier, or null if no match.getEventDataValue(String dataElement) Returns the firstEventDataValuewhich data element matches the given data element identifier, or null if no match.booleanIndicates whether geometry is of typePoint.booleanisGeometryType(String type) Indicates whether geometry is of the given type.voidsetPointGeometry(double longitude, double latitude) Sets the geometry field to a point based on the given longitude and latitude.
-
Constructor Details
-
Event
-
Event
public Event(String id, String programStage, String orgUnit, EventStatus status, Date occurredAt, List<EventDataValue> dataValues)
-
-
Method Details
-
setPointGeometry
public void setPointGeometry(double longitude, double latitude) Sets the geometry field to a point based on the given longitude and latitude.- Parameters:
longitude- the longitude (x value).latitude- the latitude (y value).
-
isGeometryPoint
public boolean isGeometryPoint()Indicates whether geometry is of typePoint.- Returns:
- true if geometry is of type
Point.
-
isGeometryType
Indicates whether geometry is of the given type.- Parameters:
type- the type, useGeometryTYPENAMEconstant values.- Returns:
- true if geometry is of the given type.
-
getEventDataValue
Returns the firstEventDataValuewhich data element matches the given data element identifier, or null if no match.- Parameters:
dataElement- the data element identifier.- Returns:
- a
EventDataValueor null.
-
getDataValue
Returns the value of the firstEventDataValuewhich data element matches the given data element identifier, or null if no match.- Parameters:
dataElement- the data element identifier.- Returns:
- a
EventDataValueor null.
-
addDataValue
Adds a data value. If a data value with the same data element identifier exists, the given value will overwrite the existing data value. The new data value is added to the end of the list of data values.- Parameters:
dataValue- theEventDataValue, not null.
-
addDataValue
Adds a data value. If a data value with the same data element identifier exists, the given value will overwrite the existing data value. The new data value is added to the end of the list of data values.- Parameters:
dataElement- the data element identifier, not null.value- the data value.
-