All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.openmuc.jeebus.ship.message.smeproth.ProtocolHandshakeMsg Maven / Gradle / Ivy

/*
 * Copyright 2024 Fraunhofer ISE
 *
 * This file is part of jEEBus.SHIP
 * For more information visit http://www.openmuc.org
 *
 * jEEBus.SHIP is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * jEEBus.SHIP is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with jEEBus.SHIP. If not, see http://www.gnu.org/licenses/.
 */

package org.openmuc.jeebus.ship.message.smeproth;

import java.util.List;
import java.util.Objects;

public class ProtocolHandshakeMsg {
    private ProtocolHandshakeTypeType handshakeType;

    private int major;
    private int minor;

    private List formats;

    /**
     * no-argument constructor for serialization/deserialization
     */
    public ProtocolHandshakeMsg() {
    }

    public ProtocolHandshakeMsg(
        ProtocolHandshakeTypeType type,
        int major,
        int minor,
        List formats
    ) {
        this.handshakeType = type;
        this.major = major;
        this.minor = minor;
        this.formats = formats;
    }

    public ProtocolHandshakeTypeType getHandshakeType() {
        return handshakeType;
    }

    public void setHandshakeType(ProtocolHandshakeTypeType handshakeType) {
        this.handshakeType = handshakeType;
    }

    public int getMajor() {
        return major;
    }

    public void setMajor(int major) {
        this.major = major;
    }

    public int getMinor() {
        return minor;
    }

    public void setMinor(int minor) {
        this.minor = minor;
    }

    public List getFormats() {
        return formats;
    }

    public void setFormats(List formats) {
        this.formats = formats;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }

        if (!(obj instanceof ProtocolHandshakeMsg)) {
            return false;
        }

        final ProtocolHandshakeMsg other = (ProtocolHandshakeMsg) obj;

        if (this.handshakeType == null ?
            other.handshakeType != null :
            this.handshakeType != other.handshakeType) {
            return false;
        }

        if (this.minor != other.minor) {
            return false;
        }

        if (this.major != other.major) {
            return false;
        }

        return this.formats.equals(other.formats);

    }

    @Override
    public int hashCode() {
        return Objects.hash(handshakeType, major, minor, formats);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy