AllocationVO.java

/*
 * Copyright 2005-2025 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.openwms.wms.inventory.allocation.api;

import com.fasterxml.jackson.annotation.JsonProperty;
import org.openwms.core.units.api.Measurable;

import java.io.Serializable;

/**
 * A AllocationVO.
 *
 * @author Heiko Scherrer
 */
public class AllocationVO implements Serializable {

    @JsonProperty("transportUnitBK")
    private String transportUnitBK;
    @JsonProperty("loadUnitPosition")
    private String loadUnitPosition;
    @JsonProperty("sku")
    private String sku;
    @JsonProperty("actualErpCode")
    private String actualErpCode;
    @JsonProperty("qtyAllocated")
    private Measurable qtyAllocated;
    @JsonProperty("reservationId")
    private String reservationId;

    private AllocationVO() {
    }

    private AllocationVO(Builder builder) {
        setTransportUnitBK(builder.transportUnitBK);
        setLoadUnitPosition(builder.loadUnitPosition);
        setSku(builder.sku);
        setActualErpCode(builder.actualErpCode);
        setQtyAllocated(builder.qtyAllocated);
        setReservationId(builder.reservationId);
    }

    public static Builder newBuilder() {
        return new Builder();
    }

    public String getTransportUnitBK() {
        return transportUnitBK;
    }

    public void setTransportUnitBK(String transportUnitBK) {
        this.transportUnitBK = transportUnitBK;
    }

    public String getLoadUnitPosition() {
        return loadUnitPosition;
    }

    public void setLoadUnitPosition(String loadUnitPosition) {
        this.loadUnitPosition = loadUnitPosition;
    }

    public String getSku() {
        return sku;
    }

    public void setSku(String sku) {
        this.sku = sku;
    }

    public String getActualErpCode() {
        return actualErpCode;
    }

    public void setActualErpCode(String actualErpCode) {
        this.actualErpCode = actualErpCode;
    }

    public Measurable getQtyAllocated() {
        return qtyAllocated;
    }

    public void setQtyAllocated(Measurable qtyAllocated) {
        this.qtyAllocated = qtyAllocated;
    }

    public String getReservationId() {
        return reservationId;
    }

    public void setReservationId(String reservationId) {
        this.reservationId = reservationId;
    }

    public static final class Builder {
        private String transportUnitBK;
        private String loadUnitPosition;
        private String sku;
        private String actualErpCode;
        private Measurable qtyAllocated;
        private String reservationId;

        private Builder() {
        }

        public Builder transportUnitBK(String val) {
            transportUnitBK = val;
            return this;
        }

        public Builder loadUnitPosition(String val) {
            loadUnitPosition = val;
            return this;
        }

        public Builder sku(String val) {
            sku = val;
            return this;
        }

        public Builder actualErpCode(String val) {
            actualErpCode = val;
            return this;
        }

        public Builder qtyAllocated(Measurable val) {
            qtyAllocated = val;
            return this;
        }

        public Builder reservationId(String val) {
            reservationId = val;
            return this;
        }

        public AllocationVO build() {
            return new AllocationVO(this);
        }
    }
}