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

io.vertx.pgclient.data.Inet Maven / Gradle / Ivy

There is a newer version: 5.0.0.CR1
Show newest version
package io.vertx.pgclient.data;

import java.net.InetAddress;

/**
 * A PosgreSQL inet network address.
 */
public class Inet {

  private InetAddress address;
  private Integer netmask;

  /**
   * @return the inet address
   */
  public InetAddress getAddress() {
    return address;
  }

  /**
   * Set the inet address
   * @param address
   * @return a reference to this, so the API can be used fluently
   */
  public Inet setAddress(InetAddress address) {
    this.address = address;
    return this;
  }

  /**
   * @return the optional netmask
   */
  public Integer getNetmask() {
    return netmask;
  }

  /**
   * Set a netmask.
   *
   * @param netmask the netmask
   * @return a reference to this, so the API can be used fluently
   */
  public Inet setNetmask(Integer netmask) {
    if (netmask != null && (netmask < 0 || netmask > 255)) {
      throw new IllegalArgumentException("Invalid netmask: " + netmask);
    }
    this.netmask = netmask;
    return this;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy