Class RdfLiteralImpl

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String dataType  
      private java.lang.String langTag  
      private java.lang.String value  
    • 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
    • Field Detail

      • value

        private final java.lang.String value
      • langTag

        private final java.lang.String langTag
      • dataType

        private final java.lang.String dataType
    • Constructor Detail

      • RdfLiteralImpl

        protected RdfLiteralImpl​(java.lang.String value)
      • RdfLiteralImpl

        protected RdfLiteralImpl​(java.lang.String value,
                                 java.lang.String langTag,
                                 java.lang.String datatype)
    • Method Detail

      • getValue

        public java.lang.String getValue()
        Description copied from interface: RdfLiteral
        Get the lexical value of the literal.
        Specified by:
        getValue in interface RdfLiteral
        Specified by:
        getValue in interface RdfValue
        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 interface RdfLiteral
        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 interface RdfLiteral
        Specified by:
        isLiteral in interface RdfValue
        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 interface RdfLiteral
        Returns:
        language tag or Optional.empty() if not set
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface RdfValue
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Specified by:
        equals in interface RdfValue
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Specified by:
        toString in interface RdfValue
        Overrides:
        toString in class java.lang.Object
      • datatype

        private static java.lang.String datatype​(java.lang.String langTag,
                                                 java.lang.String datatype)