Interface TypeReference

All Superinterfaces:
Identifiable<Type>, IdentifiableObjHolder<Type>, Reference, ReferenceMixin

public interface TypeReference extends Reference, Identifiable<Type>, IdentifiableObjHolder<Type>

Reference to a Type.


Example to create an instance using the builder pattern

     TypeReference typeReference = TypeReference.builder()
             .id("{id}")
             .build()
 
  • Field Details

  • Method Details

    • getId

      @NotNull @NotNull String getId()

      Unique identifier of the referenced Type.

      Specified by:
      getId in interface Identifiable<Type>
      Specified by:
      getId in interface Reference
      Specified by:
      getId in interface ReferenceMixin
      Returns:
      id
    • getObj

      @Valid @Valid Type getObj()

      Contains the representation of the expanded Type. Only present in responses to requests with Reference Expansion for Types.

      Specified by:
      getObj in interface IdentifiableObjHolder<Type>
      Returns:
      obj
    • setId

      void setId(String id)

      Unique identifier of the referenced Type.

      Specified by:
      setId in interface Reference
      Parameters:
      id - value to be set
    • setObj

      void setObj(Type obj)

      Contains the representation of the expanded Type. Only present in responses to requests with Reference Expansion for Types.

      Parameters:
      obj - value to be set
    • of

      static TypeReference of()
      factory method
      Returns:
      instance of TypeReference
    • of

      static TypeReference of(TypeReference template)
      factory method to create a shallow copy TypeReference
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

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

      static TypeReferenceBuilder builder()
      builder factory method for TypeReference
      Returns:
      builder
    • builder

      static TypeReferenceBuilder builder(TypeReference template)
      create builder for TypeReference instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withTypeReference

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

      default TypeResourceIdentifier toResourceIdentifier()
      Specified by:
      toResourceIdentifier in interface ReferenceMixin
    • typeReference

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