package org.leumasjaffe.charsheet.observer.helper; import java.util.function.BiFunction; import org.leumasjaffe.charsheet.model.observable.IntValue; public class IntValueHelper implements BiFunction { public Boolean apply( final String str, final IntValue ref ) { if ( ! Character.isDigit(str.charAt(0)) ) return false; final int newValue = Integer.parseInt( str ); if ( newValue == ref.value( ) ) return false; ref.value( newValue ); return true; } }