Package de.craftsblock.craftsnet.api
Interface RouteRegistry.Mapping
- All Known Implementing Classes:
RouteRegistry.EndpointMapping,RouteRegistry.ShareMapping
- Enclosing class:
- RouteRegistry
public static interface RouteRegistry.Mapping
A universal interface for mappings.
Provides default methods for checking and retrieving metadata about requirements indexed by annotation types.
- Since:
- 3.0.3-SNAPSHOT
-
Method Summary
Modifier and TypeMethodDescriptiondefault <A extends Annotation,T>
@Unmodifiable TgetRequirements(@NotNull Class<A> annotation) Retrieves a value associated with a specific annotation's default key ("value").default <A extends Annotation,T>
@Unmodifiable TgetRequirements(@NotNull Class<A> annotation, @NotNull String key) Retrieves a value associated with a specific annotation's requirements key.default <A extends Annotation>
booleanChecks whether a specific annotation is present in the mapping's requirements.default <A extends Annotation>
booleanChecks whether a specific key within an annotation's requirements is present.
-
Method Details
-
isPresent
Checks whether a specific annotation is present in the mapping's requirements.- Parameters:
annotation- The annotation class to check for.- Returns:
trueif the annotation is present,falseotherwise.
-
isPresent
default <A extends Annotation> boolean isPresent(@NotNull @NotNull Class<A> annotation, @NotNull @NotNull String key) Checks whether a specific key within an annotation's requirements is present.- Parameters:
annotation- The annotation class to check for.key- The specific key to check within the annotation's requirements.- Returns:
trueif the key is present,falseotherwise.
-
getRequirements
default <A extends Annotation,T> @Unmodifiable T getRequirements(@NotNull @NotNull Class<A> annotation) Retrieves a value associated with a specific annotation's default key ("value").- Parameters:
annotation- The annotation class to retrieve the value from.- Returns:
- The value associated with the annotation's default key, or
nullif not present.
-
getRequirements
default <A extends Annotation,T> @Unmodifiable T getRequirements(@NotNull @NotNull Class<A> annotation, @NotNull @NotNull String key) Retrieves a value associated with a specific annotation's requirements key.- Parameters:
annotation- The annotation class to retrieve the value from.key- The specific key to retrieve from the annotation's requirements.- Returns:
- The value associated with the given key, or
nullif not present.
-