Interface CustomFields

All Superinterfaces:
CustomFieldsMixin

public interface CustomFields extends CustomFieldsMixin

Serves as value of the custom field on a resource or data type customized with a Type.


Example to create an instance using the builder pattern

     CustomFields customFields = CustomFields.builder()
             .type(typeBuilder -> typeBuilder)
             .fields(fieldsBuilder -> fieldsBuilder)
             .build()
 
  • Method Details

    • getType

      @NotNull @Valid @NotNull @Valid TypeReference getType()

      Reference to the Type that holds the FieldDefinitions for the Custom Fields.

      Specified by:
      getType in interface CustomFieldsMixin
      Returns:
      type
    • getFields

      @NotNull @Valid @NotNull @Valid FieldContainer getFields()

      Object containing the Custom Fields for the customized resource or data type.

      Specified by:
      getFields in interface CustomFieldsMixin
      Returns:
      fields
    • setType

      void setType(TypeReference type)

      Reference to the Type that holds the FieldDefinitions for the Custom Fields.

      Parameters:
      type - value to be set
    • setFields

      void setFields(FieldContainer fields)

      Object containing the Custom Fields for the customized resource or data type.

      Parameters:
      fields - value to be set
    • of

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

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

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

      static CustomFieldsBuilder builder()
      builder factory method for CustomFields
      Returns:
      builder
    • builder

      static CustomFieldsBuilder builder(CustomFields template)
      create builder for CustomFields instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withCustomFields

      default <T> T withCustomFields(Function<CustomFields,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<CustomFields> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference