title: Convert from Java to C#
body: <p>I need to write this code in C#. Any help would be appreciated. 
  The interface and the first class is where the issues are. How can I convert that into C#? EnumByteConverter &amp; EnumByteConverter>? 
  Is this even possible? What would my options be?</p>
  
  <pre><code>public interface EnumByteConverter&lt;E extends Enum&lt;E&gt; &amp; EnumByteConverter&lt;E&gt;&gt;
  {
    byte convert();
    E convert(byte val);
  }
  
  
  
  
  public class ReverseByteEnumMap&lt;V extends Enum&lt;V&gt; &amp; EnumByteConverter&gt;
  {
    private Map&lt;Byte, V&gt; map = new HashMap&lt;&gt;();
  
    public ReverseByteEnumMap(Class&lt;V&gt; valueType)
    {
      for (V v : valueType.getEnumConstants())
      {
        map.put(v.convert(), v);
      }
    }
  
    public V get(byte num)
    {
      return map.get(num);
    }
  }
  
  
  
  
  public enum Transport implements EnumByteConverter&lt;Transport&gt;
  {
    FrameFormatB(0), 
    FrameFormatA(1), 
    FrameDraft(254),
    FrameUnknown(255);
  
    private static ReverseByteEnumMap&lt;Transport&gt; map = new ReverseByteEnumMap&lt;&gt;(Transport.class);
    private final byte value;
  
    Transport(int value)
    {
      this.value = (byte) value;
    }
  
    public byte convert()
    {
      return value;
    }
  
    public Transport convert(byte val)
    {
      return map.get(val);
    }
  
    public static Transport get(byte val)
    {
      return map.get(val);
    }
  }
  </code></pre>
  
  <p>This is what I have tried. I managed to implement the interface using struct, and the reverse class with similar thing. </p>
  
  <pre><code>  public interface IEnumByteConverter&lt;E&gt; where E : struct
    {
      byte Convert();
      E Convert(byte val);
    }
  }
  
  
  
    public class ReverseByteEnumMap&lt;T&gt; where T : struct, IEnumByteConverter&lt;T&gt;
    {
      private Dictionary&lt;Byte, T&gt; map = new Dictionary&lt;Byte, T&gt;();
      private IEnumByteConverter&lt;T&gt; converter;
  
      public ReverseByteEnumMap(T valueType)
      {
        foreach (T t in Enum.GetValues(typeof(T)))
          map.Add(t.Convert() , t);
      }
  
      public T Get(byte num)
      {
        return map[num];
      }
    }
  
  
    public class Transport : IEnumByteConverter&lt;TransportEnums&gt;
    {
  
      public enum TransportEnums
      {
        FrameFormatB = 0,
        FrameFormatA = 1,
        FrameDraft = 254,
        FrameUnknown = 255
      }
  
      private static ReverseByteEnumMap&lt;Transport&gt; map = new ReverseByteEnumMap&lt;Transport&gt; ();
      private byte value;
  
      Transport(int value)
      {
        this.value = (byte)value;
      }
  
      public byte Convert()
      {
        return value;
      }
  
      public TransportEnums Convert(byte val)
      {
        return map.Get(val);
      }
  
      public static TransportEnums Get(byte val)
      {
        return map.Get(val);
      }
  
    }
  </code></pre>
  
  <p>But I got stuck in the last class. I cannot use the Transport.class nor enums. I cannot tell if this a right path I am heading on </p>