package lc.esp.eo.sdk;

import java.time.Instant;

/**
 * This extended form of an {@link EO} contains specific data attributes to make it an EO association.
 *
 * @author Alex Leigh
 * @since mk20 (TOKYO PROTOCOL)
 */
public class EOAssociation extends EO {
    private final EOId srcObjectId;
    private final EOId dstObjectId;

    public EOAssociation(EOId srcObject, EOId dstObject, String type, Instant ctime) {
        super(type, null, ctime);
        this.srcObjectId = srcObject;
        this.dstObjectId = dstObject;
    }

    public EOId getSrcObjectId() {
        return srcObjectId;
    }

    public EOId getDstObjectId() {
        return dstObjectId;
    }

    @Override
    public String toString() {
        return "EOAssociation{" +
                "srcObject=" + srcObjectId +
                ", dstObject=" + dstObjectId +
                "} " + super.toString();
    }
}
