Skip to content

Commit

Permalink
EPMRPP-87493 || Add description of the field (#360)
Browse files Browse the repository at this point in the history
  • Loading branch information
pbortnik authored Nov 10, 2023
1 parent 55ec356 commit 2a346aa
Showing 1 changed file with 14 additions and 129 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<br>
Expand All @@ -29,6 +33,10 @@
*
* @author Andrei_Ramanchuk
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
@JsonInclude(Include.NON_NULL)
public class PostFormField implements Comparable<PostFormField>, Serializable {

Expand All @@ -38,6 +46,12 @@ public class PostFormField implements Comparable<PostFormField>, Serializable {
@JsonProperty(value = "fieldName")
private String fieldName;

/**
* Filed description
*/
@JsonProperty(value = "description")
private String description;

/**
* Field ID for post ticket request in JIRA
*/
Expand Down Expand Up @@ -80,9 +94,6 @@ public class PostFormField implements Comparable<PostFormField>, Serializable {
@JsonProperty(value = "definedValues")
private List<AllowedValue> definedValues;

public PostFormField() {
}

public PostFormField(String id, String fieldName, String fieldType, boolean isRequired,
String commandName) {
this.id = id;
Expand All @@ -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<String> value, List<NamedValue> namedValue, String commandName,
List<AllowedValue> 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<String> getValue() {
return value;
}

public void setValue(List<String> value) {
this.value = value;
}

public List<NamedValue> getNamedValue() {
return namedValue;
}

public void setNamedValue(List<NamedValue> namedValue) {
this.namedValue = namedValue;
}

public String getCommandName() {
return commandName;
}

public void setCommandName(String commandName) {
this.commandName = commandName;
}

public List<AllowedValue> getDefinedValues() {
return definedValues;
}

public void setDefinedValues(List<AllowedValue> 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;
}
}

0 comments on commit 2a346aa

Please sign in to comment.