Class ContentTypeRequirement
java.lang.Object
de.craftsblock.craftsnet.api.requirements.Requirement<Request,RouteRegistry.EndpointMapping>
de.craftsblock.craftsnet.api.requirements.web.WebRequirement
de.craftsblock.craftsnet.api.requirements.web.ContentTypeRequirement
A specific web requirement that checks if the content-type of an HTTP request matches certain criteria.
- Since:
- 3.0.5-SNAPSHOT
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanapplies(Request request, RouteRegistry.EndpointMapping endpointMapping) Checks if the requirement applies given the specified request and route mapping.Methods inherited from class de.craftsblock.craftsnet.api.requirements.Requirement
getAnnotation
-
Constructor Details
-
ContentTypeRequirement
public ContentTypeRequirement()Constructs a new content type requirement.
-
-
Method Details
-
applies
Checks if the requirement applies given the specified request and route mapping.- Specified by:
appliesin classRequirement<Request,RouteRegistry.EndpointMapping> - Parameters:
request- the HTTP requestendpointMapping- the route mapping- Returns:
trueif the requirement applies,falseotherwise
-