Package org.nuclos.api.l10n
Class DoNotTranslate
java.lang.Object
org.nuclos.api.l10n.DoNotTranslate
- All Implemented Interfaces:
CharSequence
A wrapper class for strings that should not be translated by the localization system.
This class marks strings to be excluded from the translation process.
It implements CharSequence to maintain compatibility with string operations.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new DoNotTranslate instance with the specified string. -
Method Summary
Modifier and TypeMethodDescriptionchar
charAt
(int index) Returns the character at the specified index in the wrapped string.int
length()
Returns the length of the wrapped string.subSequence
(int start, int end) Returns a new DoNotTranslate instance that contains a subsequence of the wrapped string.toString()
Returns the wrapped string.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.CharSequence
chars, codePoints, isEmpty
-
Constructor Details
-
DoNotTranslate
Creates a new DoNotTranslate instance with the specified string.- Parameters:
s
- The string that should not be translated- Throws:
IllegalArgumentException
- If the provided string is null
-
-
Method Details
-
length
public int length()Returns the length of the wrapped string.- Specified by:
length
in interfaceCharSequence
- Returns:
- The length of the wrapped string
-
charAt
public char charAt(int index) Returns the character at the specified index in the wrapped string.- Specified by:
charAt
in interfaceCharSequence
- Parameters:
index
- The index of the character to return- Returns:
- The character at the specified index
-
subSequence
Returns a new DoNotTranslate instance that contains a subsequence of the wrapped string.- Specified by:
subSequence
in interfaceCharSequence
- Parameters:
start
- The start index, inclusiveend
- The end index, exclusive- Returns:
- A new DoNotTranslate instance containing the specified subsequence
-
toString
Returns the wrapped string.- Specified by:
toString
in interfaceCharSequence
- Overrides:
toString
in classObject
- Returns:
- The string that is not to be translated
-