Package com.powsybl.commons.extensions
Interface Extendable<O>
- All Known Subinterfaces:
Battery
,Branch<I>
,Bus
,BusbarSection
,ComputationParameters
,Connectable<I>
,Container<I>
,DanglingLine
,FaultResult
,Generator
,HvdcConverterStation<T>
,HvdcLine
,Identifiable<I>
,Injection<I>
,LccConverterStation
,Line
,Load
,Network
,NetworkExt
,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
,NetworkMetadata
,OperatorStrategy
,SecurityAnalysisParameters
,SecurityAnalysisReport
,SecurityAnalysisResult
,SensitivityAnalysisParameters
,ShortCircuitAnalysisResult
,ShortCircuitParameters
,SubnetworkImpl
,ThreeWindingsTransformerResult
public interface Extendable<O>
- Author:
- Mathieu Bague <mathieu.bague at rte-france.com>
-
Method Summary
Modifier and TypeMethodDescriptionaddExtension
(Class<? super E> type, E extension) Add en extension to this extendable object.getExtension
(Class<? super E> type) Get an extension based on its class type.getExtensionByName
(String name) Get an extension based on its name.<E extends Extension<O>>
Collection<E>Get all extensions associated with this extendable object..default String
Returns a name that is used to find matchingExtensionAdderProvider
s when selecting implementations of extensions innewExtension(java.lang.Class<B>)
.default <E extends Extension<O>,
B extends ExtensionAdder<O, E>>
BnewExtension
(Class<B> type) Returns an extensionAdder to build and add an extension for this extendable.removeExtension
(Class<E> type) Remove an extension based on its class type.
-
Method Details
-
addExtension
Add en extension to this extendable object.- Type Parameters:
E
- the extension type- Parameters:
type
- the extension class typeextension
- the extension
-
getExtension
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
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
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
Get all extensions associated with this extendable object..- Returns:
- all extensions associated to this extendable object.
-
getImplementationName
Returns a name that is used to find matchingExtensionAdderProvider
s when selecting implementations of extensions innewExtension(java.lang.Class<B>)
. This is meant to be overriden by extendables when multiple implementations exist.- Returns:
- the name
-
newExtension
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 theExtensionAdderProvider.getImplementationName()
of a provider. Implementations are loaded with java'sServiceLoader
using the ExtensionAdderProvider interface.- Parameters:
type
- The interface of the ExtensionAdder- Returns:
- the adder
-