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

public interface LocalizationPartsWrapper<T,C,R> extends 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)
  • Method Details

    • wrapObject

      R wrapObject(T object, C context)
    • wrapObjectName

      R wrapObjectName(T objectName, C context)
    • wrapAction

      R wrapAction(T action, C context)
    • wrapAdditionalInfo

      R wrapAdditionalInfo(T translate, C context)
    • wrapHelpingWords

      R wrapHelpingWords(T helpingWords)
    • from

      Convenient factory method, which can be used to create new instance of the LocalizationPartsWrapper from 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,S> compose(LocalizationPartsWrapper<? super R,C,? extends S> next)
      Compose this instance of LocalizationPartsWrapper with 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.