package com.vltgroup.ccTalk.bus;

public class DeviceInfo {
  public final Address    address;
  public final DeviceMode mode;
  public final DeviceType type;
  
  public final String     manufacturerId;
  public final String     productCode;
  public final String     softwareVersion;
  public final long       serialNumber;
  public final long       pollingInterval;

  public DeviceInfo(Address address, DeviceMode mode, DeviceType type, String manufacturerId, String productCode, String  softwareVer,
                    long  serialNumber, long pollingInterval){
    this.address=address;
    this.mode=mode;
    this.type=type;
    
    this.manufacturerId=manufacturerId;
    this.productCode=productCode;
    this.softwareVersion=softwareVer;
    this.serialNumber=serialNumber;
    this.pollingInterval=pollingInterval;
  }

  @Override
  public String toString() {
    return new StringBuilder().append("address:").append(address.address)
                              .append(", mode:").append(mode)
                              .append(", type:").append(type)
            
                              .append(", manufacturerId:").append(manufacturerId)
                              .append(", productCode:").append(productCode)
                              .append(", softwareVersion:").append(softwareVersion)
                              .append(", serialNumber:").append(serialNumber)
                              .append(", pollingInterval:").append(pollingInterval)
                              .toString();
    
  }
  
  public String shortString(){
    return type.toString()+":"+address.address;
  }
  
}

@@ -1621,13 +1621,398 @@
 ss;%0A  %7D%0A
+%0A
   
+@Override%0A  public int hashCode() %7B%0A    return address.address;%0A  %7D%0A%0A  @Override%0A  public boolean equals(Object obj) %7B%0A    if (obj == null) %7B%0A      return false;%0A    %7D%0A    if (getClass() != obj.getClass()) %7B%0A      return false;%0A    %7D%0A    final DeviceInfo other = (DeviceInfo) obj;%0A    if (this.address.address != other.address.address) %7B%0A      return false;%0A    %7D%0A    return true;%0A  %7D
 %0A%7D%0A

add equals and hashCode to DeviceInfo based on address