Interface KeyReference

All Superinterfaces:
WithKey
All Known Subinterfaces:
AssociateRoleKeyReference, BusinessUnitKeyReference, StoreKeyReference

public interface KeyReference extends WithKey

A KeyReference represents a loose reference to another resource in the same Project identified by the resource's key field. If available, the key is immutable and mandatory. KeyReferences do not support Reference Expansion.


Example to create a subtype instance using the builder pattern

     KeyReference keyReference = KeyReference.associateRoleBuilder()
             key("{key}")
             .build()
 
  • Method Details

    • getTypeId

      @NotNull @NotNull ReferenceTypeId getTypeId()

      Type of referenced resource.

      Returns:
      typeId
    • getKey

      @NotNull @NotNull String getKey()

      User-defined unique and immutable key of the referenced resource.

      Specified by:
      getKey in interface WithKey
      Returns:
      key
    • setKey

      void setKey(String key)

      User-defined unique and immutable key of the referenced resource.

      Parameters:
      key - value to be set
    • deepCopy

      @Nullable static KeyReference deepCopy(@Nullable KeyReference template)
      factory method to create a deep copy of KeyReference
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • associateRoleBuilder

      static AssociateRoleKeyReferenceBuilder associateRoleBuilder()
      builder for associateRole subtype
      Returns:
      builder
    • businessUnitBuilder

      static BusinessUnitKeyReferenceBuilder businessUnitBuilder()
      builder for businessUnit subtype
      Returns:
      builder
    • storeBuilder

      static StoreKeyReferenceBuilder storeBuilder()
      builder for store subtype
      Returns:
      builder
    • withKeyReference

      default <T> T withKeyReference(Function<KeyReference,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<KeyReference> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference