Class AbstractExtendable<T>

java.lang.Object
com.powsybl.commons.extensions.AbstractExtendable<T>
All Implemented Interfaces:
Extendable<T>
Direct Known Subclasses:
BatteryImpl, BranchResult, BusResult, ComputationParametersImpl, Contingency, DynamicSimulationParameters, FailedFaultResult, FortescueFaultResult, LimitViolation, LoadFlowParameters, MagnitudeFaultResult, NetworkImpl, NetworkMetadata, OperatorStrategy, SecurityAnalysisParameters, SecurityAnalysisReport, SecurityAnalysisResult, SensitivityAnalysisParameters, ShortCircuitAnalysisResult, ShortCircuitParameters, SubnetworkImpl, ThreeWindingsTransformerResult

public abstract class AbstractExtendable<T> extends Object implements Extendable<T>
Author:
Mathieu Bague <mathieu.bague at rte-france.com>
  • Constructor Details

    • AbstractExtendable

      public AbstractExtendable()
  • Method Details

    • addExtension

      public <E extends Extension<T>> void addExtension(Class<? super E> type, E extension)
      Description copied from interface: Extendable
      Add en extension to this extendable object.
      Specified by:
      addExtension in interface Extendable<T>
      Type Parameters:
      E - the extension type
      Parameters:
      type - the extension class type
      extension - the extension
    • getExtension

      public <E extends Extension<T>> E getExtension(Class<? super E> type)
      Description copied from interface: Extendable
      Get an extension based on its class type.
      Specified by:
      getExtension in interface Extendable<T>
      Type Parameters:
      E - the extension type
      Parameters:
      type - the extension class type
      Returns:
      the extension mapped to the class type or null if not found
    • getExtensionByName

      public <E extends Extension<T>> E getExtensionByName(String name)
      Description copied from interface: Extendable
      Get an extension based on its name.
      Specified by:
      getExtensionByName in interface Extendable<T>
      Parameters:
      name - the extension name
      Returns:
      the extension mapped to the name or null if not found
    • removeExtension

      protected <E extends Extension<T>> void removeExtension(Class<E> type, E extension)
    • removeExtension

      public <E extends Extension<T>> boolean removeExtension(Class<E> type)
      Description copied from interface: Extendable
      Remove an extension based on its class type.
      Specified by:
      removeExtension in interface Extendable<T>
      Type Parameters:
      E - the extension type
      Parameters:
      type - the extension class type
      Returns:
      true if the extension has been removed false if extension has not been found
    • getExtensions

      public Collection<Extension<T>> getExtensions()
      Description copied from interface: Extendable
      Get all extensions associated with this extendable object..
      Specified by:
      getExtensions in interface Extendable<T>
      Returns:
      all extensions associated to this extendable object.
    • getImplementationName

      public String getImplementationName()
      Description copied from interface: Extendable
      Returns a name that is used to find matching ExtensionAdderProviders when selecting implementations of extensions in Extendable.newExtension(java.lang.Class<B>). This is meant to be overriden by extendables when multiple implementations exist.
      Specified by:
      getImplementationName in interface Extendable<T>
      Returns:
      the name