Interface LocalizationPartsWrapper<T,C,R>
- Type Parameters:
T- the type of the object represented by the localization part.C- the type of the context used to provide additional data about the localization part.R- the resulting typ of the "wrapper" object
- All Superinterfaces:
Serializable
This interface represents set of "wrapping" functions, which are used to wrap particular localization parts types.
There are several types of
LocalizationPart. Each of them has a dedicated method in this interface, which
are used to "wrap" them.
Implementations of this interface has to always implement all the methods, regardless of the actual presence of
particular localization parts types in the WrapableLocalization.
WARNING do not implement wrapping functions in a way, which would destroy "meaning" of the underlying object. It's
called "wrapper", because it should only "wrap" objects underneath, not transform them to something else (in
the meaning sense)-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfacestatic interface -
Method Summary
Modifier and TypeMethodDescriptiondefault <S> LocalizationPartsWrapper<T,C, S> compose(LocalizationPartsWrapper<? super R, C, ? extends S> next) Compose this instance ofLocalizationPartsWrapperwith another wrapper.static <T,C, R> LocalizationPartsWrapper<T, C, R> from(LocalizationPartsWrapper.SerializableBiFunction<T, C, R> objectWrapper, LocalizationPartsWrapper.SerializableBiFunction<T, C, R> objectNameWrapper, LocalizationPartsWrapper.SerializableBiFunction<T, C, R> actionWrapper, LocalizationPartsWrapper.SerializableBiFunction<T, C, R> additionalInfoWrapper, LocalizationPartsWrapper.SerializableFunction<T, R> helpingWordsWrapper) Convenient factory method, which can be used to create new instance of theLocalizationPartsWrapperfrom the set of wrapping functions.wrapAction(T action, C context) wrapAdditionalInfo(T translate, C context) wrapHelpingWords(T helpingWords) wrapObject(T object, C context) wrapObjectName(T objectName, C context)
-
Method Details
-
wrapObject
-
wrapObjectName
-
wrapAction
-
wrapAdditionalInfo
-
wrapHelpingWords
-
from
static <T,C, LocalizationPartsWrapper<T,R> C, fromR> (LocalizationPartsWrapper.SerializableBiFunction<T, C, R> objectWrapper, LocalizationPartsWrapper.SerializableBiFunction<T, C, R> objectNameWrapper, LocalizationPartsWrapper.SerializableBiFunction<T, C, R> actionWrapper, LocalizationPartsWrapper.SerializableBiFunction<T, C, R> additionalInfoWrapper, LocalizationPartsWrapper.SerializableFunction<T, R> helpingWordsWrapper) Convenient factory method, which can be used to create new instance of theLocalizationPartsWrapperfrom the set of wrapping functions. WARNING do not implement wrapping functions in a way, which would destroy "meaning" of the underlying object. It's called "wrapper", because it should only "wrap" objects underneath, not to transform them to something else (in the "meaning" sense).- Type Parameters:
T- the type of the object represented by the localization part.C- the type of the context used to provide additional data about the localization part.R- the resulting typ of the "wrapper" object- Parameters:
objectWrapper- the function, which is used to wrap "object" localization part type.objectNameWrapper- the function, which is used to wrap "object name" localization part type.actionWrapper- the function, which is used to wrap "action" localization part type.additionalInfoWrapper- the function, which is used to wrap "additional info" localization part type.helpingWordsWrapper- the function, which is used to wrap "helping words" localization part type.- Returns:
- new instance of the
LocalizationPartsWrapper
-
compose
default <S> LocalizationPartsWrapper<T,C, composeS> (LocalizationPartsWrapper<? super R, C, ? extends S> next) Compose this instance ofLocalizationPartsWrapperwith another wrapper.- Type Parameters:
S- the type of the new wrapper object.- Parameters:
next- the wrapper which will be applied as next in the wrapping chain.- Returns:
- new composed instance of the
LocalizationPartsWrapper.
-