Package org.incendo.cloud.caption
Interface CaptionProvider<C>
- All Known Implementing Classes:
ConstantCaptionProvider,DelegatingCaptionProvider,ImmutableConstantCaptionProvider,StandardCaptionsProvider
-
Method Summary
Modifier and TypeMethodDescriptionstatic <C> @NonNull ImmutableConstantCaptionProvider.Builder<C> Returns a builder for aConstantCaptionProvider.static <C> @NonNull CaptionProvider<C> constantProvider(@NonNull Caption caption, @NonNull String value) static <C> @NonNull CaptionProvider<C> Returns aCaptionProviderthat only returns values for the givencaption, and returnsnullfor all other captions.Returns the value of the givencaptionfor the givenrecipient, if it recognized by this provider.
-
Method Details
-
constantProvider
Returns a builder for aConstantCaptionProvider.- Type Parameters:
C- the command sender type- Returns:
- the builder
-
constantProvider
static <C> @NonNull CaptionProvider<C> constantProvider(@NonNull Caption caption, @NonNull String value) - Type Parameters:
C- the command sender type- Parameters:
caption- the caption keyvalue- the value- Returns:
- the provider
-
forCaption
static <C> @NonNull CaptionProvider<C> forCaption(@NonNull Caption caption, @NonNull Function<@NonNull C, @Nullable String> provider) Returns aCaptionProviderthat only returns values for the givencaption, and returnsnullfor all other captions.- Type Parameters:
C- the command sender type- Parameters:
caption- the caption keyprovider- the provider of the value- Returns:
- the provider
-
provide
Returns the value of the givencaptionfor the givenrecipient, if it recognized by this provider.- Parameters:
caption- the caption keyrecipient- the recipient- Returns:
- the caption, or
null
-