@Test public void testGetEncodingWithZero() { DecoderImpl decoder = new DecoderImpl(); EncoderImpl encoder = new EncoderImpl(decoder); UnsignedLongType ult = new UnsignedLongType(encoder, decoder); UnsignedLongEncoding encoding = ult.getEncoding(UnsignedLong.valueOf(0L)); assertEquals("incorrect encoding returned", EncodingCodes.ULONG0, encoding.getEncodingCode()); }
public UnsignedLongEncoding getEncoding(final UnsignedLong val) { long l = val.longValue(); return l == 0L ? _zeroUnsignedLongEncoding : (l >= 0 && l <= 255L) ? _smallUnsignedLongEncoding : _unsignedLongEncoding; }
UnsignedLongType extends AbstractPrimitiveType<UnsignedLong> { public UnsignedLongEncoding getEncoding(final UnsignedLong val) { long l = val.longValue(); return l == 0L ? _zeroUnsignedLongEncoding : (l >= 0 && l <= 255L) ? _smallUnsignedLongEncoding : _unsignedLongEncoding; } }
UnsignedLongType extends AbstractPrimitiveType<UnsignedLong> { public UnsignedLongEncoding getEncoding(final UnsignedLong val) { long l = val.longValue(); return l == 0L ? _zeroUnsignedLongEncoding : (l >= 0 && l <= 255L) ? _smallUnsignedLongEncoding : _unsignedLongEncoding; } UnsignedLongType(final EncoderImpl encoder, final DecoderImpl decoder); }
UnsignedLongType extends AbstractPrimitiveType<UnsignedLong> { public UnsignedLongEncoding getEncoding(final UnsignedLong val) { long l = val.longValue(); return l == 0L ? _zeroUnsignedLongEncoding : (l >= 0 && l <= 255L) ? _smallUnsignedLongEncoding : _unsignedLongEncoding; } UnsignedLongType(final EncoderImpl encoder, final DecoderImpl decoder); Class<UnsignedLong> getTypeClass(); UnsignedLongEncoding getEncoding(final UnsignedLong val); void fastWrite(EncoderImpl encoder, UnsignedLong value); UnsignedLongEncoding getCanonicalEncoding(); Collection<UnsignedLongEncoding> getAllEncodings(); }
UnsignedLongType extends AbstractPrimitiveType<UnsignedLong> { public UnsignedLongEncoding getEncoding(final UnsignedLong val) { long l = val.longValue(); return l == 0L ? _zeroUnsignedLongEncoding : (l >= 0 && l <= 255L) ? _smallUnsignedLongEncoding : _unsignedLongEncoding; } UnsignedLongType(final EncoderImpl encoder, final DecoderImpl decoder); Class<UnsignedLong> getTypeClass(); UnsignedLongEncoding getEncoding(final UnsignedLong val); void fastWrite(EncoderImpl encoder, UnsignedLong value); UnsignedLongEncoding getCanonicalEncoding(); Collection<UnsignedLongEncoding> getAllEncodings();  }