package org.wfc.omada.api.sitesetting.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.Objects;

/**
 * Port mask list. [portType] value of 1 is required
 */
@ApiModel(description = "Port mask list. [portType] value of 1 is required")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-12-04T11:32:19.054+08:00[Asia/Shanghai]")

public class PortMaskOpenApiVo   {
  @JsonProperty("port")
  private Integer port;

  @JsonProperty("mask")
  private String mask;

  public PortMaskOpenApiVo port(Integer port) {
    this.port = port;
    return this;
  }

  /**
   * Port should be within the range of 0-65535
   * @return port
  */
  @ApiModelProperty(required = true, value = "Port should be within the range of 0-65535")
  @NotNull


  public Integer getPort() {
    return port;
  }

  public void setPort(Integer port) {
    this.port = port;
  }

  public PortMaskOpenApiVo mask(String mask) {
    this.mask = mask;
    return this;
  }

  /**
   * Port mask should be 4 hex number(0-9, A-F), e.g. 0000 or FFFF
   * @return mask
  */
  @ApiModelProperty(required = true, value = "Port mask should be 4 hex number(0-9, A-F), e.g. 0000 or FFFF")
  @NotNull

@Pattern(regexp="^[0-9a-fA-F]{4}$") 
  public String getMask() {
    return mask;
  }

  public void setMask(String mask) {
    this.mask = mask;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    PortMaskOpenApiVo portMaskOpenApiVo = (PortMaskOpenApiVo) o;
    return Objects.equals(this.port, portMaskOpenApiVo.port) &&
        Objects.equals(this.mask, portMaskOpenApiVo.mask);
  }

  @Override
  public int hashCode() {
    return Objects.hash(port, mask);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class PortMaskOpenApiVo {\n");
    
    sb.append("    port: ").append(toIndentedString(port)).append("\n");
    sb.append("    mask: ").append(toIndentedString(mask)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }
}

