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

org.yamcs.cfdp.CfdpTransactionId Maven / Gradle / Ivy

There is a newer version: 5.10.9
Show newest version
package org.yamcs.cfdp;

import java.util.Objects;

public class CfdpTransactionId {
    private int sequenceNumber;
    private long initiatorEntity;

    public CfdpTransactionId(long entityId, long sequenceNumber) {
        this.initiatorEntity = entityId;
        this.sequenceNumber = (int)sequenceNumber;
    }

    public int getSequenceNumber() {
        return sequenceNumber;
    }

    public long getInitiatorEntity() {
        return initiatorEntity;
    }

    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null) {
            return false;
        }
        if (getClass() != o.getClass()) {
            return false;
        }
        CfdpTransactionId other = (CfdpTransactionId) o;
        return sequenceNumber == other.sequenceNumber && initiatorEntity == other.initiatorEntity;
    }

    @Override
    public int hashCode() {
        return Objects.hash(sequenceNumber, initiatorEntity);
    }
    
    @Override
    public String toString() {
        return initiatorEntity+"_"+sequenceNumber;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy