@Test public void shouldCompareLongAndStringValues() { String strValue = "3"; Long longValue = factories.getLongFactory().create(strValue); assertThat(ValueComparators.OBJECT_COMPARATOR.compare(strValue, longValue), is(0)); assertThat(ValueComparators.OBJECT_COMPARATOR.compare(longValue, strValue), is(0)); }
protected long longValue( Object value ) { if (value instanceof Property) value = ((Property)value).getFirstValue(); return context.getValueFactories().getLongFactory().create(value); }
this.longFactory = new Factory<Long>(valueFactories.getLongFactory()); this.doubleFactory = new Factory<Double>(valueFactories.getDoubleFactory()); this.decimalFactory = new Factory<BigDecimal>(valueFactories.getDecimalFactory());
try { intervalInSeconds = context.getValueFactories().getLongFactory().create(intervalProp.getFirstValue()); } catch (RuntimeException e) { String actualValue = context.getValueFactories().getStringFactory().create(intervalProp.getFirstValue());
ValueFactories valueFactories = executionContext.getValueFactories(); ValueFactory<String> strings = valueFactories.getStringFactory(); ValueFactory<Long> longs = valueFactories.getLongFactory(); ProjectionParser projectionParser = ProjectionParser.getInstance(); NamespaceRegistry registry = executionContext.getNamespaceRegistry();