-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fe4b191
commit 477597c
Showing
5 changed files
with
48 additions
and
3 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
...ain/java/com/github/kaktushose/jda/commands/definitions/description/ClassDescription.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.github.kaktushose.jda.commands.definitions.description; | ||
|
||
import java.lang.annotation.Annotation; | ||
import java.util.Collection; | ||
|
||
public record ClassDescription( | ||
Class<?> clazz, | ||
String name, | ||
Collection<Annotation> annotations, | ||
Collection<MethodDescription> methods | ||
) {} |
6 changes: 6 additions & 0 deletions
6
src/main/java/com/github/kaktushose/jda/commands/definitions/description/Descriptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.github.kaktushose.jda.commands.definitions.description; | ||
|
||
import java.util.function.Function; | ||
|
||
public interface Descriptor extends Function<Class<?>, ClassDescription> { | ||
} |
18 changes: 18 additions & 0 deletions
18
...in/java/com/github/kaktushose/jda/commands/definitions/description/MethodDescription.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.github.kaktushose.jda.commands.definitions.description; | ||
|
||
import java.lang.annotation.Annotation; | ||
import java.util.Collection; | ||
import java.util.SequencedCollection; | ||
import java.util.function.BiFunction; | ||
|
||
public record MethodDescription( | ||
Class<?> returnType, | ||
String name, | ||
Collection<ParameterDescription> parameters, | ||
Collection<Annotation> annotations, | ||
BiFunction<Object, SequencedCollection<Object>, Object> invoker | ||
) { | ||
public Object invoke(Object instance, SequencedCollection<Object> arguments) { | ||
return invoker.apply(instance, arguments); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...java/com/github/kaktushose/jda/commands/definitions/description/ParameterDescription.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.github.kaktushose.jda.commands.definitions.description; | ||
|
||
import java.lang.annotation.Annotation; | ||
import java.util.Collection; | ||
|
||
public record ParameterDescription( | ||
Class<?> type, | ||
Collection<Annotation> annotations | ||
) { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters