Package eu.bandm.tools.util.java
Interface EntryPoint<T>
- Type Parameters:
T
- the main object of the application
- All Known Implementing Classes:
FileTree.EntryPoint
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A factory for an application entry point.
An instance of this interface creates a main object parameterized with an array of command line arguments. What to do with that object is application-specific.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
A generic application main class. -
Method Summary
Modifier and TypeMethodDescriptioncreateMainInstance
(String... args) Creates a new application main object.default T
createMainInstance
(String[] args, int offset) Creates a new application main object.
-
Method Details
-
createMainInstance
Creates a new application main object.- Parameters:
args
- an array of command line arguments, where the first ones are potentially meant for a higher leveloffset
- then index of the first command line argument that is application-specific- Returns:
- a main object for the application
- Throws:
IllegalArgumentException
- ifoffset
is negative or greater than the length ofargs
IndexOutOfBoundsException
- if there are not enough remaining command line arguments
-
createMainInstance
Creates a new application main object.- Parameters:
args
- an array of application-specific command line arguments- Returns:
- a main object for the application
- Throws:
IndexOutOfBoundsException
- if there are not enough remaining command line arguments
-