Class Builders


  • public final class Builders
    extends java.lang.Object
    Creates builders.
    Since:
    1.0 (Sling API Bundle 2.24.0)
    • Method Detail

      • newRequestBuilder

        @NotNull
        public static @NotNull SlingHttpServletRequestBuilder newRequestBuilder​(@NotNull
                                                                                @NotNull Resource resource)
        Creates a new request builder.
        Parameters:
        resource - the resource on which the request is based
        Returns:
        a request builder
        Throws:
        java.lang.IllegalArgumentException - If resource is null
      • newResponseBuilder

        @NotNull
        public static @NotNull SlingHttpServletResponseBuilder newResponseBuilder()
        Creates a new response builder.
        Returns:
        a response builder
      • newRequestProgressTracker

        @NotNull
        public static @NotNull RequestProgressTracker newRequestProgressTracker()
        Creates a new request progress tracker
        Returns:
        a request progress tracker
        Since:
        1.1 (Sling API Bundle 2.25.0)
      • newRequestParameter

        @NotNull
        public static @NotNull RequestParameter newRequestParameter​(java.lang.String name,
                                                                    java.lang.String value)
        Creates a new request parameter
        Parameters:
        name - the parameter name
        value - the parameter value
        Returns:
        a request parameter
        Since:
        1.2 (Sling API Bundle 2.26.2)
      • newRequestParameter

        @NotNull
        public static @NotNull RequestParameter newRequestParameter​(java.lang.String name,
                                                                    java.lang.String value,
                                                                    java.nio.charset.Charset encoding)
        Creates a new request parameter
        Parameters:
        name - the parameter name
        value - the parameter value
        encoding - the charset of the value
        Returns:
        a request parameter
        Since:
        1.2 (Sling API Bundle 2.26.2)