Class ResponseExtensions


  • public final class ResponseExtensions
    extends Object
    Fixes the JAX RS API a bit...
    Author:
    aherscu
    • Method Detail

      • closeThis

        public static jakarta.ws.rs.core.Response closeThis​(jakarta.ws.rs.core.Response thisResponse)
        Closes this response and returns it; enables fluent coding style.

        Assuming that you have the Lombok library in your classpath, then applying @ExtensionMethod({ ResponseExtensions.class }) on your class will allow you to use target.request().get().closeThis().getCookies()..., where target is a WebTarget.

        Parameters:
        thisResponse - this response
        Returns:
        the closed response
        See Also:
        Response.close()