package net.openhft.chronicle.wire;

import net.openhft.chronicle.bytes.Bytes;
import org.jetbrains.annotations.NotNull;
import org.junit.Test;

import static net.openhft.chronicle.wire.WireMarshaller.WIRE_MARSHALLER_CL;

@SuppressWarnings("rawtypes")
public class FloatDtoTest extends WireTestCommon {

    @Test
    public void test() {
        @NotNull final Value value = new Value(99, 2000f);
        final Bytes bytes = Wires.acquireBytes();
        final Wire w = WireType.BINARY.apply(bytes);
        w.write().marshallable(value);
        @NotNull Value object1 = new Value(0, 0.0f);
        w.read().marshallable(object1);
    }

    private static class Key extends SelfDescribingMarshallable implements
            KeyedMarshallable {
        @SuppressWarnings("unused")
        int uiid;

        Key(int uiid) {
            this.uiid = uiid;
        }

        @SuppressWarnings("unchecked")
        @Override
        public void writeKey(@NotNull Bytes bytes) {
            WIRE_MARSHALLER_CL.get(Key.class).writeKey(this, bytes);
        }
    }

    private static class Value extends Key implements Marshallable {

        @SuppressWarnings("unused")
        final float myFloat;

        Value(int uiid,
              float myFloat) {
            super(uiid);
            this.myFloat = myFloat;
        }
    }

}

@@ -142,85 +142,8 @@
 t;%0A%0A
-import static net.openhft.chronicle.wire.WireMarshaller.WIRE_MARSHALLER_CL;%0A%0A
 @Sup
@@ -552,39 +552,32 @@
 t1);%0A    %7D%0A%0A    
-private
  static class Ke
@@ -636,16 +636,17 @@
         
+ 
 KeyedMar
@@ -657,16 +657,17 @@
 lable %7B%0A
+ 
         
@@ -702,16 +702,17 @@
         
+ 
 int uiid
@@ -714,16 +714,17 @@
  uiid;%0A%0A
+ 
         
@@ -747,24 +747,25 @@
             
+ 
 this.uiid = 
@@ -782,218 +782,22 @@
     
-%7D%0A%0A        @SuppressWarnings(%22unchecked%22)%0A        @Override%0A        public void writeKey(@NotNull Bytes bytes) %7B%0A            WIRE_MARSHALLER_CL.get(Key.class).writeKey(this, bytes);%0A        %7D%0A    %7D%0A%0A    private
+ %7D%0A     %7D%0A%0A   
  sta

Simplify KeyedMarshallable