public interface Extension<T>
A generic Extension interface should have a generic static method called "clazz" returning its .class as a generic type with a wildcard bounded to the expected extendables to allow clients to type check that they are using the correct Extension for an extendable. For example,
public interface ConnectablePositionextends Extension { //repeat the bounds " " bounds here here > Class > clazz() { return Class > (Class) ConnectablePosition.class; } [...] }
Modifier and Type | Method and Description |
---|---|
T |
getExtendable()
Return the holder of this extension
|
String |
getName()
Return the name of this extension.
|
void |
setExtendable(T extendable)
Set the holder of this extension.
|
String getName()
T getExtendable()
void setExtendable(T extendable)
extendable
- The new holder of this extension, could be nulla
- PowsyblException if this extension is already holded.Copyright © 2020. All rights reserved.