public static UnsignedByte valueOf(final String value) throws NumberFormatException { int intVal = Integer.parseInt(value); if(intVal < 0 || intVal >= (1<<8)) { throw new NumberFormatException("Value \""+value+"\" lies outside the range [" + 0 + "-" + (1<<8) +")."); } return valueOf((byte)intVal); }
public UnsignedByteWriter(final UnsignedByte value) { super(value.byteValue()); }
public static ReceiverSettleMode valueOf(Object obj) { if (obj instanceof UnsignedByte) { UnsignedByte val = (UnsignedByte) obj; if (FIRST._val.equals(val)) { return FIRST; } if (SECOND._val.equals(val)) { return SECOND; } } final String message = String.format("Cannot convert '%s' into 'receiver-settle-mode'", obj); throw new IllegalArgumentException(message); }
@Override public short shortValue() { return (short) intValue(); }
@Override public float floatValue() { return (float) longValue(); }
return ((UnsignedByte)value).shortValue();
@Override public double doubleValue() { return (double) longValue(); }
@Override public UnsignedByte construct(final QpidByteBuffer in, final ValueHandler handler) throws AmqpErrorException { if (in.hasRemaining()) { byte b = in.get(); return UnsignedByte.valueOf(b); } else { throw new AmqpErrorException(AmqpError.DECODE_ERROR, "Cannot construct ubyte: insufficient input data"); } } }
@Override public String toString() { return String.valueOf(intValue()); }
public static SenderSettleMode valueOf(Object obj) { if (obj instanceof UnsignedByte) { UnsignedByte val = (UnsignedByte) obj; if (UNSETTLED._val.equals(val)) { return UNSETTLED; } if (SETTLED._val.equals(val)) { return SETTLED; } if (MIXED._val.equals(val)) { return MIXED; } } final String message = String.format("Cannot convert '%s' into 'sender-settle-mode'", obj); throw new IllegalArgumentException(message); }
@Override public byte getPriority() { if (_headerSection == null || _headerSection.getValue().getPriority() == null) { return 4; //javax.jms.Message.DEFAULT_PRIORITY; } else { return _headerSection.getValue().getPriority().byteValue(); } }
if (deliveryProps.hasPriority()) header.setPriority(UnsignedByte.valueOf((byte) deliveryProps.getPriority().getValue()));
header.setPriority(UnsignedByte.valueOf(contentHeader.getPriority()));
header.setPriority(UnsignedByte.valueOf(serverMessage.getMessageHeader().getPriority())); if(serverMessage.getExpiration() != 0l && serverMessage.getArrivalTime() !=0l && serverMessage.getExpiration() >= serverMessage.getArrivalTime())