MultiLanguageString

Inheritance: java.lang.Object

public class MultiLanguageString

Represents multi language string.

Constructors

ConstructorDescription
MultiLanguageString()Creates empty multi language string.

Methods

MethodDescription
isEmpty()True, if MultiLanguageString don’t have strings of languages.
addLanguageString(String str, int languageId)Adds string of specific language
containsString(String str)Returns true if the string is present inside all the language strings.
getAllStrings()Returns all strings of all languages.
getEnglishString()Returns english string if found.
getAllLanguageIds()Gets language identifiers for all strings or empty array if no strings are presents.
getStringForLanguageId(int languageId)Returns string related to language identifier passed, if found.
hashCode()GetHashCode implementation.
op_Equality(MultiLanguageString obj1, String obj2)Equality operator implementation.
op_Equality(String obj1, MultiLanguageString obj2)Equality operator implementation.
op_Inequality(MultiLanguageString obj1, String obj2)Inequality operator implementation.
op_Inequality(String obj1, MultiLanguageString obj2)Inequality operator implementation.
equals(Object objToCompare)Returns true if objects are considered equal.

MultiLanguageString()

public MultiLanguageString()

Creates empty multi language string.

isEmpty()

public boolean isEmpty()

True, if MultiLanguageString don’t have strings of languages.

Returns: boolean - True, if MultiLanguageString don’t have strings of languages.

addLanguageString(String str, int languageId)

public void addLanguageString(String str, int languageId)

Adds string of specific language

Parameters:

ParameterTypeDescription
strjava.lang.StringString to add
languageIdintLanguage identifier

containsString(String str)

public boolean containsString(String str)

Returns true if the string is present inside all the language strings.

Parameters:

ParameterTypeDescription
strjava.lang.StringString to check.

Returns: boolean - True if the string is present inside all the language strings.

getAllStrings()

public String[] getAllStrings()

Returns all strings of all languages.

Returns: java.lang.String[] - Array of all strings of all languages.

getEnglishString()

public String getEnglishString()

Returns english string if found. Otherwise returns first non-english string.

Returns: java.lang.String - English string if found, otherwise first non-english string.

getAllLanguageIds()

public int[] getAllLanguageIds()

Gets language identifiers for all strings or empty array if no strings are presents.

Returns: int[] - Array with language identifiers or empty array if no strings are present.

getStringForLanguageId(int languageId)

public String getStringForLanguageId(int languageId)

Returns string related to language identifier passed, if found. Empty string otherwise.

Parameters:

ParameterTypeDescription
languageIdintLanguage identifier.

Returns: java.lang.String - String related to language identifier passed, if found. Empty string otherwise.

hashCode()

public int hashCode()

GetHashCode implementation.

Returns: int - hash code of object

op_Equality(MultiLanguageString obj1, String obj2)

public static boolean op_Equality(MultiLanguageString obj1, String obj2)

Equality operator implementation.

Parameters:

ParameterTypeDescription
obj1MultiLanguageStringfirst object to compare
obj2java.lang.Stringsecond object to compare

Returns: boolean - comparison result

op_Equality(String obj1, MultiLanguageString obj2)

public static boolean op_Equality(String obj1, MultiLanguageString obj2)

Equality operator implementation.

Parameters:

ParameterTypeDescription
obj1java.lang.Stringstring to compare
obj2MultiLanguageStringmultilanguage string to compare

Returns: boolean - comparison result

op_Inequality(MultiLanguageString obj1, String obj2)

public static boolean op_Inequality(MultiLanguageString obj1, String obj2)

Inequality operator implementation.

Parameters:

ParameterTypeDescription
obj1MultiLanguageStringstring to compare
obj2java.lang.Stringmultilanguage string to compare

Returns: boolean - comparison result

op_Inequality(String obj1, MultiLanguageString obj2)

public static boolean op_Inequality(String obj1, MultiLanguageString obj2)

Inequality operator implementation.

Parameters:

ParameterTypeDescription
obj1java.lang.Stringstring to compare
obj2MultiLanguageStringmultilanguage string to compare

Returns: boolean - comparison result

equals(Object objToCompare)

public boolean equals(Object objToCompare)

Returns true if objects are considered equal.

Parameters:

ParameterTypeDescription
objToComparejava.lang.Objectobject to compare with

Returns: boolean - comparison result