Ejemplo n.º 1
0
    @Override
    public MedlineField selectValue(int n) {
      MedlineField.Builder builder = getNewBuilder();

      for (Map.Entry<String, SimpleFieldModel> s : model.entrySet()) {
        for (Map.Entry<String, String> kvp : s.getValue().selectValue(1).getEntries()) {
          builder.addProperty(kvp.getKey(), kvp.getValue());
        }
      }

      return builder.build();
    }
Ejemplo n.º 2
0
 @Override
 public MedlineField selectValue(int n) {
   MedlineField.Builder builder = getNewBuilder();
   StringBuilder sb = new StringBuilder();
   for (int i = 0; i < n; i++) {
     sb.append(model.ceilingEntry(DATA_GENERATOR.nextLong(0, totalWeight)).getValue());
     if (i < n) {
       sb.append(" ");
     }
   }
   builder.addProperty(fieldName, sb.toString());
   return builder.build();
 }