@Test public void testBuild_nullOrDefaultValue() { MyBean bean = new MyBean(); ArgumentsBuilder builder = new ArgumentsBuilder(bean); List<String> args = builder.build(); assertEquals(7, args.size()); assertTrue(args.contains("string=")); assertTrue(args.contains("integer=")); assertTrue(args.contains("bool=false")); assertTrue(args.contains("ch=\\u0000")); assertTrue(args.contains("myEnum=")); assertTrue(args.contains("list=")); assertTrue(args.contains("file=")); }
public List<String> build() { ArrayList<String> args = new ArrayList<String>(); for (int i = 0; i < beanDesc.getPropertyDescSize(); i++) { PropertyDesc propertyDesc = beanDesc.getPropertyDesc(i); if (!propertyDesc.hasReadMethod()) { continue; } ArgumentType<Object> argumentType = ArgumentTypeRegistry .getArgumentType(propertyDesc); if (argumentType == null) { String message = String .format( "No ArgumentType for the property(%s) of class(%s). Process skipped.", propertyDesc.getPropertyName(), bean.getClass() .getName()); logger.warn(message); continue; } String name = propertyDesc.getPropertyName(); Object value = propertyDesc.getValue(bean); args.add(name + "=" + argumentType.toText(value)); } return args; }
ArgumentsBuilder { public List<String> build() { ArrayList<String> args = new ArrayList<String>(); for (int i = 0; i < beanDesc.getPropertyDescSize(); i++) { PropertyDesc propertyDesc = beanDesc.getPropertyDesc(i); if (!propertyDesc.hasReadMethod()) { continue; } ArgumentType<Object> argumentType = ArgumentTypeRegistry .getArgumentType(propertyDesc); if (argumentType == null) { String message = String .format( "No ArgumentType for the property(%s) of class(%s). Process skipped.", propertyDesc.getPropertyName(), bean.getClass() .getName()); logger.warn(message); continue; } String name = propertyDesc.getPropertyName(); Object value = propertyDesc.getValue(bean); args.add(name + "=" + argumentType.toText(value)); } return args; } }
ArgumentsBuilder { public List<String> build() { ArrayList<String> args = new ArrayList<String>(); for (int i = 0; i < beanDesc.getPropertyDescSize(); i++) { PropertyDesc propertyDesc = beanDesc.getPropertyDesc(i); if (!propertyDesc.hasReadMethod()) { continue; } ArgumentType<Object> argumentType = ArgumentTypeRegistry .getArgumentType(propertyDesc); if (argumentType == null) { String message = String .format( "No ArgumentType for the property(%s) of class(%s). Process skipped.", propertyDesc.getPropertyName(), bean.getClass() .getName()); logger.warn(message); continue; } String name = propertyDesc.getPropertyName(); Object value = propertyDesc.getValue(bean); args.add(name + "=" + argumentType.toText(value)); } return args; } ArgumentsBuilder(Object bean); }
ArgumentsBuilder { public List<String> build() { ArrayList<String> args = new ArrayList<String>(); for (int i = 0; i < beanDesc.getPropertyDescSize(); i++) { PropertyDesc propertyDesc = beanDesc.getPropertyDesc(i); if (!propertyDesc.hasReadMethod()) { continue; } ArgumentType<Object> argumentType = ArgumentTypeRegistry .getArgumentType(propertyDesc); if (argumentType == null) { String message = String .format( "No ArgumentType for the property(%s) of class(%s). Process skipped.", propertyDesc.getPropertyName(), bean.getClass() .getName()); logger.warn(message); continue; } String name = propertyDesc.getPropertyName(); Object value = propertyDesc.getValue(bean); args.add(name + "=" + argumentType.toText(value)); } return args; } ArgumentsBuilder(Object bean); List<String> build(); }
ArgumentsBuilder { public List<String> build() { ArrayList<String> args = new ArrayList<String>(); for (int i = 0; i < beanDesc.getPropertyDescSize(); i++) { PropertyDesc propertyDesc = beanDesc.getPropertyDesc(i); if (!propertyDesc.hasReadMethod()) { continue; } ArgumentType<Object> argumentType = ArgumentTypeRegistry .getArgumentType(propertyDesc); if (argumentType == null) { String message = String .format( "No ArgumentType for the property(%s) of class(%s). Process skipped.", propertyDesc.getPropertyName(), bean.getClass() .getName()); logger.warn(message); continue; } String name = propertyDesc.getPropertyName(); Object value = propertyDesc.getValue(bean); args.add(name + "=" + argumentType.toText(value)); } return args; } ArgumentsBuilder(Object bean); List<String> build();  }