LoadUnitMO.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.events;

import java.io.Serializable;
import java.util.Objects;

/**
 * A LoadUnitVO is a message object that represents a {@code LoadUnit}.
 *
 * @author Heiko Scherrer
 */
public class LoadUnitMO implements Serializable {

    /** The persistent key of the {@code LoadUnit}. */
    private String pKey;
    /** The business key of the {@code TransportUnit}. */
    private String transportUnitBK;
    /** Where this {@code LoadUnit} is located on the {@code TransportUnit}. */
    private String physicalPosition;
    /** An identifying label of the {@code LoadUnit}. */
    private String label;
    /** The type of the LoadUnit. */
    private String type;
    /** The {@code Product} that is carried within the {@code LoadUnit}. */
    private ProductMO product;

    public String getpKey() {
        return pKey;
    }

    public void setpKey(String pKey) {
        this.pKey = pKey;
    }

    public String getTransportUnitBK() {
        return transportUnitBK;
    }

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

    public String getPhysicalPosition() {
        return physicalPosition;
    }

    public void setPhysicalPosition(String physicalPosition) {
        this.physicalPosition = physicalPosition;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public ProductMO getProduct() {
        return product;
    }

    public void setProduct(ProductMO product) {
        this.product = product;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof LoadUnitMO)) return false;
        LoadUnitMO that = (LoadUnitMO) o;
        return Objects.equals(pKey, that.pKey) && Objects.equals(transportUnitBK, that.transportUnitBK) && Objects.equals(physicalPosition, that.physicalPosition) && Objects.equals(label, that.label) && Objects.equals(type, that.type) && Objects.equals(product, that.product);
    }

    @Override
    public int hashCode() {
        return Objects.hash(pKey, transportUnitBK, physicalPosition, label, type, product);
    }

    @Override
    public String toString() {
        return "LoadUnitMO{" +
                "pKey='" + pKey + '\'' +
                ", transportUnitBK='" + transportUnitBK + '\'' +
                ", physicalPosition='" + physicalPosition + '\'' +
                ", label='" + label + '\'' +
                ", type='" + type + '\'' +
                ", product=" + product +
                '}';
    }
}