Class Embeds.Configuration
java.lang.Object
io.github.kaktushose.jdac.embeds.internal.Embeds.Configuration
- All Implemented Interfaces:
EmbedConfig
- Enclosing class:
Embeds
-
Constructor Summary
ConstructorsConstructorDescriptionConfiguration(MessageResolver messageResolver) Constructs a new embed configuration builder. -
Method Summary
Modifier and TypeMethodDescriptionConverts this configuration into anEmbedsinstance that should be used globally.Converts this configuration into anEmbedsinstance that should only be used byDefaultErrorMessageFactory.errorSource(EmbedDataSource source) Adds a newEmbedDataSourcethat will be used by theDefaultErrorMessageFactoryto load the error messages from.placeholders(Entry... placeholders) Adds one or more new global placeholders.placeholders(Map<String, Object> placeholders) Adds global placeholders with the values of the given map, where the key of the map represents the name of the placeholder and the value of the map the value to replace the placeholder with.sources(EmbedDataSource... source) Adds a newEmbedDataSourcethatEmbeds can be loaded from.
-
Constructor Details
-
Configuration
Constructs a new embed configuration builder.
-
-
Method Details
-
placeholders
Description copied from interface:EmbedConfigAdds one or more new global placeholders. Global placeholders will be available for anyEmbedloaded by this API.- Specified by:
placeholdersin interfaceEmbedConfig- Parameters:
placeholders- theentriesto add- Returns:
- this instance for fluent interface
-
placeholders
Description copied from interface:EmbedConfigAdds global placeholders with the values of the given map, where the key of the map represents the name of the placeholder and the value of the map the value to replace the placeholder with.
Global placeholders will be available for any
Embedloaded by this API.- Specified by:
placeholdersin interfaceEmbedConfig- Parameters:
placeholders- theMapto get the values from- Returns:
- this instance for fluent interface
-
sources
Description copied from interface:EmbedConfigAdds a newEmbedDataSourcethatEmbeds can be loaded from.- Specified by:
sourcesin interfaceEmbedConfig- Parameters:
source- theEmbedDataSourceto add- Returns:
- this instance for fluent interface
-
errorSource
Description copied from interface:EmbedConfigAdds a newEmbedDataSourcethat will be used by theDefaultErrorMessageFactoryto load the error messages from.- Specified by:
errorSourcein interfaceEmbedConfig- Parameters:
source- theEmbedDataSourceto load the error embeds from- Returns:
- this instance for fluent interface
-
buildDefault
-
buildError
Converts this configuration into anEmbedsinstance that should only be used byDefaultErrorMessageFactory.- Returns:
- an
Embedsinstance for usage insideDefaultErrorMessageFactory
-