Interface IModelObject.IJsonUtil<T>

    • Method Detail

      • hasAndNotNull

        boolean hasAndNotNull​(com.google.gson.JsonObject jsonObject,
                              String memberName)
        Check whether the supplied JSON object contains data in the given member, which is not null.
        Parameters:
        jsonObject - The JSON object.
        memberName - The member name.
        Returns:
        Whether the supplied JSON object contains data in the given member.
      • createModelObject

        T createModelObject​(com.google.gson.JsonObject jsonObject)
        Build a model object with the information given in a json object.
        The type of the model object and its methods depend on its corresponding implementation.
        Parameters:
        jsonObject - A json object.
        Returns:
        A model object. The type depends on this methods implementation.
      • createModelObject

        T createModelObject​(String json)
        Build a model object with the information given in a json string.
        The type of the model object and its methods depend on its corresponding implementation.
        Parameters:
        json - A json object.
        Returns:
        A model object. The type depends on this methods implementation.
      • createModelObjectArray

        T[] createModelObjectArray​(com.google.gson.JsonArray jsonArray)
        Create an array of model objects out of a json array object.
        Parameters:
        jsonArray - A JsonArray.
        Returns:
        A model object array. The type depends on this methods implementation.
      • createModelObjectArray

        T[] createModelObjectArray​(String json)
        Create an array of model objects out of a json string.
        Parameters:
        json - A JsonArray.
        Returns:
        A model object array. The type depends on this methods implementation.
      • createModelObjectArray

        T[] createModelObjectArray​(String json,
                                   String key)
        Create an array of model objects out of a json array, which is contained in a json object.
        Parameters:
        json - A JsonObject.
        key - The key of the json array in the json object.
        Returns:
        A model object array. The type depends on this methods implementation.
      • createModelObjectArray

        <X> X[] createModelObjectArray​(com.google.gson.JsonArray jsonArray,
                                       Class<X> clazz)
        Create an array of model objects out of a json array object and a Class object.
        Type Parameters:
        X - The model object type of the array and class object.
        Parameters:
        jsonArray - A json array object.
        clazz - The class object.
        Returns:
        A model object array.
      • createModelObjectPaging

        Paging<T> createModelObjectPaging​(com.google.gson.JsonObject jsonObject)
        Create a paging of model objects out of a json object.
        Parameters:
        jsonObject - A json object.
        Returns:
        A model object paging.
      • createModelObjectPaging

        Paging<T> createModelObjectPaging​(String json)
        Create a paging of model objects out of a json string.
        Parameters:
        json - A json string.
        Returns:
        A model object paging.
      • createModelObjectPaging

        Paging<T> createModelObjectPaging​(String json,
                                          String key)
        Create a paging of model objects out of a json array, which is contained in a json object.
        Parameters:
        json - A JsonObject.
        key - The key of the json array in the json object.
        Returns:
        A model object array. The type depends on this methods implementation.
      • createModelObjectPagingCursorbased

        PagingCursorbased<T> createModelObjectPagingCursorbased​(com.google.gson.JsonObject jsonObject)
        Create a cursor-based paging of model objects out of a json object.
        Parameters:
        jsonObject - A json object.
        Returns:
        A cursor-based model object paging.
      • createModelObjectPagingCursorbased

        PagingCursorbased<T> createModelObjectPagingCursorbased​(String json)
        Create a cursor-based paging of model objects out of a json string.
        Parameters:
        json - A json string.
        Returns:
        A cursor-based model object paging.
      • createModelObjectPagingCursorbased

        PagingCursorbased<T> createModelObjectPagingCursorbased​(String json,
                                                                String key)
        Create a cursor-based paging of model objects out of a json array, which is contained in a json object.
        Parameters:
        json - A JsonObject.
        key - The key of the json array in the json object.
        Returns:
        A cursor-based model object paging.