Class JsonApiObject

java.lang.Object
com.toedter.spring.hateoas.jsonapi.JsonApiObject

public class JsonApiObject extends Object
This class represents a JSON:API object compliant to the see JSON:API 1.1 specification.
  • Constructor Details

    • JsonApiObject

      public JsonApiObject()
      Creates an empty JSON:API object for deserialization.
    • JsonApiObject

      public JsonApiObject(boolean showVersion, @Nullable List<URI> ext, @Nullable List<URI> profile, @Nullable Map<String,Object> meta)
      Creates a JSON:API object compliant to the see JSON:API 1.1 spec.
      Parameters:
      showVersion - true, if JSON:API version should be rendered
      ext - list of JSON:API extensions
      profile - list of JSON:API profiles
      meta - the JSON:API object meta
    • JsonApiObject

      public JsonApiObject(boolean showVersion)
      Creates a JSON:API object compliant to the see JSON:API 1.1 spec.
      Parameters:
      showVersion - true, if JSON:API version should be rendered
  • Method Details

    • getVersion

      public @Nullable String getVersion()
      Gets the supported JSON:API version.
      Returns:
      the supported JSON:API version ("1.1") or null
    • getExt

      public @Nullable List<URI> getExt()
      Gets the list of JSON:API extensions.
      Returns:
      list of JSON:API extensions or null
    • getProfile

      public @Nullable List<URI> getProfile()
      Gets the list of JSON:API profiles.
      Returns:
      list of JSON:API profiles or null
    • getMeta

      public @Nullable Map<String,Object> getMeta()
      Gets the JSON:API object meta.
      Returns:
      the JSON:API object meta or null