Class ResourceIdentifierImpl

java.lang.Object
com.commercetools.api.models.common.ResourceIdentifierImpl
All Implemented Interfaces:
ResourceIdentifier, WithKey, io.vrap.rmf.base.client.ModelBase

public class ResourceIdentifierImpl extends Object implements ResourceIdentifier, io.vrap.rmf.base.client.ModelBase

Draft type to create a Reference or a KeyReference to a resource. Provide either the id or (wherever supported) the key of the resource to reference, but depending on the API endpoint the response returns either a Reference or a KeyReference. For example, the field parent of a CategoryDraft takes a ResourceIdentifier for its value while the value of the corresponding field of a Category is a Reference.

Each resource type has its corresponding ResourceIdentifier, like ChannelResourceIdentifier.

  • Nested Class Summary

    Nested classes/interfaces inherited from interface io.vrap.rmf.base.client.ModelBase

    io.vrap.rmf.base.client.ModelBase.FilteredRecursiveToStringStyle
  • Constructor Summary

    Constructors
    Constructor
    Description
    create empty instance
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    Unique identifier of the referenced resource.
    User-defined unique identifier of the referenced resource.
    Type of referenced resource.
    int
     
    void
    Unique identifier of the referenced resource.
    void
    User-defined unique identifier of the referenced resource.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.vrap.rmf.base.client.ModelBase

    reflectionString, reflectionString

    Methods inherited from interface com.commercetools.api.models.common.ResourceIdentifier

    withResourceIdentifier
  • Constructor Details

    • ResourceIdentifierImpl

      public ResourceIdentifierImpl()
      create empty instance
  • Method Details

    • getTypeId

      public ReferenceTypeId getTypeId()

      Type of referenced resource. If given, it must match the expected ReferenceTypeId of the referenced resource.

      Specified by:
      getTypeId in interface ResourceIdentifier
      Returns:
      typeId
    • getId

      public String getId()

      Unique identifier of the referenced resource. Required if key is absent.

      Specified by:
      getId in interface ResourceIdentifier
      Returns:
      id
    • getKey

      public String getKey()

      User-defined unique identifier of the referenced resource. Required if id is absent.

      Specified by:
      getKey in interface ResourceIdentifier
      Specified by:
      getKey in interface WithKey
      Returns:
      key
    • setId

      public void setId(String id)
      Description copied from interface: ResourceIdentifier

      Unique identifier of the referenced resource. Required if key is absent.

      Specified by:
      setId in interface ResourceIdentifier
      Parameters:
      id - value to be set
    • setKey

      public void setKey(String key)
      Description copied from interface: ResourceIdentifier

      User-defined unique identifier of the referenced resource. Required if id is absent.

      Specified by:
      setKey in interface ResourceIdentifier
      Parameters:
      key - value to be set
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object