Interface LocalizationPart<C>
- Type Parameters:
C- the type of the context object, which provides additional data about the localization part.
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
LocalizationPart.ActionPart,LocalizationPart.AdditionalInfoPart,LocalizationPart.HelpingWordsPart,LocalizationPart.ObjectNamePart,LocalizationPart.ObjectPart
public sealed interface LocalizationPart<C>
extends Serializable
permits LocalizationPart.ObjectPart<C>, LocalizationPart.ObjectNamePart<C>, LocalizationPart.ActionPart<C>, LocalizationPart.HelpingWordsPart<C>, LocalizationPart.AdditionalInfoPart<C>
Single part of the potentially bigger localization
There are several types of localization parts, each of which can be created using provided factory methods.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classstatic final classstatic final classstatic final classstatic final class -
Method Summary
Modifier and TypeMethodDescriptionstatic <C> LocalizationPart<C>forAction(LocalizableMessage action, C context) Creates localization part of the "Action" type.static <C> LocalizationPart<C>forAdditionalInfo(LocalizableMessage additionalInfo, C context) Creates localization part of the "Additional info" type.static <C> LocalizationPart<C>forHelpingWords(LocalizableMessage helpingWords) Creates localization part of the "Helping words" type.static <C> LocalizationPart<C>forObject(LocalizableMessage object, C context) Creates localization part of the "Object" type.static <C> LocalizationPart<C>forObjectName(LocalizableMessage objectName, C context) Creates localization part of the "Object name" type.<T> LocalizableObject<T>wrap(LocalizationPartsWrapper<String, C, T> wrapper)
-
Method Details
-
wrap
-
forObject
Creates localization part of the "Object" type.- Type Parameters:
C- the type of the context.- Parameters:
object- the localizable message which represent the "object" in the bigger sentence.context- the context used to provide additional data about the object.- Returns:
- new instance of the object localization part.
-
forObjectName
Creates localization part of the "Object name" type.- Type Parameters:
C- the type of the context.- Parameters:
objectName- the localizable message which represent the object's name in the bigger sentence.context- the context used to provide additional data about the object.- Returns:
- new instance of the object's name localization part.
-
forAction
Creates localization part of the "Action" type.- Type Parameters:
C- the type of the context.- Parameters:
action- the localizable message which represent the "action" in the bigger sentence.context- the context used to provide additional data about the action.- Returns:
- new instance of the action localization part.
-
forAdditionalInfo
Creates localization part of the "Additional info" type.- Type Parameters:
C- the type of the context.- Parameters:
additionalInfo- the localizable message which represent some the additional information about the object (or possibly action).context- the context used to provide additional data about the object.- Returns:
- new instance of the additional info localization part.
-
forHelpingWords
Creates localization part of the "Helping words" type.- Type Parameters:
C- the type of the context (which is not used in this particular case).- Parameters:
helpingWords- the localizable message which represent some kind of "helping words" in the bigger sentence. It may be any words form simple "is" or "has been" to whole sentence.- Returns:
- new instance of the helping words localization part.
-