Package org.eclipse.rdf4j.model.impl
Class BooleanLiteral
java.lang.Object
org.eclipse.rdf4j.model.base.AbstractLiteral
org.eclipse.rdf4j.model.impl.SimpleLiteral
org.eclipse.rdf4j.model.impl.BooleanLiteral
- All Implemented Interfaces:
Serializable
,Literal
,Value
An extension of
SimpleLiteral
that stores a boolean value to avoid parsing.- Author:
- David Huynh, Arjohn Kampman
- See Also:
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
BooleanLiteral
(boolean value) Creates an xsd:boolean typed literal with the specified value. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the boolean value of this literal.CoreDatatype is an interface for natively supported datatypes in RDF4J.static BooleanLiteral
valueOf
(boolean value) Returns aBooleanLiteral
for the specified value.Methods inherited from class org.eclipse.rdf4j.model.impl.SimpleLiteral
byteValue, calendarValue, decimalValue, doubleValue, equals, floatValue, getDatatype, getLabel, getLanguage, getXsdDatatype, hashCode, integerValue, intValue, longValue, setDatatype, setDatatype, setDatatype, setDatatype, setLabel, setLanguage, shortValue, stringValue, toString
Methods inherited from class org.eclipse.rdf4j.model.base.AbstractLiteral
temporalAccessorValue, temporalAmountValue
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.rdf4j.model.Value
isBNode, isIRI, isResource, isTriple
-
Field Details
-
TRUE
-
FALSE
-
-
Constructor Details
-
BooleanLiteral
protected BooleanLiteral(boolean value) Creates an xsd:boolean typed literal with the specified value.
-
-
Method Details
-
booleanValue
public boolean booleanValue()Description copied from interface:Literal
Returns the boolean value of this literal.- Specified by:
booleanValue
in interfaceLiteral
- Overrides:
booleanValue
in classSimpleLiteral
- Returns:
- The boolean value of the literal.
-
valueOf
Returns aBooleanLiteral
for the specified value. This method uses the constantsTRUE
andFALSE
as result values, preventing the often unnecessary creation of newBooleanLiteral
objects. -
getCoreDatatype
Description copied from interface:Literal
CoreDatatype is an interface for natively supported datatypes in RDF4J. This includes, among others, the XML Schema datatypes and rdf:langString. CoreDatatypes are implemented as enums and more performant and convenient to work with than IRI-based datatypes. The constant {@link CoreDatatype#NONE)} is used to represent a datatype that is not one of the supported core datatypes.- Specified by:
getCoreDatatype
in interfaceLiteral
- Overrides:
getCoreDatatype
in classSimpleLiteral
- Returns:
- The CoreDatatype or {@link CoreDatatype#NONE)} if the datatype matches none of the core datatypes. This method will not return null.
-