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

ai.timefold.solver.jackson.api.solver.RecommendedFitJacksonSerializer Maven / Gradle / Ivy

Go to download

Timefold solves planning problems. This lightweight, embeddable planning engine implements powerful and scalable algorithms to optimize business resource scheduling and planning. This module contains the Jackson integration.

The newest version!
package ai.timefold.solver.jackson.api.solver;

import java.io.IOException;

import ai.timefold.solver.core.api.score.Score;
import ai.timefold.solver.core.api.solver.RecommendedFit;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;

public final class RecommendedFitJacksonSerializer>
        extends JsonSerializer> {
    @Override
    public void serialize(RecommendedFit value, JsonGenerator gen, SerializerProvider serializerProvider)
            throws IOException {
        gen.writeStartObject();
        gen.writeObjectField("proposition", value.proposition());
        gen.writeObjectField("scoreDiff", value.scoreAnalysisDiff());
        gen.writeEndObject();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy