@Override
  protected void serialize(MappingSerializer serializer) {
    MappingRepresentation apa =
        new MappingRepresentation("services") {

          @Override
          protected void serialize(MappingSerializer serializer) {
            for (Map.Entry<String, String> entry : services.entrySet()) {
              serializer.putString(entry.getKey(), entry.getValue());
            }
          }
        };

    serializer.putMapping("services", apa);
  }
  @Override
  public void serialize(MappingSerializer serializer) {
    serializer.putMapping(
        "resources",
        new MappingRepresentation("resources") {
          @Override
          protected void serialize(MappingSerializer resourceSerializer) {
            for (Map.Entry<String, String> entry : uris.entrySet()) {
              resourceSerializer.putUri(entry.getKey(), entry.getValue());
            }

            for (Map.Entry<String, String> entry : templates.entrySet()) {
              resourceSerializer.putUriTemplate(entry.getKey(), entry.getValue());
            }
          }
        });
  }
Exemplo n.º 3
0
 @Override
 protected void serialize(MappingSerializer serializer) {
   serializer.putUri(MASTER_KEY, basePath + isMasterUri);
   serializer.putUri(SLAVE_KEY, basePath + isSlaveUri);
 }