public static PhoneNumber clone(PhoneNumber phoneNumber) { if (phoneNumber == null) return null; PhoneNumber clone = create(); clone.setId(ObjectUtil.clone(phoneNumber.getId())); clone.setArea(ObjectUtil.clone(phoneNumber.getArea())); clone.setNumber(ObjectUtil.clone(phoneNumber.getNumber())); clone.setExtension(ObjectUtil.clone(phoneNumber.getExtension())); clone.setCountry(phoneNumber.getCountry()); clone.setType(phoneNumber.getType()); clone.setValue(ObjectUtil.clone(phoneNumber.getValue())); return clone; }
public static void initialize(PhoneNumber phoneNumber) { if (phoneNumber.getCountry() == null) phoneNumber.setCountry(Country.USA); if (phoneNumber.getType() == null) phoneNumber.setType(PhoneLocation.HOME); }
public static PhoneNumber create(PhoneLocation phoneLocation) { PhoneNumber phoneNumber = create(); phoneNumber.setType(phoneLocation); return phoneNumber; }