Interface DurationFunction<C>
- Type Parameters:
C- command sender type
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A function that generates a duration from a command context.
- Since:
- 1.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic <C> @NonNull DurationFunction<C>Creates a new duration function that always returnsduration.getDuration(@NonNull CommandContext<C> context) Returns the duration for the givencontext.
-
Method Details
-
constant
Creates a new duration function that always returnsduration.- Type Parameters:
C- command sender type- Parameters:
duration- constant duration- Returns:
- the duration function
-
getDuration
Returns the duration for the givencontext.- Parameters:
context- the context to get the duration for- Returns:
- the duration
-