Skip to content

Commit

Permalink
make id final
Browse files Browse the repository at this point in the history
  • Loading branch information
kt86 committed Dec 20, 2024
1 parent 27984fa commit 5d71e55
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public final class CarrierShipment implements CarrierJob {
*/
public static class Builder {

private Id<CarrierShipment> id;
private final Id<CarrierShipment> id;
private final int demand;

private final Id<Link> pickupLinkId;
Expand All @@ -71,7 +71,8 @@ public static class Builder {
*/
@Deprecated
public static Builder newInstance(Id<Link> from, Id<Link> to, int size){
return new Builder(from,to,size);
var id = Id.create(CarrierConstants.SHIPMENT +"_" + from.toString() + "_" + to.toString(), CarrierShipment.class);
return new Builder(id, from,to,size);
}

/**
Expand All @@ -95,6 +96,7 @@ public static Builder newInstance(Id<CarrierShipment> id, Id<Link> from, Id<Link
@Deprecated
public Builder(Id<Link> pickupLinkId, Id<Link> deliveryLinkId, int demand) {
super();
this.id = Id.create(CarrierConstants.SHIPMENT +"_" + pickupLinkId.toString() + "_" + deliveryLinkId.toString(), CarrierShipment.class);
this.pickupLinkId = pickupLinkId;
this.deliveryLinkId = deliveryLinkId;
this.demand = demand;
Expand Down

0 comments on commit 5d71e55

Please sign in to comment.