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 protectedRdfLiteralImpl(java.lang.String value)protectedRdfLiteralImpl(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.Stringdatatype(java.lang.String langTag, java.lang.String datatype)booleanequals(java.lang.Object obj)java.lang.StringgetDatatype()An absolute IRI denoting the datatype IRI of the literal.java.util.Optional<java.lang.String>getLanguage()An optional language tag.java.lang.StringgetValue()Get the lexical value of the literal.inthashCode()booleanisLiteral()Indicates if the value type is RDF literal.java.lang.StringtoString()-
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:RdfLiteralGet the lexical value of the literal.- Specified by:
getValuein interfaceRdfLiteral- Specified by:
getValuein interfaceRdfValue- Returns:
- lexical value, never
null
-
getDatatype
public java.lang.String getDatatype()
Description copied from interface:RdfLiteralAn absolute IRI denoting the datatype IRI of the literal. If the value is rdf:langString,RdfLiteral.getLanguage()value is present.- Specified by:
getDatatypein interfaceRdfLiteral- Returns:
- an absolute IRI, never
null
-
isLiteral
public boolean isLiteral()
Description copied from interface:RdfValueIndicates if the value type is RDF literal.- Specified by:
isLiteralin interfaceRdfLiteral- Specified by:
isLiteralin interfaceRdfValue- Returns:
trueif the value type is literal,falseotherwise.
-
getLanguage
public java.util.Optional<java.lang.String> getLanguage()
Description copied from interface:RdfLiteralAn optional language tag. If this value is specified,RdfLiteral.getDatatype()returns rdf:langString.- Specified by:
getLanguagein 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)
-
-