示例#1
0
 public static Result clone(Result result) {
   if (result == null) return null;
   Result clone = create();
   clone.setType(ObjectUtil.clone(result.getType()));
   clone.setName(ObjectUtil.clone(result.getName()));
   clone.setKey(ObjectUtil.clone(result.getKey()));
   clone.setConstruct(ObjectUtil.clone(result.getConstruct()));
   clone.setRequired(ObjectUtil.clone(result.getRequired()));
   return clone;
 }
示例#2
0
 public static Result createResult(Class<?> resultType) {
   Result result = new Result();
   String resultName = resultType.getCanonicalName();
   String simpleName = NameUtil.getSimpleName(resultName);
   result.setName(NameUtil.uncapName(simpleName));
   String typeName = TypeUtil.getTypeFromClass(resultType);
   // Assert.notNull(typeName, "TypeName not found for: "+resultName);
   if (typeName == null) typeName = resultName;
   result.setType(typeName);
   return result;
 }