ctongfei / progressbar

Terminal-based progress bar for Java / JVM
http://tongfei.me/progressbar/
MIT License
1.07k stars 102 forks source link

ProgressBarBuilder()#setEtaFunction is pointless because all methods in ProgressState are package-private #147

Closed natanfudge closed 1 year ago

natanfudge commented 1 year ago

setEtaFunction accepts a (BiFunction<ProgressState, Duration, Optional<Duration>>, but it's impossible to use ProgressState for consumers because everything there is package-private. setEtaFunction should either accept a Bifunction that provides objects that are actually usable, or ProgressState and its methods should become public.

ctongfei commented 1 year ago

Thanks @natanfudge ! My fault, will have to make that class public.

ctongfei commented 1 year ago

See #146: I think a better way is to change setETAFunction so that it accepts BiFunction<ProgressBar, Duration, Optional<Duration>>. Let me know if you have any objections.

ctongfei commented 1 year ago

Fixed in 0.9.5.