A product template is used to generate a set of products. Products allow inventory managers to control what salespeople can sell.
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;
6667686970717273747576777879808182
public PqlTest() {} @Before public void setUp() throws Exception { column1 = new ColumnType(); column1.setLabelName("column1"); column2 = new ColumnType(); column2.setLabelName("column2"); column3 = new ColumnType(); column3.setLabelName("column3"); textValue1 = new TextValue(); textValue1.setValue("value1");
103104105106107108109110111112113
numberValue3 = new NumberValue(); numberValue3.setValue("-1"); dateTime1 = new DateTime(); date1 = new Date(); date1.setYear(2012); date1.setMonth(12); date1.setDay(2); dateTime1.setDate(date1); dateTime1.setHour(12);
102103104105106107108109110111112
numberValue2.setValue("1.02"); numberValue3 = new NumberValue(); numberValue3.setValue("-1"); dateTime1 = new DateTime(); date1 = new Date(); date1.setYear(2012); date1.setMonth(12); date1.setDay(2); dateTime1.setDate(date1);
919293949596979899100101102
} else if (value instanceof String) { TextValue textValue = new TextValue(); textValue.setValue((String) value); return textValue; } else if (value instanceof DateTime) { DateTimeValue dateTimeValue = new DateTimeValue(); dateTimeValue.setValue((DateTime) value); return dateTimeValue; } else if (value instanceof Date) { DateValue dateValue = new DateValue(); dateValue.setValue((Date) value); return dateValue;
113114115116117118119120121122123
dateTime1.setHour(12); dateTime1.setMinute(45); dateTime1.setSecond(0); dateTime1.setTimeZoneID(TIME_ZONE_ID1); dateTimeValue1 = new DateTimeValue(); dateTimeValue1.setValue(dateTime1); dateValue1 = new DateValue(); dateValue1.setValue(date1); }
133134135136137138139140
@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())); }
9596979899100101102103104105106
} else if (value instanceof DateTime) { DateTimeValue dateTimeValue = new DateTimeValue(); dateTimeValue.setValue((DateTime) value); return dateTimeValue; } else if (value instanceof Date) { DateValue dateValue = new DateValue(); dateValue.setValue((Date) value); return dateValue; } else { throw new IllegalArgumentException("Unsupported Value type [" + value.getClass() + "]"); } }