Class DataSetMarshaller
- java.lang.Object
-
- org.optaweb.vehiclerouting.service.demo.dataset.DataSetMarshaller
-
@Component public class DataSetMarshaller extends Object
Data set marshaller using the YAML format.
-
-
Constructor Summary
Constructors Constructor Description DataSetMarshaller()Create marshaller using the default object mapper, which is set up to use YAML format.DataSetMarshaller(com.fasterxml.jackson.databind.ObjectMapper mapper)Constructor for testing purposes.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringmarshal(RoutingProblem routingProblem)Marshal routing problem to string.(package private) Stringmarshal(DataSet dataSet)(package private) static DataSetLocationtoDataSet(LocationData locationData)(package private) static DataSettoDataSet(RoutingProblem routingProblem)(package private) static DataSetVehicletoDataSet(VehicleData vehicleData)(package private) static RoutingProblemtoDomain(DataSet dataSet)(package private) static LocationDatatoDomain(DataSetLocation dataSetLocation)(package private) static VehicleDatatoDomain(DataSetVehicle dataSetVehicle)RoutingProblemunmarshal(Reader reader)Unmarshal routing problem from a reader.(package private) DataSetunmarshalToDataSet(Reader reader)
-
-
-
Constructor Detail
-
DataSetMarshaller
DataSetMarshaller()
Create marshaller using the default object mapper, which is set up to use YAML format.
-
DataSetMarshaller
DataSetMarshaller(com.fasterxml.jackson.databind.ObjectMapper mapper)
Constructor for testing purposes.- Parameters:
mapper- usually a mock object mapper
-
-
Method Detail
-
unmarshal
public RoutingProblem unmarshal(Reader reader)
Unmarshal routing problem from a reader.- Parameters:
reader- a reader- Returns:
- routing problem
-
marshal
public String marshal(RoutingProblem routingProblem)
Marshal routing problem to string.- Parameters:
routingProblem- routing problem- Returns:
- string containing the marshaled routing problem
-
toDataSet
static DataSet toDataSet(RoutingProblem routingProblem)
-
toDataSet
static DataSetLocation toDataSet(LocationData locationData)
-
toDataSet
static DataSetVehicle toDataSet(VehicleData vehicleData)
-
toDomain
static RoutingProblem toDomain(DataSet dataSet)
-
toDomain
static LocationData toDomain(DataSetLocation dataSetLocation)
-
toDomain
static VehicleData toDomain(DataSetVehicle dataSetVehicle)
-
-