Artifact Content
Not logged in

Artifact bcf9ab9e04f7bc51cdd680240904d30a5a1a10cc:


package org.interledger.spsp.rest.json;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import org.interledger.ilp.core.InterledgerAddress;

import java.io.IOException;

@SuppressWarnings("serial")
//TODO: maybe this should be in java-ilp-core?
public class InterledgerAddressSerializer extends StdSerializer<InterledgerAddress> {

  public InterledgerAddressSerializer() {
    super(InterledgerAddress.class);
  }

  @Override
  public void serialize(InterledgerAddress value, JsonGenerator gen, SerializerProvider provider)
      throws IOException {
    gen.writeString(value.toString());
  }  
}