Class ETagResource<T>
java.lang.Object
de.xima.fc.common.etag.ETagResource<T>
- Type Parameters:
T- Type of the resource.
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ETagResource.Modified, ETagResource.NotFound, ETagResource.NotModified
Represents a resource cached via the ETag mechanism. An etag resource has three possible states: (1) The resource was
not found. (2) The resource was not modified. (3) The resource was modified.
- Since:
- 8.3.0
- Author:
- XIMA MEDIA GmbH
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceMatcher for the different states of anETagResource.static final classAnETagResourcethat represents a resource that was modified.static final classAnETagResourcethat represents a resource that was not found.static final classAnETagResourcethat represents a resource that was not modified. -
Method Summary
Modifier and TypeMethodDescription<R> Rmatch(ETagResource.Matcher<T, R> matcher) Matches this resource against the given matcher.static <T> ETagResource<T> Creates an ETag resource that represents a modified resource.static <T> ETagResource<T> notFound()Gets an ETag resource representing a resource that was not found.static <T> ETagResource<T> Gets an ETag resource representing a resource that was not modified.
-
Method Details
-
match
Matches this resource against the given matcher. Invokes the method corresponding to the status of this resource.- Type Parameters:
R- Type returned by the matcher.- Parameters:
matcher- Matcher to use.- Returns:
- Result as returned by the matcher.
-
modified
Creates an ETag resource that represents a modified resource.- Type Parameters:
T- Type of the resource.- Parameters:
tag- ETag of the resource, must not be null.resource- Wrapped resource, must not be null.- Returns:
- A new ETag resource.
-
notFound
Gets an ETag resource representing a resource that was not found.- Type Parameters:
T- Type of the resource.- Returns:
- A new ETag resource.
-
notModified
Gets an ETag resource representing a resource that was not modified.- Type Parameters:
T- Type of the resource.- Returns:
- A new ETag resource.
-