Class PercentProgressPublisher

java.lang.Object
org.xblackcat.sjpu.cli.progress.AProgressPublisher
org.xblackcat.sjpu.cli.progress.PercentProgressPublisher
All Implemented Interfaces:
IProgressPublisher

public class PercentProgressPublisher extends AProgressPublisher
  • Constructor Details

    • PercentProgressPublisher

      public PercentProgressPublisher(Consumer<String> output, long total)
    • PercentProgressPublisher

      public PercentProgressPublisher(Consumer<String> output, long total, String formatString)
      Build Percent progress builder with custom progress string
      Parameters:
      output -
      total -
      formatString - formatted progress string. Can accept two arguments: 1. double(percentage value) and 2. long (total elements amount). See FORMAT fpr details
  • Method Details

    • publish

      public boolean publish(long current)
      Description copied from interface: IProgressPublisher
      Publish and render a new value for progress
      Parameters:
      current - new progress value
      Returns:
      true if progress string has changed