@Test public void shouldConvert() throws Exception { RequestMap expectedMap = new RequestMap(); expectedMap.putMap(new HashMap<String, String>() {{ put("permissions", "CREATE_CHECKOUTS,DIRECT_PAYMENT"); }}); RequestMap map = mapConverter.convert(permissions); assertEquals(expectedMap, map); }
@Override protected void convert(RequestMap requestMap, Iterable<? extends PermissionCode.Code> permissions) { StringBuilder valueBuilder = new StringBuilder(); for (PermissionCode.Code permission : permissions) { if (valueBuilder.length() == 0) { valueBuilder.append(permission); } else { valueBuilder.append("," + permission); } } requestMap.putString("permissions", valueBuilder); }
PermissionV2MapConverter extends
    AbstractMapConverter<Iterable<? extends PermissionCode.Code>> { @Override protected void convert(RequestMap requestMap, Iterable<? extends PermissionCode.Code> permissions) { StringBuilder valueBuilder = new StringBuilder(); for (PermissionCode.Code permission : permissions) { if (valueBuilder.length() == 0) { valueBuilder.append(permission); } else { valueBuilder.append("," + permission); } } requestMap.putString("permissions", valueBuilder); } }
PermissionV2MapConverter extends
    AbstractMapConverter<Iterable<? extends PermissionCode.Code>> { @Override protected void convert(RequestMap requestMap, Iterable<? extends PermissionCode.Code> permissions) { StringBuilder valueBuilder = new StringBuilder(); for (PermissionCode.Code permission : permissions) { if (valueBuilder.length() == 0) { valueBuilder.append(permission); } else { valueBuilder.append("," + permission); } } requestMap.putString("permissions", valueBuilder); } PermissionV2MapConverter(); }
PermissionV2MapConverter extends
    AbstractMapConverter<Iterable<? extends PermissionCode.Code>> { @Override protected void convert(RequestMap requestMap, Iterable<? extends PermissionCode.Code> permissions) { StringBuilder valueBuilder = new StringBuilder(); for (PermissionCode.Code permission : permissions) { if (valueBuilder.length() == 0) { valueBuilder.append(permission); } else { valueBuilder.append("," + permission); } } requestMap.putString("permissions", valueBuilder); } PermissionV2MapConverter();  }
PermissionV2MapConverter extends
    AbstractMapConverter<Iterable<? extends PermissionCode.Code>> { @Override protected void convert(RequestMap requestMap, Iterable<? extends PermissionCode.Code> permissions) { StringBuilder valueBuilder = new StringBuilder(); for (PermissionCode.Code permission : permissions) { if (valueBuilder.length() == 0) { valueBuilder.append(permission); } else { valueBuilder.append("," + permission); } } requestMap.putString("permissions", valueBuilder); } PermissionV2MapConverter();   }