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
public class BooleanLiteral extends SimpleLiteral
An extension ofSimpleLiteralthat stores a boolean value to avoid parsing.- Author:
- David Huynh, Arjohn Kampman
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static BooleanLiteralFALSEstatic BooleanLiteralTRUE
-
Constructor Summary
Constructors Modifier Constructor Description protectedBooleanLiteral(boolean value)Creates an xsd:boolean typed literal with the specified value.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanbooleanValue()Returns the boolean value of this literal.CoreDatatype.XSDgetCoreDatatype()CoreDatatype is an interface for natively supported datatypes in RDF4J.static BooleanLiteralvalueOf(boolean value)Returns aBooleanLiteralfor the specified value.-
Methods inherited from class org.eclipse.rdf4j.model.impl.SimpleLiteral
byteValue, calendarValue, decimalValue, doubleValue, equals, floatValue, getDatatype, getLabel, getLanguage, hashCode, integerValue, intValue, longValue, 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 Detail
-
TRUE
public static final BooleanLiteral TRUE
-
FALSE
public static final BooleanLiteral FALSE
-
-
Method Detail
-
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
public static BooleanLiteral valueOf(boolean value)
Returns aBooleanLiteralfor the specified value. This method uses the constantsTRUEandFALSEas result values, preventing the often unnecessary creation of newBooleanLiteralobjects.
-
getCoreDatatype
public CoreDatatype.XSD 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 {@link CoreDatatype#NONE)} is used to represent a datatype that is not one of the supported core datatypes.- Specified by:
getCoreDatatypein interfaceLiteral- Overrides:
getCoreDatatypein classSimpleLiteral- Returns:
- The CoreDatatype or {@link CoreDatatype#NONE)} if the datatype matches none of the core datatypes. This method will not return null.
-
-