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.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BooleanLiteralprivate static final longstatic final BooleanLiteralprivate final boolean -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBooleanLiteral(boolean value) Creates an xsd:boolean typed literal with the specified value. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the boolean value of this literal.CoreDatatype is an interface for natively supported datatypes in RDF4J.static BooleanLiteralvalueOf(boolean value) Returns aBooleanLiteralfor the specified value.Methods inherited from class SimpleLiteral
byteValue, calendarValue, decimalValue, doubleValue, equals, floatValue, getDatatype, getLabel, getLanguage, getXsdDatatype, hashCode, integerValue, intValue, longValue, setDatatype, setDatatype, setDatatype, setDatatype, setLabel, setLanguage, shortValue, stringValue, toStringMethods inherited from class AbstractLiteral
temporalAccessorValue, temporalAmountValueMethods inherited from interface Value
isBNode, isIRI, isResource, isTriple
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
TRUE
-
FALSE
-
value
private final boolean value
-
-
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:LiteralReturns the boolean value of this literal.- Specified by:
booleanValuein interfaceLiteral- Overrides:
booleanValuein classSimpleLiteral- Returns:
- The boolean value of the literal.
-
valueOf
Returns aBooleanLiteralfor the specified value. This method uses the constantsTRUEandFALSEas result values, preventing the often unnecessary creation of newBooleanLiteralobjects. -
getCoreDatatype
Description copied from interface:LiteralCoreDatatype 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} is used to represent a datatype that is not one of the supported core datatypes.invalid @link
{@link CoreDatatype#NONE)- Specified by:
getCoreDatatypein interfaceLiteral- Overrides:
getCoreDatatypein classSimpleLiteral- Returns:
- The CoreDatatype or
} if the datatype matches none of the core datatypes. This method will not return null.
invalid @link
{@link CoreDatatype#NONE)
-