Record Class Embeds
java.lang.Object
java.lang.Record
io.github.kaktushose.jdac.embeds.internal.Embeds
- Record Components:
sources- theEmbedDataSourcesEmbeds can be loaded fromplaceholders- the global placeholders as defined inEmbedConfig.placeholders(Map)
@Internal
public record Embeds(Collection<EmbedDataSource> sources, Map<String,Object> placeholders, MessageResolver messageResolver)
extends Record
Container for immutably holding the embed configuration made by
EmbedConfig.-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionEmbeds(Collection<EmbedDataSource> sources, Map<String, Object> placeholders, MessageResolver messageResolver) Creates an instance of aEmbedsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.booleanGets anEmbedbased on the given name.final inthashCode()Returns a hash code value for this object.Returns the value of themessageResolverrecord component.Returns the value of theplaceholdersrecord component.sources()Returns the value of thesourcesrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Embeds
public Embeds(Collection<EmbedDataSource> sources, Map<String, Object> placeholders, MessageResolver messageResolver) Creates an instance of aEmbedsrecord class.- Parameters:
sources- the value for thesourcesrecord componentplaceholders- the value for theplaceholdersrecord componentmessageResolver- the value for themessageResolverrecord component
-
-
Method Details
-
get
Gets anEmbedbased on the given name.- Parameters:
name- the name of theEmbed- Returns:
- the
Embed - Throws:
IllegalArgumentException- if noEmbedwith the given name exists in the configured data sources
-
get
- Parameters:
name- the name of theEmbedlocale- theLocaleto use for localization- Returns:
- the
Embed - Throws:
IllegalArgumentException- if noEmbedwith the given name exists in the configured data sources
-
exists
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
sources
-
placeholders
Returns the value of theplaceholdersrecord component.- Returns:
- the value of the
placeholdersrecord component
-
messageResolver
Returns the value of themessageResolverrecord component.- Returns:
- the value of the
messageResolverrecord component
-