package com.oguerreiro.resilient.service.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;

/**
 * A DTO for the {@link com.oguerreiro.resilient.domain.UnitConverter} entity.
 */
@Schema(description = "Unit Converter")
public class UnitConverterDTO extends AbstractResilientDTO<Long> {
  private static final long serialVersionUID = 1L;

  @NotNull
  private String name;

  @NotNull
  private String description;

  @NotNull
  @Schema(description = "The convertion formula to convert the fromUnit into the toUnit.", requiredMode = Schema.RequiredMode.REQUIRED)
  private String convertionFormula;

  private UnitDTO fromUnit;

  private UnitDTO toUnit;

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public String getDescription() {
    return description;
  }

  public void setDescription(String description) {
    this.description = description;
  }

  public String getConvertionFormula() {
    return convertionFormula;
  }

  public void setConvertionFormula(String convertionFormula) {
    this.convertionFormula = convertionFormula;
  }

  public UnitDTO getFromUnit() {
    return fromUnit;
  }

  public void setFromUnit(UnitDTO fromUnit) {
    this.fromUnit = fromUnit;
  }

  public UnitDTO getToUnit() {
    return toUnit;
  }

  public void setToUnit(UnitDTO toUnit) {
    this.toUnit = toUnit;
  }

  //@formatter:off
  @Override
  public String toString() {
    return "UnitConverterDTO{" +
              "id=" + getId() +
              ", name='" + getName() + "'" +
              ", description='" + getDescription() + "'" +
              ", convertionFormula='" + getConvertionFormula() + "'" +
              ", fromUnit=" + getFromUnit() +
              ", toUnit=" + getToUnit() +
              ", version=" + getVersion() +
           "}";
  }
  //@formatter:on
}
