org.apache.stanbol.entityhub.servicesapi.model
Interface Text


public interface Text

Defines a natural language text in a given language.

The text MUST NOT be null nor an empty String. The language may be null (indicating the default language) or any kind of value. It is recommended to use ISO 639-1 codes (two Letter codes). By definition it is also allowed to use empty strings as language. However implementations of this interface are free to convert the empty language to null.

Implementations of that interface MUST BE immutable

Author:
Rupert Westenthaler

Method Summary
 String getLanguage()
          Getter for the language.
 String getText()
          Getter for the text (not null nor empty)
 String toString()
          The text without language information - this is the same as returned by getText().
 

Method Detail

getText

String getText()
Getter for the text (not null nor empty)

Returns:
the text

getLanguage

String getLanguage()
Getter for the language. null or an empty string indicate, that the text is not specific to a language (e.g. the name of a person). Note that implementation can change empty values to null but.

Returns:
the language

toString

String toString()
The text without language information - this is the same as returned by getText().

Overrides:
toString in class Object
Returns:
the text


Copyright © 2010-2013 The Apache Software Foundation. All Rights Reserved.