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

org.optaplanner.examples.machinereassignment.persistence.MrMachineKeySerializer Maven / Gradle / Ivy

Go to download

OptaPlanner solves planning problems. This lightweight, embeddable planning engine implements powerful and scalable algorithms to optimize business resource scheduling and planning. This module contains the examples which demonstrate how to use it in a normal Java application.

There is a newer version: 9.44.0.Final
Show newest version
package org.optaplanner.examples.machinereassignment.persistence;

import java.io.IOException;

import org.optaplanner.examples.machinereassignment.domain.MrMachine;

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

public class MrMachineKeySerializer extends JsonSerializer {

    @Override
    public void serialize(MrMachine mrMachine, JsonGenerator jsonGenerator, SerializerProvider serializerProvider)
            throws IOException {
        jsonGenerator.writeFieldId(mrMachine.getId());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy