All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.vmware.avi.sdk.model.PortMatchGeneric Maven / Gradle / Ivy

/*
 * Copyright 2021 VMware, Inc.
 * SPDX-License-Identifier: Apache License 2.0
 */

package com.vmware.avi.sdk.model;

import java.util.*;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;

/**
 * The PortMatchGeneric is a POJO class extends AviRestResource that used for creating
 * PortMatchGeneric.
 *
 * @version 1.0
 * @since 
 *
 */
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class PortMatchGeneric  {
    @JsonProperty("match_criteria")
    private String matchCriteria;

    @JsonProperty("ports")
    private List ports;

    @JsonProperty("ranges")
    private List ranges;



    /**
     * This is the getter method this will return the attribute value.
     * Criterion to use for src/dest port in a tcp/udp packet.
     * Enum options - IS_IN, IS_NOT_IN.
     * Field introduced in 20.1.3.
     * Allowed in enterprise edition with any value, enterprise with cloud services edition.
     * Default value when not specified in API or module is interpreted by Avi Controller as null.
     * @return matchCriteria
     */
    public String getMatchCriteria() {
        return matchCriteria;
    }

    /**
     * This is the setter method to the attribute.
     * Criterion to use for src/dest port in a tcp/udp packet.
     * Enum options - IS_IN, IS_NOT_IN.
     * Field introduced in 20.1.3.
     * Allowed in enterprise edition with any value, enterprise with cloud services edition.
     * Default value when not specified in API or module is interpreted by Avi Controller as null.
     * @param matchCriteria set the matchCriteria.
     */
    public void setMatchCriteria(String  matchCriteria) {
        this.matchCriteria = matchCriteria;
    }
    /**
     * This is the getter method this will return the attribute value.
     * Listening tcp port(s).
     * Allowed values are 1-65535.
     * Field introduced in 20.1.3.
     * Allowed in enterprise edition with any value, enterprise with cloud services edition.
     * Default value when not specified in API or module is interpreted by Avi Controller as null.
     * @return ports
     */
    public List getPorts() {
        return ports;
    }

    /**
     * This is the setter method. this will set the ports
     * Listening tcp port(s).
     * Allowed values are 1-65535.
     * Field introduced in 20.1.3.
     * Allowed in enterprise edition with any value, enterprise with cloud services edition.
     * Default value when not specified in API or module is interpreted by Avi Controller as null.
     * @return ports
     */
    public void setPorts(List  ports) {
        this.ports = ports;
    }

    /**
     * This is the setter method this will set the ports
     * Listening tcp port(s).
     * Allowed values are 1-65535.
     * Field introduced in 20.1.3.
     * Allowed in enterprise edition with any value, enterprise with cloud services edition.
     * Default value when not specified in API or module is interpreted by Avi Controller as null.
     * @return ports
     */
    public PortMatchGeneric addPortsItem(Integer portsItem) {
      if (this.ports == null) {
        this.ports = new ArrayList();
      }
      this.ports.add(portsItem);
      return this;
    }
    /**
     * This is the getter method this will return the attribute value.
     * A port range defined by a start and end, including both.
     * Field introduced in 20.1.3.
     * Allowed in enterprise edition with any value, enterprise with cloud services edition.
     * Default value when not specified in API or module is interpreted by Avi Controller as null.
     * @return ranges
     */
    public List getRanges() {
        return ranges;
    }

    /**
     * This is the setter method. this will set the ranges
     * A port range defined by a start and end, including both.
     * Field introduced in 20.1.3.
     * Allowed in enterprise edition with any value, enterprise with cloud services edition.
     * Default value when not specified in API or module is interpreted by Avi Controller as null.
     * @return ranges
     */
    public void setRanges(List  ranges) {
        this.ranges = ranges;
    }

    /**
     * This is the setter method this will set the ranges
     * A port range defined by a start and end, including both.
     * Field introduced in 20.1.3.
     * Allowed in enterprise edition with any value, enterprise with cloud services edition.
     * Default value when not specified in API or module is interpreted by Avi Controller as null.
     * @return ranges
     */
    public PortMatchGeneric addRangesItem(PortRange rangesItem) {
      if (this.ranges == null) {
        this.ranges = new ArrayList();
      }
      this.ranges.add(rangesItem);
      return this;
    }


    @Override
    public boolean equals(java.lang.Object o) {
      if (this == o) {
          return true;
      }
      if (o == null || getClass() != o.getClass()) {
          return false;
      }
      PortMatchGeneric objPortMatchGeneric = (PortMatchGeneric) o;
      return   Objects.equals(this.matchCriteria, objPortMatchGeneric.matchCriteria)&&
  Objects.equals(this.ports, objPortMatchGeneric.ports)&&
  Objects.equals(this.ranges, objPortMatchGeneric.ranges);
    }

    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder();
      sb.append("class PortMatchGeneric {\n");
                  sb.append("    matchCriteria: ").append(toIndentedString(matchCriteria)).append("\n");
                        sb.append("    ports: ").append(toIndentedString(ports)).append("\n");
                        sb.append("    ranges: ").append(toIndentedString(ranges)).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(java.lang.Object o) {
      if (o == null) {
          return "null";
      }
      return o.toString().replace("\n", "\n    ");
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy