Class Requirement<T extends RequireAble,R extends RouteRegistry.EndpointMapping>
java.lang.Object
de.craftsblock.craftsnet.api.requirements.Requirement<T,R>
- Type Parameters:
T- The type of the storage class that this requirement gets its data from.R- The type of the route mapping class that this requirement uses.
- Direct Known Subclasses:
WebRequirement,WebSocketRequirement
public abstract class Requirement<T extends RequireAble,R extends RouteRegistry.EndpointMapping>
extends Object
Represents an abstract requirement that can be used in the requirement system.
- Since:
- 3.0.5-SNAPSHOT
-
Constructor Summary
ConstructorsConstructorDescriptionRequirement(Class<? extends Annotation> annotation) Constructs a new requirement with the specified annotation class. -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanDetermines if this requirement applies to the specified mapping and content.Class<? extends Annotation>Gets the annotation class that this requirement is associated with.
-
Constructor Details
-
Requirement
Constructs a new requirement with the specified annotation class. The annotation will be used to determine the requirement on the methods of endpoints.- Parameters:
annotation- the annotation class that this requirement is associated with.
-
-
Method Details
-
applies
Determines if this requirement applies to the specified mapping and content.- Parameters:
t- the storage instancer- the route mapping instance- Returns:
trueif the requirement applies,falseotherwise
-
getAnnotation
Gets the annotation class that this requirement is associated with.- Returns:
- the annotation class
-