// Path: src/main/java/de/fesere/hypermedia/cj/model/DataEntry.java
// public interface DataEntry<T> {
//     String getName();
// 
//     String getPrompt();
// 
//     T getValue();
// 
//     String buildQueryRepresentation();
// }
// 
// Path: src/main/java/de/fesere/hypermedia/cj/model/data/NoneDataEntry.java
// public class NoneDataEntry extends BaseDataEntry {
// 
//     public NoneDataEntry(String name) {
//         super(name);
//     }
// }


import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import de.fesere.hypermedia.cj.model.DataEntry;
import de.fesere.hypermedia.cj.model.data.NoneDataEntry;
import org.apache.commons.lang3.StringUtils;
import java.io.IOException;
package de.fesere.hypermedia.cj.serialization;



public class DataEntrySerializer extends StdSerializer<DataEntry> {

    private JsonGenerator jgen;

    protected DataEntrySerializer() {
        super(DataEntry.class);
    }

    @Override
    public void serialize(DataEntry entry, JsonGenerator jgen, SerializerProvider provider) throws IOException {
        if (entry instanceof NoneDataEntry) {
            return;
        }
        this.jgen = jgen;

        jgen.writeStartObject();

        writeName(entry.getName());
        writeValue(entry.getValue());
        writePrompt(entry.getPrompt());

        jgen.writeEndObject();

    }

    private void writeName(String name) throws IOException {
// Path: src/main/java/de/fesere/hypermedia/cj/model/DataEntry.java
// public interface DataEntry<T> {
//     String getName();
// 
//     String getPrompt();
// 
//     T getValue();
// 
//     String buildQueryRepresentation();
// }
// 
// Path: src/main/java/de/fesere/hypermedia/cj/model/data/NoneDataEntry.java
// public class NoneDataEntry extends BaseDataEntry {
// 
//     public NoneDataEntry(String name) {
//         super(name);
//     }
// }


// Path: src/main/java/de/fesere/hypermedia/cj/serialization/DataEntrySerializer.java
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import de.fesere.hypermedia.cj.model.DataEntry;
import de.fesere.hypermedia.cj.model.data.NoneDataEntry;
import org.apache.commons.lang3.StringUtils;
import java.io.IOException;

package de.fesere.hypermedia.cj.serialization;



public class DataEntrySerializer extends StdSerializer<DataEntry> {

    private JsonGenerator jgen;

    protected DataEntrySerializer() {
        super(DataEntry.class);
    }

    @Override
    public void serialize(DataEntry entry, JsonGenerator jgen, SerializerProvider provider) throws IOException {
        if (entry instanceof NoneDataEntry) {
            return;
        }
        this.jgen = jgen;

        jgen.writeStartObject();

        writeName(entry.getName());
        writeValue(entry.getValue());
        writePrompt(entry.getPrompt());

        jgen.writeEndObject();

    }

    private void writeName(String name) throws IOException {
        jgen.writeStringField("name", name);