Added more ignorable files to .gitignore
[ovsdb.git] / ovsdb / src / main / java / org / opendaylight / ovsdb / lib / notation / json / MutationSerializer.java
1 /*
2  * Copyright (C) 2013 Red Hat, Inc.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Authors : Madhu Venugopal, Ashwin Raveendran
9  */
10 package org.opendaylight.ovsdb.lib.notation.json;
11
12 import java.io.IOException;
13
14 import org.opendaylight.ovsdb.lib.notation.Mutation;
15
16 import com.fasterxml.jackson.core.JsonGenerator;
17 import com.fasterxml.jackson.core.JsonProcessingException;
18 import com.fasterxml.jackson.databind.JsonSerializer;
19 import com.fasterxml.jackson.databind.SerializerProvider;
20
21 public class MutationSerializer extends JsonSerializer<Mutation> {
22     @Override
23     public void serialize(Mutation condition, JsonGenerator generator,
24         SerializerProvider provider) throws IOException,
25             JsonProcessingException {
26         generator.writeStartArray();
27         generator.writeString(condition.getColumn());
28         generator.writeString(condition.getMutator().toString());
29         generator.writeObject(condition.getValue());
30         generator.writeEndArray();
31     }
32 }