@Test public void testNull() { final StringToIntegerConverter converter1 = new StringToIntegerConverter(); final ValueConverter valueConverter = new ValueConverter( new StaticObjectProvider<>( Collections.singletonList( converter1 ) ) ); Assert.assertNull( valueConverter.convert( null, ValueType.INTEGER_POSITIVE, Integer.class ) ); }
public <R> R convert( @Nullable Object value, @Nonnull Class<R> targetType ) { try { return conversionService.convert( value, targetType ); } catch ( org.springframework.core.convert.ConversionException e ) { throw new ConversionException( e.getMessage() ); } }
ValueConverter { public <R> R convert( @Nullable Object value, @Nonnull Class<R> targetType ) { try { return conversionService.convert( value, targetType ); } catch ( org.springframework.core.convert.ConversionException e ) { throw new ConversionException( e.getMessage() ); } } }
ValueConverter { public <R> R convert( @Nullable Object value, @Nonnull Class<R> targetType ) { try { return conversionService.convert( value, targetType ); } catch ( org.springframework.core.convert.ConversionException e ) { throw new ConversionException( e.getMessage() ); } } ValueConverter( @Nonnull ObjectProvider<List<TypedConverter<?, ?>>> converters ); }
ValueConverter { public <R> R convert( @Nullable Object value, @Nonnull Class<R> targetType ) { try { return conversionService.convert( value, targetType ); } catch ( org.springframework.core.convert.ConversionException e ) { throw new ConversionException( e.getMessage() ); } } ValueConverter( @Nonnull ObjectProvider<List<TypedConverter<?, ?>>> converters ); R convert( @Nullable Object value, @Nonnull Class<R> targetType ); @SuppressWarnings( "unchecked" ) @Nullable R convert( @Nullable Object value, @Nonnull ValueType valueType, @Nonnull Class<R> resultClass ); }
ValueConverter { public <R> R convert( @Nullable Object value, @Nonnull Class<R> targetType ) { try { return conversionService.convert( value, targetType ); } catch ( org.springframework.core.convert.ConversionException e ) { throw new ConversionException( e.getMessage() ); } } ValueConverter( @Nonnull ObjectProvider<List<TypedConverter<?, ?>>> converters ); R convert( @Nullable Object value, @Nonnull Class<R> targetType ); @SuppressWarnings( "unchecked" ) @Nullable R convert( @Nullable Object value, @Nonnull ValueType valueType, @Nonnull Class<R> resultClass );  }