Package com.powsybl.commons.extensions
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
,NetworkMetadata
,OperatorStrategy
,SecurityAnalysisParameters
,SecurityAnalysisReport
,SecurityAnalysisResult
,SensitivityAnalysisParameters
,ShortCircuitAnalysisResult
,ShortCircuitParameters
,SubnetworkImpl
,ThreeWindingsTransformerResult
- Author:
- Mathieu Bague <mathieu.bague at rte-france.com>
-
Constructor Summary
-
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.Get all extensions associated with this extendable object..Returns a name that is used to find matchingExtensionAdderProvider
s when selecting implementations of extensions inExtendable.newExtension(java.lang.Class<B>)
.removeExtension
(Class<E> type) Remove an extension based on its class type.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.powsybl.commons.extensions.Extendable
newExtension
-
Constructor Details
-
AbstractExtendable
public AbstractExtendable()
-
-
Method Details
-
addExtension
Description copied from interface:Extendable
Add en extension to this extendable object.- Specified by:
addExtension
in interfaceExtendable<T>
- Type Parameters:
E
- the extension type- Parameters:
type
- the extension class typeextension
- the extension
-
getExtension
Description copied from interface:Extendable
Get an extension based on its class type.- Specified by:
getExtension
in interfaceExtendable<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
Description copied from interface:Extendable
Get an extension based on its name.- Specified by:
getExtensionByName
in interfaceExtendable<T>
- Parameters:
name
- the extension name- Returns:
- the extension mapped to the name or null if not found
-
removeExtension
Description copied from interface:Extendable
Remove an extension based on its class type.- Specified by:
removeExtension
in interfaceExtendable<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
Description copied from interface:Extendable
Get all extensions associated with this extendable object..- Specified by:
getExtensions
in interfaceExtendable<T>
- Returns:
- all extensions associated to this extendable object.
-
getImplementationName
Description copied from interface:Extendable
Returns a name that is used to find matchingExtensionAdderProvider
s when selecting implementations of extensions inExtendable.newExtension(java.lang.Class<B>)
. This is meant to be overriden by extendables when multiple implementations exist.- Specified by:
getImplementationName
in interfaceExtendable<T>
- Returns:
- the name
-