Ejemplo n.º 1
0
  /**
   * Create a network device entity
   *
   * @param id id
   * @param macAddress MAC address
   * @param reachabilityStatus reachability status
   * @throws NullPointerException if any of the parameters is {@code null}
   */
  public NetworkDeviceEntity(
      SerialNumber id, MacAddress macAddress, ReachabilityStatus reachabilityStatus) {
    if (id == null) {
      throw new NullPointerException("id cannot be null");
    }

    if (macAddress == null) {
      throw new NullPointerException("macAddress cannot be null");
    }

    if (reachabilityStatus == null) {
      throw new NullPointerException("reachabilityStatus cannot be null");
    }

    this.id = id.getValue();
    this.macAddress = macAddress.getValue();
    this.reachabilityStatus = reachabilityStatus;
  }
Ejemplo n.º 2
0
 /**
  * Returns the id
  *
  * @return the id
  */
 public SerialNumber getId() {
   return SerialNumber.valueOf(this.id);
 }