Class BooleanLiteral

All Implemented Interfaces:
Serializable, Literal, Value

public class BooleanLiteral extends SimpleLiteral
An extension of SimpleLiteral that stores a boolean value to avoid parsing.
Author:
David Huynh, Arjohn Kampman
See Also:
  • Field Details

  • 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 interface Literal
      Overrides:
      booleanValue in class SimpleLiteral
      Returns:
      The boolean value of the literal.
    • valueOf

      public static BooleanLiteral valueOf(boolean value)
      Returns a BooleanLiteral for the specified value. This method uses the constants TRUE and FALSE as result values, preventing the often unnecessary creation of new BooleanLiteral objects.
    • getCoreDatatype

      public CoreDatatype.XSD 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 interface Literal
      Overrides:
      getCoreDatatype in class SimpleLiteral
      Returns:
      The CoreDatatype or {@link CoreDatatype#NONE)} if the datatype matches none of the core datatypes. This method will not return null.