Class ETagResource<T>

    • Method Detail

      • match

        public <R> R match​(ETagResource.Matcher<T,​R> matcher)
        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

        public static <T> ETagResource<T> modified​(ETag tag,
                                                   T resource)
        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

        public static <T> ETagResource<T> 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

        public static <T> ETagResource<T> notModified()
        Gets an ETag resource representing a resource that was not modified.
        Type Parameters:
        T - Type of the resource.
        Returns:
        A new ETag resource.