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 TypeMethodDescriptioncharcharAt(int index) Returns the character at the specified index in the wrapped string.intlength()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, waitMethods 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:
lengthin 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:
charAtin 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:
subSequencein 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:
toStringin interfaceCharSequence- Overrides:
toStringin classObject- Returns:
- The string that is not to be translated
-