Interface Extendable<O>

All Known Subinterfaces:
AutomationSystem<I>, Battery, Branch<I>, Bus, BusbarSection, ComputationParameters, Connectable<I>, Container<I>, DanglingLine, FaultResult, Generator, Ground, HvdcConverterStation<T>, HvdcLine, Identifiable<I>, Injection<I>, LccConverterStation, Line, Load, Network, NetworkExt, OverloadManagementSystem, ShuntCompensator, StaticVarCompensator, Substation, Switch, ThreeWindingsTransformer, TieLine, TwoWindingsTransformer, VoltageLevel, VscConverterStation
All Known Implementing Classes:
AbstractExtendable, BatteryImpl, BranchResult, BusResult, ComputationParametersImpl, Contingency, DynamicSimulationParameters, FailedFaultResult, FortescueFaultResult, LimitViolation, LoadFlowParameters, MagnitudeFaultResult, NetworkImpl, NetworkMetadata, OperatorStrategy, SecurityAnalysisParameters, SecurityAnalysisReport, SecurityAnalysisResult, SensitivityAnalysisParameters, ShortCircuitAnalysisResult, ShortCircuitParameters, SubnetworkImpl, ThreeWindingsTransformerResult

public interface Extendable<O>
Author:
Mathieu Bague <mathieu.bague at rte-france.com>
  • Method Details

    • addExtension

      <E extends Extension<O>> void addExtension(Class<? super E> type, E extension)
      Add en extension to this extendable object.
      Type Parameters:
      E - the extension type
      Parameters:
      type - the extension class type
      extension - the extension
    • getExtension

      <E extends Extension<O>> E getExtension(Class<? super E> type)
      Get an extension based on its class type.
      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

      <E extends Extension<O>> E getExtensionByName(String name)
      Get an extension based on its name.
      Parameters:
      name - the extension name
      Returns:
      the extension mapped to the name or null if not found
    • removeExtension

      <E extends Extension<O>> boolean removeExtension(Class<E> type)
      Remove an extension based on its class type.
      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

      <E extends Extension<O>> Collection<E> getExtensions()
      Get all extensions associated with this extendable object..
      Returns:
      all extensions associated to this extendable object.
    • getImplementationName

      default String getImplementationName()
      Returns a name that is used to find matching ExtensionAdderProviders when selecting implementations of extensions in newExtension(java.lang.Class<B>). This is meant to be overriden by extendables when multiple implementations exist.
      Returns:
      the name
    • newExtension

      default <E extends Extension<O>, B extends ExtensionAdder<O, E>> B newExtension(Class<B> type)
      Returns an extensionAdder to build and add an extension for this extendable.

      The extension implementation is selected at runtime based on matching the getImplementationName() of this extendable to the ExtensionAdderProvider.getImplementationName() of a provider. Implementations are loaded with java's ServiceLoader using the ExtensionAdderProvider interface.

      Parameters:
      type - The interface of the ExtensionAdder
      Returns:
      the adder