public static UnsignedShort valueOf(short underlying) { if((underlying & 0xFF00) == 0) { return cachedValues[underlying]; } else { return new UnsignedShort(underlying); } }
@Override public float floatValue() { return (float) intValue(); }
@Override public String toString() { return String.valueOf(longValue()); }
public static UnsignedShort valueOf(final String value) { int intVal = Integer.parseInt(value); return valueOf(intVal); } }
body.put((byte) 2); // DOFF body.putShort(UnsignedShort.valueOf(frame.getChannel()).shortValue()); if (typeWriter != null)
@Override short convertValueToShort(UnsignedShort value) { return value.shortValue(); }
public static UnsignedShort valueOf(int intValue) { if (intValue < 0 || intValue >= (1 << 16)) { throw new NumberFormatException(String.format("Value \"%d\" lies outside the range [%d-%d).", intValue, 0, (1 << 16))); } return valueOf((short) intValue); }
@Override public double doubleValue() { return (double) intValue(); }
@Override public UnsignedShort construct(final QpidByteBuffer in, final ValueHandler handler) throws AmqpErrorException { if (in.hasRemaining(2)) { short s = in.getShort(); return UnsignedShort.valueOf(s); } else { throw new AmqpErrorException(AmqpError.DECODE_ERROR, "Cannot construct ushort: insufficient input data"); } } }
open.setChannelMax(UnsignedShort.valueOf((short) channelMax)); open.setContainerId(getAddressSpace() == null ? UUID.randomUUID().toString() : getAddressSpace().getId().toString()); open.setMaxFrameSize(UnsignedInteger.valueOf(maxFrameSize));
return ((UnsignedShort)value).intValue();
beginToSend.setRemoteChannel(UnsignedShort.valueOf(receivingChannelId)); beginToSend.setNextOutgoingId(session.getNextOutgoingId()); beginToSend.setOutgoingWindow(session.getOutgoingWindow());