Class FieldDefinitionImpl

java.lang.Object
com.commercetools.importapi.models.types.FieldDefinitionImpl
All Implemented Interfaces:
FieldDefinition, io.vrap.rmf.base.client.ModelBase

public class FieldDefinitionImpl extends Object implements FieldDefinition, io.vrap.rmf.base.client.ModelBase

Defines a Custom Field and its meta-information. Maps to Type.FieldDefinition.

  • Constructor Details

  • Method Details

    • getType

      public FieldType getType()

      Data type of the Custom Field to define.

      Specified by:
      getType in interface FieldDefinition
      Returns:
      type
    • getName

      public String getName()

      Name of the Custom Field to define. Must be unique for a given ResourceTypeId. In case there is a FieldDefinition with the same name in another Type, both FieldDefinitions must have the same type. This value cannot be changed after the Type is imported.

      Specified by:
      getName in interface FieldDefinition
      Returns:
      name
    • getLabel

      A human-readable label for the field.

      Specified by:
      getLabel in interface FieldDefinition
      Returns:
      label
    • getRequired

      public Boolean getRequired()

      Defines whether the field is required to have a value. This value cannot be changed after the Type is imported.

      Specified by:
      getRequired in interface FieldDefinition
      Returns:
      required
    • getInputHint

      Provides a visual representation type for this field. It is only relevant for string-based field types like CustomFieldStringType and CustomFieldLocalizedStringType.

      Specified by:
      getInputHint in interface FieldDefinition
      Returns:
      inputHint
    • setType

      public void setType(FieldType type)
      Description copied from interface: FieldDefinition

      Data type of the Custom Field to define.

      Specified by:
      setType in interface FieldDefinition
      Parameters:
      type - value to be set
    • setName

      public void setName(String name)
      Description copied from interface: FieldDefinition

      Name of the Custom Field to define. Must be unique for a given ResourceTypeId. In case there is a FieldDefinition with the same name in another Type, both FieldDefinitions must have the same type. This value cannot be changed after the Type is imported.

      Specified by:
      setName in interface FieldDefinition
      Parameters:
      name - value to be set
    • setLabel

      public void setLabel(LocalizedString label)
      Description copied from interface: FieldDefinition

      A human-readable label for the field.

      Specified by:
      setLabel in interface FieldDefinition
      Parameters:
      label - value to be set
    • setRequired

      public void setRequired(Boolean required)
      Description copied from interface: FieldDefinition

      Defines whether the field is required to have a value. This value cannot be changed after the Type is imported.

      Specified by:
      setRequired in interface FieldDefinition
      Parameters:
      required - value to be set
    • setInputHint

      public void setInputHint(TypeTextInputHint inputHint)
      Description copied from interface: FieldDefinition

      Provides a visual representation type for this field. It is only relevant for string-based field types like CustomFieldStringType and CustomFieldLocalizedStringType.

      Specified by:
      setInputHint in interface FieldDefinition
      Parameters:
      inputHint - value to be set
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object