Class Enhancer<EnhancementT>

java.lang.Object
aas_core.aas3_0.enhancing.Unwrapper<EnhancementT>
aas_core.aas3_0.enhancing.Enhancer<EnhancementT>
Type Parameters:
EnhancementT - structure of the enhancement

public class Enhancer<EnhancementT> extends Unwrapper<EnhancementT>
Wrap and unwrap the instances of model classes with enhancement.
  • Constructor Details

    • Enhancer

      public Enhancer(Function<IClass,Optional<EnhancementT>> enhancementFactory)
      Parameters:
      enhancementFactory - how to enhance the instances.

      If it returns null, the instance will not be wrapped. However, the wrapping will continue recursively.

  • Method Details

    • wrap

      public IClass wrap(IClass that)
      Wrap the instance with an enhancement.

      Double wraps are not allowed to prevent runtime leakage.

      If you use references to the instance objects, you have to update them after the wrapping, as the wrapping is recursive.

      Parameters:
      that - model instance to be wrapped
      Returns:
      that instance wrapped recursively with enhancements