1 package au.gov.amsa.ais.rx; 2 3 4 public class Mmsi { 5 private final long mmsi; 6 7 public Mmsi(long mmsi) { 8 this.mmsi = mmsi; 9 } 10 11 public long getMmsi() { 12 return mmsi; 13 } 14 15 @Override 16 public int hashCode() { 17 final int prime = 31; 18 int result = 1; 19 result = prime * result + (int) (mmsi ^ (mmsi >>> 32)); 20 return result; 21 } 22 23 @Override 24 public boolean equals(Object obj) { 25 if (this == obj) 26 return true; 27 if (obj == null) 28 return false; 29 if (getClass() != obj.getClass()) 30 return false; 31 Mmsi other = (Mmsi) obj; 32 if (mmsi != other.mmsi) 33 return false; 34 return true; 35 } 36 37 @Override 38 public String toString() { 39 StringBuilder builder = new StringBuilder(); 40 builder.append("Mmsi [mmsi="); 41 builder.append(mmsi); 42 builder.append("]"); 43 return builder.toString(); 44 } 45 46 }