diff --git a/src/main/java/com/epam/ta/reportportal/ws/model/externalsystem/PostFormField.java b/src/main/java/com/epam/ta/reportportal/ws/model/externalsystem/PostFormField.java index 2f7cedf7..0fb97151 100644 --- a/src/main/java/com/epam/ta/reportportal/ws/model/externalsystem/PostFormField.java +++ b/src/main/java/com/epam/ta/reportportal/ws/model/externalsystem/PostFormField.java @@ -21,6 +21,10 @@ import com.fasterxml.jackson.annotation.JsonProperty; import java.io.Serializable; import java.util.List; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; /** * Basic representation of single post ticket form field
@@ -29,6 +33,10 @@ * * @author Andrei_Ramanchuk */ +@Builder +@Data +@AllArgsConstructor +@NoArgsConstructor @JsonInclude(Include.NON_NULL) public class PostFormField implements Comparable, Serializable { @@ -38,6 +46,12 @@ public class PostFormField implements Comparable, Serializable { @JsonProperty(value = "fieldName") private String fieldName; + /** + * Filed description + */ + @JsonProperty(value = "description") + private String description; + /** * Field ID for post ticket request in JIRA */ @@ -80,9 +94,6 @@ public class PostFormField implements Comparable, Serializable { @JsonProperty(value = "definedValues") private List definedValues; - public PostFormField() { - } - public PostFormField(String id, String fieldName, String fieldType, boolean isRequired, String commandName) { this.id = id; @@ -92,136 +103,10 @@ public PostFormField(String id, String fieldName, String fieldType, boolean isRe this.commandName = commandName; } - public PostFormField(String fieldName, String id, String fieldType, boolean isRequired, - List value, List namedValue, String commandName, - List definedValues) { - this.fieldName = fieldName; - this.id = id; - this.fieldType = fieldType; - this.isRequired = isRequired; - this.value = value; - this.namedValue = namedValue; - this.commandName = commandName; - this.definedValues = definedValues; - } - - public String getFieldName() { - return fieldName; - } - - public void setFieldName(String name) { - this.fieldName = name; - } - - public String getId() { - return id; - } - - public void setId(String value) { - this.id = value; - } - - public String getFieldType() { - return fieldType; - } - - public void setFieldType(String type) { - this.fieldType = type; - } - - public boolean getIsRequired() { - return isRequired; - } - - public void setIsRequired(boolean value) { - this.isRequired = value; - } - - public List getValue() { - return value; - } - - public void setValue(List value) { - this.value = value; - } - - public List getNamedValue() { - return namedValue; - } - - public void setNamedValue(List namedValue) { - this.namedValue = namedValue; - } - - public String getCommandName() { - return commandName; - } - - public void setCommandName(String commandName) { - this.commandName = commandName; - } - - public List getDefinedValues() { - return definedValues; - } - - public void setDefinedValues(List values) { - this.definedValues = values; - } - - @Override - public String toString() { - return "PostFormField{" + "fieldName='" + fieldName + '\'' + ", id='" + id + '\'' - + ", fieldType='" + fieldType + '\'' - + ", isRequired=" + isRequired + ", value=" + value + ", definedValues=" + definedValues - + '}'; - } - @Override public int compareTo(PostFormField field) { Boolean current = this.isRequired; Boolean byField = field.isRequired; return byField.compareTo(current); } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - - PostFormField that = (PostFormField) o; - - if (isRequired != that.isRequired) { - return false; - } - if (fieldName != null ? !fieldName.equals(that.fieldName) : that.fieldName != null) { - return false; - } - if (id != null ? !id.equals(that.id) : that.id != null) { - return false; - } - if (fieldType != null ? !fieldType.equals(that.fieldType) : that.fieldType != null) { - return false; - } - if (value != null ? !value.equals(that.value) : that.value != null) { - return false; - } - return definedValues != null ? definedValues.equals(that.definedValues) - : that.definedValues == null; - } - - @Override - public int hashCode() { - int result = fieldName != null ? fieldName.hashCode() : 0; - result = 31 * result + (id != null ? id.hashCode() : 0); - result = 31 * result + (fieldType != null ? fieldType.hashCode() : 0); - result = 31 * result + (isRequired ? 1 : 0); - result = 31 * result + (value != null ? value.hashCode() : 0); - result = 31 * result + (definedValues != null ? definedValues.hashCode() : 0); - return result; - } } \ No newline at end of file