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(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

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

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

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

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