コード例 #1
0
 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;
 }
コード例 #2
0
 public static void initialize(PhoneNumber phoneNumber) {
   if (phoneNumber.getCountry() == null) phoneNumber.setCountry(Country.USA);
   if (phoneNumber.getType() == null) phoneNumber.setType(PhoneLocation.HOME);
 }
コード例 #3
0
 public static PhoneNumber create(PhoneLocation phoneLocation) {
   PhoneNumber phoneNumber = create();
   phoneNumber.setType(phoneLocation);
   return phoneNumber;
 }