Module com.powsybl.commons
Package com.powsybl.commons.extensions
Class AbstractExtensionAdder<T extends Extendable<T>,E extends Extension<T>>
- java.lang.Object
-
- com.powsybl.commons.extensions.AbstractExtensionAdder<T,E>
-
- All Implemented Interfaces:
ExtensionAdder<T,E>
public abstract class AbstractExtensionAdder<T extends Extendable<T>,E extends Extension<T>> extends Object implements ExtensionAdder<T,E>
A base class for implementations ofExtensionAdder
that holds the extendable to be able build and then add the extension to the extendable. This class callscreateExtension(T)
that must be overriden by subclasses to create the extension.- Author:
- Jon Harper
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractExtensionAdder(T extendable)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description E
add()
Builds and adds the extension to the extendable which was used to get this extensionAdder.protected abstract E
createExtension(T extendable)
Creates the extension.-
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.ExtensionAdder
getExtensionClass
-
-
-
-
Constructor Detail
-
AbstractExtensionAdder
protected AbstractExtensionAdder(T extendable)
-
-
Method Detail
-
createExtension
protected abstract E createExtension(T extendable)
Creates the extension.- Returns:
- the extension
-
add
public E add()
Description copied from interface:ExtensionAdder
Builds and adds the extension to the extendable which was used to get this extensionAdder. The extendable is returned to allow a fluent style adding of multiple extensions.- Specified by:
add
in interfaceExtensionAdder<T extends Extendable<T>,E extends Extension<T>>
- Returns:
- the extendable
-
-