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
  Direct Known Subclasses:
    BooleanLiteralImpl

      public class BooleanLiteral
      extends SimpleLiteral

  An extension of `SimpleLiteral` that stores a boolean value to avoid parsing.
  Author:
    David Huynh, Arjohn Kampman
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static BooleanLiteral` | `FALSE`
    `static BooleanLiteral` | `TRUE`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `BooleanLiteral(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 and Description
    --- | ---
    `boolean` | `booleanValue()` Returns the `boolean` value of this literal.
    `static BooleanLiteral` | `valueOf(boolean value)` Returns a `BooleanLiteral` 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, 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.Literal

      `isLiteral`

    - ### 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

  - ### Constructor Detail

    - #### BooleanLiteral

          protected BooleanLiteral(boolean value)

      Creates an xsd:boolean typed literal with the specified value.

  - ### Method Detail

    - #### 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.

Copyright © 2015-2021 Eclipse Foundation. All Rights Reserved.