Class ApiVersionHolder
java.lang.Object
org.springframework.web.accept.ApiVersionHolder
Simple container of the API version for a request (possibly
null),
or an exception that resulted from trying to resolve, parse, and validate
the version.
While an API version needs to be initialized early, given that each
HandlerMapping may or may not expect an API version, it is important
to defer raising API version errors until it is known if the
HandlerMapping will handle the request.
- Since:
- 7.0
- Author:
- Rossen Stoyanchev
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ApiVersionHolderStatic instance for a request without an API version. -
Method Summary
Modifier and TypeMethodDescriptionstatic ApiVersionHolderstatic ApiVersionHolderfromVersion(@Nullable Comparable<?> version) getError()Comparable<?> booleanhasError()boolean
-
Field Details
-
EMPTY
Static instance for a request without an API version.
-
-
Method Details
-
hasVersion
public boolean hasVersion() -
hasError
public boolean hasError() -
getVersion
-
getVersionIfPresent
-
getError
-
fromVersion
-
fromError
-