ai.timefold.solver.jackson.api.solver.RecommendedFitJacksonSerializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of timefold-solver-jackson Show documentation
Show all versions of timefold-solver-jackson Show documentation
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();
}
}