All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.safelayer.rap.json.PopKeyMapSerialize Maven / Gradle / Ivy

Go to download

The PKI Connector RESTAPI is a library that helps developing new PKI Connectors for TrustedX

The newest version!

package com.safelayer.rap.json;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.safelayer.rap.api.model.issuance.IssuancePopPendingResponse.Key;
import com.safelayer.rap.json.model.issuance.JsonIssuancePopPendingResponse.JsonKey;

public class PopKeyMapSerialize extends JsonSerializer> {

	@Override
	public void serialize(Map value, JsonGenerator generator, SerializerProvider serializerProvider)
			throws IOException, JsonProcessingException {

		Map x = new HashMap();
		for (Entry e : value.entrySet()) {

			JsonKey v = new JsonKey(e.getValue());
			x.put(e.getKey(), v);
		}

		generator.writeObject(x);

	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy