Class HalResourceFactory

    • Method Detail

      • convert

        @Deprecated
        public static com.fasterxml.jackson.databind.node.ObjectNode convert​(Object input)
        Deprecated.
        use a Jackson ObjectMapper instead
        Converts any object into a JSON ObjectNode.
        Parameters:
        input - Any object
        Returns:
        JSON object node
      • createLink

        @Deprecated
        public static Link createLink​(String href)
        Deprecated.
        use the constructor instead
        Creates a HAL link with the given HREF.
        Parameters:
        href - Link HREF
        Returns:
        Link
      • createResource

        @Deprecated
        public static HalResource createResource​(String href)
        Deprecated.
        just create HalResource and Link instances using the new constructors
        Creates a HAL resource with empty state but a self link. Mostly needed for index resources.
        Parameters:
        href - The self HREF for the resource
        Returns:
        New HAL resource
      • createResource

        @Deprecated
        public static HalResource createResource​(Object model,
                                                 String href)
        Deprecated.
        just create HalResource and Link instances using the new constructors
        Creates a HAL resource with state and a self link.
        Parameters:
        model - The state of the resource
        href - The self link for the resource
        Returns:
        New HAL resource
      • createResource

        @Deprecated
        public static HalResource createResource​(com.fasterxml.jackson.databind.node.ObjectNode model,
                                                 String href)
        Deprecated.
        just create HalResource and Link instances using the new constructors
        Creates a HAL resource with state and a self link.
        Parameters:
        model - The state of the resource
        href - The self link for the resource
        Returns:
        New HAL resource
      • getStateAsObject

        @Deprecated
        public static <T> T getStateAsObject​(HalResource halResource,
                                             Class<T> type)
        Converts the JSON model to an object of the given type.
        Type Parameters:
        T - Output type
        Parameters:
        halResource - HAL resource with model to convert
        type - Type of the requested object
        Returns:
        State as object