public int compareTo(Object obj) { if (obj == null) { return -1; } CityImpl city = (CityImpl) obj; int value = 0; value = getCityName().toLowerCase().compareTo(city.getCityName().toLowerCase()); if (value != 0) { return value; } return 0; }
public boolean equals(Object obj) { if (obj == null) { return false; } CityImpl city = null; try { city = (CityImpl) obj; } catch (ClassCastException cce) { return false; } String pk = city.getPrimaryKey(); if (getPrimaryKey().equals(pk)) { return true; } else { return false; } }
public Object clone() { CityImpl clone = new CityImpl(); clone.setCityID(getCityID()); clone.setCityCode(getCityCode()); clone.setCityName(getCityName()); clone.setDescription(getDescription()); clone.setActive(getActive()); clone.setCountryId(getCountryId()); return clone; }