Class CorruptLiteral
- java.lang.Object
-
- org.eclipse.rdf4j.sail.nativerdf.model.CorruptValue
-
- org.eclipse.rdf4j.sail.nativerdf.model.CorruptLiteral
-
- All Implemented Interfaces:
Serializable
,Literal
,Value
,NativeValue
public class CorruptLiteral extends CorruptValue implements Literal
CorruptLiteral is used when a NativeValue cannot be read from the ValueStore and if soft failure is enabled- Author:
- HÃ¥vard M. Ottestad
- See Also:
.
, Serialized Form
-
-
Field Summary
-
Fields inherited from interface org.eclipse.rdf4j.sail.nativerdf.model.NativeValue
UNKNOWN_ID
-
-
Constructor Summary
Constructors Constructor Description CorruptLiteral(ValueStoreRevision revision, int internalID, byte[] data)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
booleanValue()
Returns the boolean value of this literal.byte
byteValue()
Returns the byte value of this literal.XMLGregorianCalendar
calendarValue()
Returns theXMLGregorianCalendar
value of this literal.BigDecimal
decimalValue()
Returns the decimal value of this literal.double
doubleValue()
Returns the double value of this literal.boolean
equals(Object o)
Compares this literal to another object.float
floatValue()
Returns the float value of this literal.CoreDatatype
getCoreDatatype()
CoreDatatype is an interface for natively supported datatypes in RDF4J.IRI
getDatatype()
Gets the datatype for this literal.String
getLabel()
Gets the label (the lexical value) of this literal.Optional<String>
getLanguage()
Gets the language tag for this literal, normalized to lower case.BigInteger
integerValue()
Returns the integer value of this literal.int
intValue()
Returns the int value of this literal.long
longValue()
Returns the long value of this literal.short
shortValue()
Returns the short value of this literal.String
stringValue()
Returns the String-value of a Value object.-
Methods inherited from class org.eclipse.rdf4j.sail.nativerdf.model.CorruptValue
getData, getInternalID, getValueStoreRevision, setInternalID
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.rdf4j.model.Literal
hashCode, isLiteral, temporalAccessorValue, temporalAmountValue
-
Methods inherited from interface org.eclipse.rdf4j.model.Value
isBNode, isIRI, isResource, isTriple
-
-
-
-
Constructor Detail
-
CorruptLiteral
public CorruptLiteral(ValueStoreRevision revision, int internalID, byte[] data)
-
-
Method Detail
-
stringValue
public String stringValue()
Description copied from interface:Value
Returns the String-value of a Value object. This returns either aLiteral
's label, aIRI
's URI or aBNode
's ID.- Specified by:
stringValue
in interfaceValue
- Overrides:
stringValue
in classCorruptValue
-
getLabel
public String getLabel()
Description copied from interface:Literal
Gets the label (the lexical value) of this literal.
-
getLanguage
public Optional<String> getLanguage()
Description copied from interface:Literal
Gets the language tag for this literal, normalized to lower case.- Specified by:
getLanguage
in interfaceLiteral
- Returns:
- The language tag for this literal, or
Optional.empty()
if it doesn't have one.
-
getDatatype
public IRI getDatatype()
Description copied from interface:Literal
Gets the datatype for this literal.If
Literal.getLanguage()
returns a non-empty value than this must returnrdf:langString
. If no datatype was assigned to this literal by the creator, then this method must returnxsd:string
.- Specified by:
getDatatype
in interfaceLiteral
- Returns:
- The datatype for this literal.
-
booleanValue
public boolean booleanValue()
Description copied from interface:Literal
Returns the boolean value of this literal.- Specified by:
booleanValue
in interfaceLiteral
- Returns:
- The boolean value of the literal.
-
byteValue
public byte byteValue()
Description copied from interface:Literal
Returns the byte value of this literal.
-
shortValue
public short shortValue()
Description copied from interface:Literal
Returns the short value of this literal.- Specified by:
shortValue
in interfaceLiteral
- Returns:
- The short value of the literal.
-
intValue
public int intValue()
Description copied from interface:Literal
Returns the int value of this literal.
-
longValue
public long longValue()
Description copied from interface:Literal
Returns the long value of this literal.
-
integerValue
public BigInteger integerValue()
Description copied from interface:Literal
Returns the integer value of this literal.- Specified by:
integerValue
in interfaceLiteral
- Returns:
- The integer value of the literal.
-
decimalValue
public BigDecimal decimalValue()
Description copied from interface:Literal
Returns the decimal value of this literal.- Specified by:
decimalValue
in interfaceLiteral
- Returns:
- The decimal value of the literal.
-
floatValue
public float floatValue()
Description copied from interface:Literal
Returns the float value of this literal.- Specified by:
floatValue
in interfaceLiteral
- Returns:
- The float value of the literal.
-
doubleValue
public double doubleValue()
Description copied from interface:Literal
Returns the double value of this literal.- Specified by:
doubleValue
in interfaceLiteral
- Returns:
- The double value of the literal.
-
calendarValue
public XMLGregorianCalendar calendarValue()
Description copied from interface:Literal
Returns theXMLGregorianCalendar
value of this literal. A calendar representation can be given for literals whose label conforms to the syntax of the following XML Schema datatypes: dateTime, time, date, gYearMonth, gMonthDay, gYear, gMonth or gDay.- Specified by:
calendarValue
in interfaceLiteral
- Returns:
- The calendar value of the literal.
-
getCoreDatatype
public CoreDatatype 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
- Returns:
- The CoreDatatype or {@link CoreDatatype#NONE)} if the datatype matches none of the core datatypes. This method will not return null.
-
equals
public boolean equals(Object o)
Description copied from interface:Literal
Compares this literal to another object.- Specified by:
equals
in interfaceLiteral
- Overrides:
equals
in classCorruptValue
- Parameters:
o
- the object to compare this literal to- Returns:
true
, if the other object is an instance ofLiteral
and if their labels, language tags and datatypes are equal
-
-