package io.swagger.model.core;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.validation.annotation.Validated;

import java.util.Objects;

@Validated
public class CommonCrop {

    @JsonProperty("cropDbId")
    private String cropDbId = null;

    @JsonProperty("commonCropName")
    private String commonCropName = null;

    public CommonCrop cropDbId(String cropDbId) {
        this.cropDbId = cropDbId;
        return this;
    }

    @ApiModelProperty(example = "Tomatillo", value = "Crop identifier; uses common crop name for compatibility with GET /commoncropnames")
    public String getCropDbId() {
        return cropDbId;
    }

    public void setCropDbId(String cropDbId) {
        this.cropDbId = cropDbId;
    }

    public CommonCrop commonCropName(String commonCropName) {
        this.commonCropName = commonCropName;
        return this;
    }

    @ApiModelProperty(example = "Tomatillo", required = true, value = "Common crop name")
    public String getCommonCropName() {
        return commonCropName;
    }

    public void setCommonCropName(String commonCropName) {
        this.commonCropName = commonCropName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        CommonCrop commonCrop = (CommonCrop) o;
        return Objects.equals(cropDbId, commonCrop.cropDbId)
                && Objects.equals(commonCropName, commonCrop.commonCropName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(cropDbId, commonCropName);
    }
}
