예제 #1
0
 @Override
 public Object getValueByField(Field field) {
   if (field.getFieldName() == "id") return getId();
   else if (field.getFieldName() == "createdTime") return getCreatedTime();
   else if (field.getFieldName() == "text") return getText();
   else if (field.getFieldName() == "amount") return getAmount();
   else if (field.getFieldName() == "account") return getAccount();
   else if (field.getFieldName() == "bookedDocument") return getBookedDocument();
   return null;
 }
  public Map<String, List<String>> getMessageInfo(List<Message> msg) {
    Map<String, List<String>> msgFields = new HashMap<String, List<String>>();

    for (Message m : msg) {
      String msName = m.getMessageName();
      List<String> list = new ArrayList<String>();
      List<Field> fields = m.getFields();
      for (Field f : fields) {
        ProtoField pf = (ProtoField) f;
        String fsn = f.getFieldName().trim() + pf.getSequenceNumber().trim();
        list.add(fsn);
      }
      msgFields.put(msName, list);
    }
    return msgFields;
  }