public CollectionAgentDTO(CollectionAgent agent) { Objects.requireNonNull(agent); for (String attribute : agent.getAttributeNames()) { setAttribute(attribute, agent.getAttribute(attribute)); } address = agent.getAddress(); storeByForeignSource = agent.isStoreByForeignSource(); nodeId = agent.getNodeId(); nodeLabel = agent.getNodeLabel(); foreignSource = agent.getForeignSource(); foreignId = agent.getForeignId(); location = agent.getLocationName(); setStorageResourcePath(agent.getStorageResourcePath()); sysUpTime = agent.getSavedSysUpTime(); }