This implementation follows section 3.5.4 of the Java Message Service specification (Version 1.1 April 12, 2002).
TODO - should have typed property getters and do conversions herein @author Tim Fox @author Clebert Suconic
84858687888990919293949596979899100
textValue2.setValue("value2"); textValue3 = new TextValue(); textValue3.setValue("value3"); booleanValue1 = new BooleanValue(); booleanValue1.setValue(false); booleanValue2 = new BooleanValue(); booleanValue2.setValue(true); booleanValue3 = new BooleanValue(); booleanValue3.setValue(false); numberValue1 = new NumberValue(); numberValue1.setValue("1");
131132133134135136137138139140
} @Test public void testToString_null() { assertEquals("", Pql.toString(new TextValue())); assertEquals("", Pql.toString(new BooleanValue())); assertEquals("", Pql.toString(new NumberValue())); assertEquals("", Pql.toString(new DateTimeValue())); assertEquals("", Pql.toString(new DateValue())); }
798081828384858687888990
return (Value) value; } else if (value == null) { return new TextValue(); } else { if (value instanceof Boolean) { BooleanValue booleanValue = new BooleanValue(); booleanValue.setValue((Boolean) value); return booleanValue; } else if (value instanceof Double || value instanceof Long || value instanceof Integer) { NumberValue numberValue = new NumberValue(); numberValue.setValue(value.toString()); return numberValue;
184185186187188189190191192193194
return (Value) value; } else if (value == null) { return new TextValue(null, null); } else { if (value instanceof Boolean) { return new BooleanValue(null, (Boolean) value); } else if (value instanceof Double) { return new NumberValue(null, value.toString()); } else if (value instanceof String) { return new TextValue(null, (String) value); } else if (value instanceof Long) {
186187188189190191192193194195196