private void updateBranch(Branch branch, BranchRestInfoFull branchRestInfo) { Address address; branch.setName(branchRestInfo.getName()); branch.setDescription(branchRestInfo.getDescription()); branch.setPhoneNumber(branchRestInfo.getPhoneNumber()); branch.setFaxNumber(branchRestInfo.getFaxNumber()); address = getAddress(branchRestInfo); branch.setAddress(address); }
private Branch createBranch(BranchRestInfoFull branchRestInfo) throws ResourceException { Address address; Branch branch = new Branch(); // copy fields from rest info branch.setName(branchRestInfo.getName()); branch.setDescription(branchRestInfo.getDescription()); address = getAddress(branchRestInfo); branch.setAddress(address); return branch; }
private void updateBranch(Branch branch, BranchRestInfoFull branchRestInfo) { Address address; String tempString; // do not allow empty name tempString = branchRestInfo.getName(); if (!tempString.isEmpty()) { branch.setName(tempString); } branch.setDescription(branchRestInfo.getDescription()); address = getAddress(branchRestInfo); branch.setAddress(address); }