コード例 #1
0
 public void fill(MapArray<String, String> objStrings) {
   LinqUtils.foreach(
       ReflectionUtils.getFields(this, ISetValue.class),
       element -> {
         String fieldValue =
             objStrings.first(
                 (name, value) ->
                     GetElement.namesEqual(name, AnnotationsUtil.getElementName(element)));
         if (fieldValue != null) {
           ISetValue setValueElement = (ISetValue) ReflectionUtils.getFieldValue(element, this);
           doActionRule.invoke(fieldValue, val -> setValueAction(val, setValueElement));
         }
       });
 }
コード例 #2
0
 public void verify(MapArray<String, String> objStrings, JActionTT<String, String> compare) {
   LinqUtils.foreach(
       ReflectionUtils.getFields(this, IHasValue.class),
       element -> {
         String fieldValue =
             objStrings.first(
                 (name, value) ->
                     GetElement.namesEqual(name, AnnotationsUtil.getElementName(element)));
         if (fieldValue != null) {
           IHasValue getValueElement = (IHasValue) ReflectionUtils.getFieldValue(element, this);
           doActionRule.invoke(
               fieldValue, val -> compare.invoke(getValueAction(getValueElement).trim(), val));
         }
       });
 }