Record Class Implementation<T extends Implementation.ExtensionProvidable>
java.lang.Object
java.lang.Record
com.github.kaktushose.jda.commands.extension.Implementation<T>
- Record Components:
type- theClassof the implemented interfacesupplier- theFunctionused to retrieve instances of the custom implementation
public record Implementation<T extends Implementation.ExtensionProvidable>(Class<T extends Implementation.ExtensionProvidable> type, Function<JDACBuilderData, SequencedCollection<T extends Implementation.ExtensionProvidable>> supplier)
extends Record
Instances of Implementation are used to provide custom implementations of Implementation.ExtensionProvidable interfaces, namely:
ClassFinderDescriptorInteractionControllerInstantiatorErrorMessageFactoryImplementation.MiddlewareContainer(wrapper type forMiddleware)Implementation.TypeAdapterContainer(wrapper type forTypeAdapter)Implementation.ValidatorContainer(wrapper type forValidator)PermissionsProviderGuildScopeProvider
Such instances of Implementation are returned by Extension.providedImplementations() and used by the JDACBuilder to
configure jda-commands.
Note: If the supplier() returns an empty collection, then this Implementation is discarded and thus treated as non-existent.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceA marker interface that all types providable by anExtensionshare.static final recordA container type for providingMiddlewares.static interfacestatic final recordA container type for providingTypeAdapters.static final recordA container type for providingValidators. -
Constructor Summary
ConstructorsConstructorDescriptionImplementation(Class<T> type, Function<JDACBuilderData, SequencedCollection<T>> supplier) Creates an instance of aImplementationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static <T extends Implementation.ExtensionProvidable>
Implementation<T> single(Class<T> type, Function<JDACBuilderData, T> supplier) supplier()Returns the value of thesupplierrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
Method Details
-
single
public static <T extends Implementation.ExtensionProvidable> Implementation<T> single(Class<T> type, Function<JDACBuilderData, T> supplier) -
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). -
type
-
supplier
-