/*
 * Copyright (c) 2016-2019 Chronicle Software Ltd
 */

package town.lost.oms.dto;

import net.openhft.chronicle.wire.*;

public class AbstractEvent<E extends AbstractEvent<E>> extends AbstractMarshallable {
    @LongConversion(Base85LongConverter.class)
    private long sender;

    @LongConversion(Base85LongConverter.class)
    private long target;

    // client sending time
    @LongConversion(MicroTimestampLongConverter.class)
    private long sendingTime;

    public long sender() {
        return sender;
    }

    public E sender(long sender) {
        this.sender = sender;
        return (E) this;
    }

    public long target() {
        return target;
    }

    public E target(long target) {
        this.target = target;
        return (E) this;
    }

    public long sendingTime() {
        return sendingTime;
    }

    public E sendingTime(long sendingTime) {
        this.sendingTime = sendingTime;
        return (E) this;
    }

    @Override
    public void writeMarshallable(WireOut out) {
        out.write("sender").writeLong(sender);
        out.write("target").writeLong(target);
        out.write("sendingTime").writeLong(sendingTime);
    }

    @Override
    public void readMarshallable(WireIn in) {
        sender = in.read("sender").readLong();
        target = in.read("target").readLong();
        sendingTime = in.read("sendingTime").readLong();
    }
}

@@ -113,17 +113,204 @@
 le.wire.
-*
+AbstractMarshallable;%0Aimport net.openhft.chronicle.wire.Base85LongConverter;%0Aimport net.openhft.chronicle.wire.LongConversion;%0Aimport net.openhft.chronicle.wire.MicroTimestampLongConverter
 ;%0A%0Apubli
@@ -1133,32 +1133,34 @@
 E) this;%0A    %7D%0A%0A
+//
     @Override%0A  
@@ -1149,32 +1149,34 @@
 //    @Override%0A
+//
     public void 
@@ -1204,24 +1204,26 @@
 eOut out) %7B%0A
+//
         out.
@@ -1257,16 +1257,18 @@
 ender);%0A
+//
         
@@ -1306,16 +1306,18 @@
 arget);%0A
+//
         
@@ -1365,23 +1365,29 @@
 gTime);%0A
+//
     %7D%0A
-%0A
+//%0A//
     @Ove
@@ -1392,16 +1392,18 @@
 verride%0A
+//
     publ
@@ -1436,24 +1436,26 @@
 ireIn in) %7B%0A
+//
         send
@@ -1481,32 +1481,34 @@
 r%22).readLong();%0A
+//
         target =
@@ -1534,24 +1534,26 @@
 readLong();%0A
+//
         send
@@ -1597,16 +1597,18 @@
 Long();%0A
+//
     %7D%0A%7D%0A

allow parsing of AbstractEvent