@Test public void shouldCreateDecimalFromLongValue() { assertThat(factory.create(1l), is(BigDecimal.valueOf(1l))); }
@Override public BigDecimal create( String value ) { if (value == null) return null; try { return new BigDecimal(value.trim()); } catch (NumberFormatException err) { throw new ValueFormatException(value, getPropertyType(), GraphI18n.errorConvertingType.text(String.class.getSimpleName(), BigDecimal.class.getSimpleName(), value), err); } }
DecimalValueFactory extends AbstractValueFactory<BigDecimal> { @Override public BigDecimal create( String value ) { if (value == null) return null; try { return new BigDecimal(value.trim()); } catch (NumberFormatException err) { throw new ValueFormatException(value, getPropertyType(), GraphI18n.errorConvertingType.text(String.class.getSimpleName(), BigDecimal.class.getSimpleName(), value), err); } } }
DecimalValueFactory extends AbstractValueFactory<BigDecimal> { @Override public BigDecimal create( String value ) { if (value == null) return null; try { return new BigDecimal(value.trim()); } catch (NumberFormatException err) { throw new ValueFormatException(value, getPropertyType(), GraphI18n.errorConvertingType.text(String.class.getSimpleName(), BigDecimal.class.getSimpleName(), value), err); } } DecimalValueFactory( TextDecoder decoder,
                                ValueFactories factories ); }
DecimalValueFactory extends AbstractValueFactory<BigDecimal> { @Override public BigDecimal create( String value ) { if (value == null) return null; try { return new BigDecimal(value.trim()); } catch (NumberFormatException err) { throw new ValueFormatException(value, getPropertyType(), GraphI18n.errorConvertingType.text(String.class.getSimpleName(), BigDecimal.class.getSimpleName(), value), err); } } DecimalValueFactory( TextDecoder decoder,
                                ValueFactories factories ); @Override ValueFactory<BigDecimal> with( ValueFactories valueFactories ); @Override BigDecimal create( String value ); @Override BigDecimal create( String value,
                              TextDecoder decoder ); @Override BigDecimal create( int value ); @Override BigDecimal create( long value ); @Override BigDecimal create( boolean value ); @Override BigDecimal create( float value ); @Override BigDecimal create( double value ); @Override BigDecimal create( BigDecimal value ); @Override BigDecimal create( Calendar value ); @Override BigDecimal create( Date value ); @Override BigDecimal create( DateTime value ); @Override BigDecimal create( Name value ); @Override BigDecimal create( Path value ); @Override BigDecimal create( Path.Segment value ); @Override BigDecimal create( Reference value ); @Override BigDecimal create( URI value ); @Override BigDecimal create( UUID value ); @Override BigDecimal create( NodeKey value ); @Override BigDecimal create( byte[] value ); @Override BigDecimal create( BinaryValue value ); @Override BigDecimal create( InputStream stream ); @Override BigDecimal[] createEmptyArray( int length ); }
DecimalValueFactory extends AbstractValueFactory<BigDecimal> { @Override public BigDecimal create( String value ) { if (value == null) return null; try { return new BigDecimal(value.trim()); } catch (NumberFormatException err) { throw new ValueFormatException(value, getPropertyType(), GraphI18n.errorConvertingType.text(String.class.getSimpleName(), BigDecimal.class.getSimpleName(), value), err); } } DecimalValueFactory( TextDecoder decoder,
                                ValueFactories factories ); @Override ValueFactory<BigDecimal> with( ValueFactories valueFactories ); @Override BigDecimal create( String value ); @Override BigDecimal create( String value,
                              TextDecoder decoder ); @Override BigDecimal create( int value ); @Override BigDecimal create( long value ); @Override BigDecimal create( boolean value ); @Override BigDecimal create( float value ); @Override BigDecimal create( double value ); @Override BigDecimal create( BigDecimal value ); @Override BigDecimal create( Calendar value ); @Override BigDecimal create( Date value ); @Override BigDecimal create( DateTime value ); @Override BigDecimal create( Name value ); @Override BigDecimal create( Path value ); @Override BigDecimal create( Path.Segment value ); @Override BigDecimal create( Reference value ); @Override BigDecimal create( URI value ); @Override BigDecimal create( UUID value ); @Override BigDecimal create( NodeKey value ); @Override BigDecimal create( byte[] value ); @Override BigDecimal create( BinaryValue value ); @Override BigDecimal create( InputStream stream ); @Override BigDecimal[] createEmptyArray( int length );  }