JBBPFieldUShort extends JBBPAbstractField implements JBBPNumericField { @Override public int getAsInt() { return this.value & 0xFFFF; } JBBPFieldUShort(final JBBPNamedFieldInfo name, final short value); static long reverseBits(final short value); @Override double getAsDouble(); @Override float getAsFloat(); @Override int getAsInt(); @Override long getAsLong(); @Override boolean getAsBool(); @Override long getAsInvertedBitOrder(); @Override String getTypeAsString();  }
@Test public void testgetAsInt() { assertEquals(23432, new JBBPFieldUShort(new JBBPNamedFieldInfo("test.field", "field", 123), (short) 23432).getAsInt()); assertEquals(-23432 & 0xFFFF, new JBBPFieldUShort(new JBBPNamedFieldInfo("test.field", "field", 123), (short) -23432).getAsInt()); }