Package dev.orne.i18n
Class I18nBilingualString
java.lang.Object
dev.orne.i18n.I18nBilingualString
- All Implemented Interfaces:
I18nString
,Serializable
I18nString
implementation for two supported languages.- Since:
- 0.1
- Version:
- 1.0, 2021-02
- Author:
- (w) Iker Hernaez
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Example Apache commons converter. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionI18nBilingualString
(@NotNull I18nString copy) Copy constructor.I18nBilingualString
(@NotNull String defaultText, @NotNull String translation) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionasMap()
boolean
@NotNull String
get()
@NotNull String
@NotNull String
Returns the default text.Returns the translation text.int
hashCode()
boolean
isEquivalent
(I18nString obj) toString()
Returns the default text.
-
Field Details
-
DEFAULT_LANG
The default text language.- See Also:
-
TRANSLATION_LANG
The translation text language.- See Also:
-
-
Constructor Details
-
I18nBilingualString
public I18nBilingualString(@NotNull @NotNull String defaultText, @NotNull @NotNull String translation) Creates a new instance.- Parameters:
defaultText
- The default text.translation
- The translation text.
-
I18nBilingualString
Copy constructor.- Parameters:
copy
- The instance to copy.
-
-
Method Details
-
getDefaultText
Returns the default text.- Returns:
- The default text.
-
getTranslation
Returns the translation text.- Returns:
- The translation text.
-
get
- Specified by:
get
in interfaceI18nString
-
get
- Specified by:
get
in interfaceI18nString
-
get
- Specified by:
get
in interfaceI18nString
-
hashCode
public int hashCode() -
equals
-
isEquivalent
- Specified by:
isEquivalent
in interfaceI18nString
-
asMap
- Specified by:
asMap
in interfaceI18nString
-
toString
Returns the default text.
-