org.bklab.flow.convertor.DoubleToIntConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fluent-vaadin-flow Show documentation
Show all versions of fluent-vaadin-flow Show documentation
Broderick Labs for fluent vaadin flow. Inherits common Vaadin components.
package org.bklab.flow.convertor;
import com.vaadin.flow.data.binder.Result;
import com.vaadin.flow.data.binder.ValueContext;
import com.vaadin.flow.data.converter.Converter;
public class DoubleToIntConverter implements Converter {
@Override
public Result convertToModel(Double aDouble, ValueContext valueContext) {
return Result.ok(aDouble == null ? 0 : aDouble.intValue());
}
@Override
public Double convertToPresentation(Integer integer, ValueContext valueContext) {
return integer == null ? 0d : integer.doubleValue();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy