1
0
Fork 0
mirror of https://github.com/graphhopper/jsprit.git synced 2020-01-24 07:45:05 +01:00

add helper to build new vehicle based on another vehicle

This commit is contained in:
oblonski 2018-12-04 11:11:14 +01:00
parent 9ec84d0e48
commit 3e89111342
No known key found for this signature in database
GPG key ID: 179DE487285680D1

View file

@ -330,6 +330,16 @@ public class VehicleImpl extends AbstractVehicle {
}
}
/**
* Returns a simple copy of vehicle.
*
* @param vehicle
* @return
*/
public static Vehicle copyOf(Vehicle vehicle) {
return VehicleImpl.Builder.newInstance(vehicle).build();
}
/**
* Returns empty/noVehicle which is a vehicle having no capacity, no type and no reasonable id.
* <p>