Package picocli
Interface CommandLine.Model.IExtensible
- Enclosing class:
CommandLine.Model
public static interface CommandLine.Model.IExtensible
Interface to allow extending the capabilities of other interface without Java 8 default methods.
Example usage:
// suppose we want to add a method `getInitialValueState` to `IAnnotatedElement`
IAnnotatedElement element = getAnnotatedElement();
if (element instanceof IExtensible) {
InitialValueState state = ((IExtensible) element).getExtension(InitialValueState.class);
if (state != null) {
// ...
}
}
- Since:
- 4.3
-
Method Summary
Modifier and TypeMethodDescription<T> TgetExtension(Class<T> cls) Returns an instance of the specified class, ornullif this extension is not supported.
-
Method Details
-
getExtension
Returns an instance of the specified class, ornullif this extension is not supported.- Parameters:
cls- class of the desired extension
-