Esempio n. 1
0
 @Override
 public Object clone() {
   ResourceModel clone =
       new ResourceModel(getScope(), getKey(), getQualifier(), getRootId(), getName());
   clone.setDescription(getDescription());
   clone.setEnabled(getEnabled());
   clone.setProjectLinks(getProjectLinks());
   clone.setRulesProfile(getRulesProfile());
   clone.setLanguageKey(getLanguageKey());
   clone.setCopyResourceId(getCopyResourceId());
   clone.setLongName(getLongName());
   return clone;
 }
Esempio n. 2
0
 /** Maps a resource to a resource model and returns the resource */
 public static ResourceModel build(Resource resource) {
   ResourceModel model = new ResourceModel();
   model.setEnabled(Boolean.TRUE);
   model.setDescription(resource.getDescription());
   model.setKey(resource.getKey());
   if (resource.getLanguage() != null) {
     model.setLanguageKey(resource.getLanguage().getKey());
   }
   if (StringUtils.isNotBlank(resource.getName())) {
     model.setName(resource.getName());
   } else {
     model.setName(resource.getKey());
   }
   model.setLongName(resource.getLongName());
   model.setQualifier(resource.getQualifier());
   model.setScope(resource.getScope());
   return model;
 }