Package no.hasmac.rdf.impl
Class RdfLiteralImpl
- java.lang.Object
-
- no.hasmac.rdf.impl.RdfLiteralImpl
-
- All Implemented Interfaces:
RdfLiteral
,RdfValue
final class RdfLiteralImpl extends java.lang.Object implements RdfLiteral
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
RdfLiteralImpl(java.lang.String value)
protected
RdfLiteralImpl(java.lang.String value, java.lang.String langTag, java.lang.String datatype)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.lang.String
datatype(java.lang.String langTag, java.lang.String datatype)
boolean
equals(java.lang.Object obj)
java.lang.String
getDatatype()
An absolute IRI denoting the datatype IRI of the literal.java.util.Optional<java.lang.String>
getLanguage()
An optional language tag.java.lang.String
getValue()
Get the lexical value of the literal.int
hashCode()
boolean
isLiteral()
Indicates if the value type is RDF literal.java.lang.String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface no.hasmac.rdf.RdfLiteral
asLiteral, isBlankNode, isIRI
-
-
-
-
Method Detail
-
getValue
public java.lang.String getValue()
Description copied from interface:RdfLiteral
Get the lexical value of the literal.- Specified by:
getValue
in interfaceRdfLiteral
- Specified by:
getValue
in interfaceRdfValue
- Returns:
- lexical value, never
null
-
getDatatype
public java.lang.String getDatatype()
Description copied from interface:RdfLiteral
An absolute IRI denoting the datatype IRI of the literal. If the value is rdf:langString,RdfLiteral.getLanguage()
value is present.- Specified by:
getDatatype
in interfaceRdfLiteral
- Returns:
- an absolute IRI, never
null
-
isLiteral
public boolean isLiteral()
Description copied from interface:RdfValue
Indicates if the value type is RDF literal.- Specified by:
isLiteral
in interfaceRdfLiteral
- Specified by:
isLiteral
in interfaceRdfValue
- Returns:
true
if the value type is literal,false
otherwise.
-
getLanguage
public java.util.Optional<java.lang.String> getLanguage()
Description copied from interface:RdfLiteral
An optional language tag. If this value is specified,RdfLiteral.getDatatype()
returns rdf:langString.- Specified by:
getLanguage
in interfaceRdfLiteral
- Returns:
- language tag or
Optional.empty()
if not set
-
hashCode
public int hashCode()
-
equals
public boolean equals(java.lang.Object obj)
-
toString
public java.lang.String toString()
-
datatype
private static java.lang.String datatype(java.lang.String langTag, java.lang.String datatype)
-
-