Class ExtensionValue
java.lang.Object
org.incenp.obofoundry.sssom.model.ExtensionValue
Represents the value of an extension slot.
-
Constructor Summary
ConstructorsConstructorDescriptionExtensionValue
(boolean b) Creates a new boolean-typed value.ExtensionValue
(double d) Creates a new double-typed value.ExtensionValue
(int i) Creates a new integer-typed value.Creates a new value with an unknown type.Creates a new string-typed value.ExtensionValue
(String s, boolean isIdentifier) Creates a new string-based value that may be an identifier.ExtensionValue
(URI uri) Creates a new value representing a URI.ExtensionValue
(LocalDate date) Creates a new value representing a date.ExtensionValue
(ZonedDateTime time) Creates a new value representing a date and time. -
Method Summary
-
Constructor Details
-
ExtensionValue
public ExtensionValue(int i) Creates a new integer-typed value.- Parameters:
i
- The value.
-
ExtensionValue
public ExtensionValue(double d) Creates a new double-typed value.- Parameters:
d
- The value.
-
ExtensionValue
public ExtensionValue(boolean b) Creates a new boolean-typed value.- Parameters:
b
- The value.
-
ExtensionValue
Creates a new value representing a date.- Parameters:
date
- The value.
-
ExtensionValue
Creates a new value representing a date and time.- Parameters:
time
- The value.
-
ExtensionValue
Creates a new string-typed value.- Parameters:
s
- The value.
-
ExtensionValue
Creates a new string-based value that may be an identifier.- Parameters:
s
- The value.isIdentifier
- Iftrue
, the value is treated as an identifier; otherwise it is treated as a normal string.
-
ExtensionValue
Creates a new value representing a URI.- Parameters:
uri
- The value.
-
ExtensionValue
Creates a new value with an unknown type.- Parameters:
o
- The value.
-
-
Method Details
-
toString
-
getType
- Returns:
- The type of the value.
-
getValue
- Returns:
- The actual value, as an object of unknown type.
-
isInteger
public boolean isInteger()- Returns:
true
if the value is typed as an integer.
-
isDouble
public boolean isDouble()- Returns:
true
if the value is typed as a double.
-
isBoolean
public boolean isBoolean()- Returns:
true
if the value is typed as a boolean.
-
isDate
public boolean isDate()- Returns:
true
if the value is typed as a date.
-
isDatetime
public boolean isDatetime()- Returns:
true
if the value is typed as a date and time object.
-
isIdentifier
public boolean isIdentifier()- Returns:
true
if the value is typed as an identifier.
-
isString
public boolean isString()- Returns:
true
if the value is typed as a string.
-
asInteger
- Returns:
- The value as an integer, or
null
if the value has another type.
-
asDouble
- Returns:
- The value as a double, or
null
if the value has another type.
-
asBoolean
- Returns:
- The value as a boolean, or
null
if the value has another type.
-
asDate
- Returns:
- The value as a date, or
null
if the value has another type.
-
asDatetime
- Returns:
- The value as a date and time object, or
null
if the value has another type.
-
asString
- Returns:
- The value as a string, or
null
if the value is not typed as a string or an identifier.
-
asURI
- Returns:
- The value as a URI, or
null
if the value is not typed as such.
-