Class ProcessingUnitStatusBuilder


  • public class ProcessingUnitStatusBuilder
    extends java.lang.Object
    Defines the processing unit status builder
    • Constructor Detail

      • ProcessingUnitStatusBuilder

        public ProcessingUnitStatusBuilder()
        Constructor for ProcessingUnitStatusBuilder
      • ProcessingUnitStatusBuilder

        public ProcessingUnitStatusBuilder​(ProcessingUnitProgress processingUnitProgress)
        Constructor for ProcessingUnitStatusBuilder
        Parameters:
        processingUnitProgress - the processing unit progress
    • Method Detail

      • hasNext

        public boolean hasNext()
        Get the current hasNext attribute value back.
        Returns:
        true if it has more element; otherwise it has ended.
      • hasNext

        public ProcessingUnitStatusBuilder hasNext​(boolean hasNext)
        Defines if there are more unit tor process.
        Parameters:
        hasNext - true if there are more units to process; otherwise false
        Returns:
        this instance
      • hasNextIfHasUnprocessedUnits

        public ProcessingUnitStatusBuilder hasNextIfHasUnprocessedUnits()
        Mark there are more units in case there are still unprocessed units
        Returns:
        this instance
      • hasMoreUnitsToProcess

        public ProcessingUnitStatusBuilder hasMoreUnitsToProcess()
        Mark there are more units to process
        Returns:
        this instance
      • increaseNumberOfSuccessfulUnits

        public ProcessingUnitStatusBuilder increaseNumberOfSuccessfulUnits()
        Increase the number of successful processed units.
        Returns:
        this instance
      • increaseNumberOfSuccessfulUnits

        public ProcessingUnitStatusBuilder increaseNumberOfSuccessfulUnits​(java.lang.Long numberOfSuccessfulUnits)
        Increase the number of successful processed units.
        Parameters:
        numberOfSuccessfulUnits - the number of successful units to add
        Returns:
        this instance
      • setNumberOfSuccessfulUnits

        public ProcessingUnitStatusBuilder setNumberOfSuccessfulUnits​(java.lang.Long numberOfSuccessfulUnits)
        Set the number of successful processed units.
        Parameters:
        numberOfSuccessfulUnits - the number of successful processed units to set
        Returns:
        this instance
      • increaseNumberOfFailedUnits

        public ProcessingUnitStatusBuilder increaseNumberOfFailedUnits()
        Increase the number of failed processed units.
        Returns:
        this instance
      • increaseNumberOfFailedUnits

        public ProcessingUnitStatusBuilder increaseNumberOfFailedUnits​(java.lang.Long numberOfFailedUnits)
        Increase the number of failed processed units.
        Parameters:
        numberOfFailedUnits - the number of failed units to add
        Returns:
        this instance
      • setNumberOfFailedUnits

        public ProcessingUnitStatusBuilder setNumberOfFailedUnits​(java.lang.Long numberOfFailedUnits)
        Set the number of failed processed units.
        Parameters:
        numberOfFailedUnits - the number of failed processed units to set
        Returns:
        this instance
      • increaseNumberOfUnprocessedUnits

        public ProcessingUnitStatusBuilder increaseNumberOfUnprocessedUnits()
        Increase the number of unprocessed units.
        Returns:
        this instance
      • increaseNumberOfUnprocessedUnits

        public ProcessingUnitStatusBuilder increaseNumberOfUnprocessedUnits​(java.lang.Long numberOfUnprocessedUnits)
        Increase the number of unprocessed units.
        Parameters:
        numberOfUnprocessedUnits - the number of unprocessed units to add
        Returns:
        this instance
      • setNumberOfUnprocessedUnits

        public ProcessingUnitStatusBuilder setNumberOfUnprocessedUnits​(java.lang.Long numberOfUnprocessedUnits)
        Set optionally the number of unprocessed units
        Parameters:
        numberOfUnprocessedUnits - the number of unprocessed units
        Returns:
        this instance
      • warn

        public ProcessingUnitStatusBuilder warn​(java.lang.String message)
        Processing has a warning.
        Parameters:
        message - the message
        Returns:
        this instance
      • error

        public ProcessingUnitStatusBuilder error​(java.lang.String message)
        Processing has an error.
        Parameters:
        message - the message
        Returns:
        this instance
      • addMessage

        public ProcessingUnitStatusBuilder addMessage​(java.lang.String message)
        Processing add a message
        Parameters:
        message - the message to add
        Returns:
        this instance
      • addMessageList

        public ProcessingUnitStatusBuilder addMessageList​(java.util.List<java.lang.String> messageList)
        Processing add messages
        Parameters:
        messageList - the messages to add
        Returns:
        this instance
      • statistic

        public ProcessingUnitStatusBuilder statistic​(java.lang.String key,
                                                     java.lang.Long value)
        Add a statistic value
        Parameters:
        key - the statistic key
        value - the value to add
        Returns:
        this instance
      • statistic

        public ProcessingUnitStatusBuilder statistic​(java.lang.String key,
                                                     java.lang.Double value)
        Add a statistic value
        Parameters:
        key - the statistic key
        value - the value to add
        Returns:
        this instance
      • statistic

        public ProcessingUnitStatusBuilder statistic​(java.lang.String key,
                                                     com.github.toolarium.common.statistic.StatisticCounter statisticCounter)
        Add a statistic value
        Parameters:
        key - the statistic key
        statisticCounter - the statistic counter to add
        Returns:
        this instance
      • build

        public IProcessingUnitStatus build()
        Build the processing unit status
        Returns:
        the processing unit status
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        See Also:
        Object.toString()