Package org.hisp.dhis.model.event
Class EventDataValue
java.lang.Object
org.hisp.dhis.model.event.EventDataValue
- All Implemented Interfaces:
Serializable
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value as a boolean, only if this value represents a boolean.Returns the value as a Double, only if the value represents a double.Returns the value as an integer, only if the value represents an integer.Returns the value as aLocalDateTime, only if the value represents aLocalDateTime.booleanhasValue()Indicates whether the value is not null or empty.booleanIndicates whether the value represents a boolean.booleanisDouble()Indicates whether the value represents a double.booleanIndicates whether the value represents an integer.booleanIndicates whether the value represents aLocalDate.booleanIndicates whether the value represents aLocalDateTime.
-
Field Details
-
VALUE_TRUE
- See Also:
-
VALUE_FALSE
- See Also:
-
-
Constructor Details
-
EventDataValue
-
-
Method Details
-
hasValue
public boolean hasValue()Indicates whether the value is not null or empty.- Returns:
- true if the value is not null or empty.
-
isBoolean
public boolean isBoolean()Indicates whether the value represents a boolean.- Returns:
- true if the value represents a boolean.
-
getBooleanValue
Returns the value as a boolean, only if this value represents a boolean. Returns null if not.- Returns:
- a boolean value.
-
isDouble
public boolean isDouble()Indicates whether the value represents a double.- Returns:
- true if the value represents a double.
-
getDoubleValue
Returns the value as a Double, only if the value represents a double. Returns null if not.- Returns:
- a double value.
-
isInteger
public boolean isInteger()Indicates whether the value represents an integer.- Returns:
- true if the value represents an integer.
-
getIntegerValue
Returns the value as an integer, only if the value represents an integer. Return null if not.- Returns:
- an integer value.
-
isLocalDate
public boolean isLocalDate()Indicates whether the value represents aLocalDate.- Returns:
- true if the value represents a
LocalDate.
-
getLocalDateValue
Returns the value as aLocalDate, only if the value represents aLocalDateor aLocalDateTime. If the value represents the latter, theLocalDateTimeis converted to aLocalDate. Returns null if not.- Returns:
- a
LocalDateor null.
-
isLocalDateTime
public boolean isLocalDateTime()Indicates whether the value represents aLocalDateTime.- Returns:
- true if the value represents a
LocalDateTime.
-
getLocalDateTimeValue
Returns the value as aLocalDateTime, only if the value represents aLocalDateTime. Returns null if not.- Returns:
- a
LocalDateTimeor null.
-