Created
October 23, 2013 11:47
-
-
Save jcsirot/7117106 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.chelonix.codestory.elevator.serializer; | |
import java.io.IOException; | |
import com.chelonix.codestory.elevator.domain.Command; | |
import com.fasterxml.jackson.core.JsonGenerator; | |
import com.fasterxml.jackson.core.JsonProcessingException; | |
import com.fasterxml.jackson.databind.JsonSerializer; | |
import com.fasterxml.jackson.databind.SerializerProvider; | |
/** | |
* User: sirot | |
* Date: 20/09/13 | |
* Time: 21:06 | |
*/ | |
public class CommandSerializer extends JsonSerializer<Command> | |
{ | |
@Override | |
public void serialize(Command command, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException, JsonProcessingException | |
{ | |
jsonGenerator.writeRaw(command.name()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment