/** * override method 'equals' * * @param _other 与本对象比较的其它对象 * @return boolean 两个对象的各个属性是否都相等 */ public boolean equals(Object _other) { if (_other == null) { return false; } if (_other == this) { return true; } if (!(_other instanceof RmCommonVo)) { return false; } final RmCommonVo _cast = (RmCommonVo) _other; for (String key : mapAttribute.keySet()) { Object thisValue = get(key); if (thisValue == null && _cast.get(key) != null) { return false; } else if (thisValue != null && !thisValue.equals(_cast.get(key))) { return false; } } return true; }
/** * override method 'clone' * * @see java.lang.Object#clone() * @return Object 克隆后对象 * @throws CloneNotSupportedException */ public Object clone() throws CloneNotSupportedException { super.clone(); RmCommonVo vo = new RmCommonVo(); for (String key : mapAttribute.keySet()) { String thisValue = this.getString(key); vo.put(key, thisValue); } return vo; }