Class ProcessingUnitStatus
- java.lang.Object
-
- com.github.toolarium.processing.unit.runtime.ProcessingUnitStatus
-
- All Implemented Interfaces:
IProcessingUnitStatus,java.io.Serializable
public class ProcessingUnitStatus extends java.lang.Object implements IProcessingUnitStatus, java.io.Serializable
Implements theIProcessingUnitStatus.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ProcessingUnitStatus()Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddStatistic(java.lang.String key, java.lang.Double value)Add statisticvoidaddStatistic(java.lang.String key, java.lang.Long value)Add statisticbooleanequals(java.lang.Object obj)java.lang.LonggetNumberOfFailedUnits()Gets the number of failed units processed in this run.java.lang.LonggetNumberOfSuccessfulUnits()Gets the number of successful units.java.lang.LonggetNumberOfUnprocessedUnits()Optional the number of unprocessed units can be returned.ProcessingRuntimeStatusgetProcessingRuntimeStatus()The processing runtime status for this run.IProcessingUnitStatisticgetProcessingUnitStatistic()Get the processing unit statistic just a the last call.com.github.toolarium.common.statistic.StatisticCountergetStatisticCounter(java.lang.String key)Get statistic counterjava.lang.StringgetStatusMessage()A return message can be passed.inthashCode()ProcessingUnitStatushasMoreUnitsToProcess()Mark there are more units to processbooleanhasNext()Defines if there is more to process or not.ProcessingUnitStatusincreaseNumberOfFailedUnits()Increase the number of failed unitsProcessingUnitStatusincreaseNumberOfSuccessfulUnits()Increase the number of successful unitsProcessingUnitStatussetHasNext(boolean hasNext)Set has nextProcessingUnitStatussetNumberOfFailedUnits(java.lang.Long numberOfFailedUnits)Set the number of failed unitsProcessingUnitStatussetNumberOfSuccessfulUnits(java.lang.Long numberOfSuccessfulUnits)Set the number of successful unitsProcessingUnitStatussetNumberOfUnprocessedUnits(java.lang.Long numberOfUnprocessedUnits)Set the number of unprocessed unitsProcessingUnitStatussetProcessingRuntimeStatus(ProcessingRuntimeStatus processingRuntimeStatus)Set the processing runtime statisProcessingUnitStatussetStatusMessage(java.lang.String statusMessage)Sets the status messagejava.lang.StringtoString()
-
-
-
Method Detail
-
hasNext
public boolean hasNext()
Description copied from interface:IProcessingUnitStatusDefines if there is more to process or not.- Specified by:
hasNextin interfaceIProcessingUnitStatus- Returns:
- true if it has more element; otherwise it has ended.
- See Also:
IProcessingUnitStatus.hasNext()
-
hasMoreUnitsToProcess
public ProcessingUnitStatus hasMoreUnitsToProcess()
Mark there are more units to process- Returns:
- this instance
-
setHasNext
public ProcessingUnitStatus setHasNext(boolean hasNext)
Set has next- Parameters:
hasNext- true if it has more to process.- Returns:
- this instance
-
getNumberOfSuccessfulUnits
public java.lang.Long getNumberOfSuccessfulUnits()
Description copied from interface:IProcessingUnitStatusGets the number of successful units.- Specified by:
getNumberOfSuccessfulUnitsin interfaceIProcessingUnitStatus- Returns:
- the number of successful units or null.
- See Also:
IProcessingUnitStatus.getNumberOfSuccessfulUnits()
-
setNumberOfSuccessfulUnits
public ProcessingUnitStatus setNumberOfSuccessfulUnits(java.lang.Long numberOfSuccessfulUnits)
Set the number of successful units- Parameters:
numberOfSuccessfulUnits- the number of successful units- Returns:
- this instance
-
increaseNumberOfSuccessfulUnits
public ProcessingUnitStatus increaseNumberOfSuccessfulUnits()
Increase the number of successful units- Returns:
- this instance
-
getNumberOfFailedUnits
public java.lang.Long getNumberOfFailedUnits()
Description copied from interface:IProcessingUnitStatusGets the number of failed units processed in this run.- Specified by:
getNumberOfFailedUnitsin interfaceIProcessingUnitStatus- Returns:
- the number of failed units or null.
- See Also:
IProcessingUnitStatus.getNumberOfFailedUnits()
-
setNumberOfFailedUnits
public ProcessingUnitStatus setNumberOfFailedUnits(java.lang.Long numberOfFailedUnits)
Set the number of failed units- Parameters:
numberOfFailedUnits- the number of failed units- Returns:
- this instance
-
increaseNumberOfFailedUnits
public ProcessingUnitStatus increaseNumberOfFailedUnits()
Increase the number of failed units- Returns:
- this instance
-
getNumberOfUnprocessedUnits
public java.lang.Long getNumberOfUnprocessedUnits()
Description copied from interface:IProcessingUnitStatusOptional the number of unprocessed units can be returned.- Specified by:
getNumberOfUnprocessedUnitsin interfaceIProcessingUnitStatus- Returns:
- the number of unprocessed units.
- See Also:
IProcessingUnitStatus.getNumberOfFailedUnits()
-
setNumberOfUnprocessedUnits
public ProcessingUnitStatus setNumberOfUnprocessedUnits(java.lang.Long numberOfUnprocessedUnits)
Set the number of unprocessed units- Parameters:
numberOfUnprocessedUnits- the number of unprocessed units- Returns:
- this instance
-
getProcessingRuntimeStatus
public ProcessingRuntimeStatus getProcessingRuntimeStatus()
Description copied from interface:IProcessingUnitStatusThe processing runtime status for this run. If it's null then it will be interpreted as successful.- Specified by:
getProcessingRuntimeStatusin interfaceIProcessingUnitStatus- Returns:
- the processing runtime status or null
- See Also:
IProcessingUnitStatus.getProcessingRuntimeStatus()
-
setProcessingRuntimeStatus
public ProcessingUnitStatus setProcessingRuntimeStatus(ProcessingRuntimeStatus processingRuntimeStatus)
Set the processing runtime statis- Parameters:
processingRuntimeStatus- the processing runtime statis- Returns:
- this instance
-
getStatusMessage
public java.lang.String getStatusMessage()
Description copied from interface:IProcessingUnitStatusA return message can be passed. In case it's null then no status message is available.- Specified by:
getStatusMessagein interfaceIProcessingUnitStatus- Returns:
- a status message or null
- See Also:
IProcessingUnitStatus.getStatusMessage()
-
setStatusMessage
public ProcessingUnitStatus setStatusMessage(java.lang.String statusMessage)
Sets the status message- Parameters:
statusMessage- the status message- Returns:
- this instance
-
getProcessingUnitStatistic
public IProcessingUnitStatistic getProcessingUnitStatistic()
Description copied from interface:IProcessingUnitStatusGet the processing unit statistic just a the last call.- Specified by:
getProcessingUnitStatisticin interfaceIProcessingUnitStatus- Returns:
- the processing unit statistic of last call or null.
- See Also:
IProcessingUnitStatus.getProcessingUnitStatistic()
-
addStatistic
public void addStatistic(java.lang.String key, java.lang.Long value)Add statistic- Parameters:
key- the key / name of the statisticvalue- the value to add
-
addStatistic
public void addStatistic(java.lang.String key, java.lang.Double value)Add statistic- Parameters:
key- the key / name of the statisticvalue- the value to add
-
getStatisticCounter
public com.github.toolarium.common.statistic.StatisticCounter getStatisticCounter(java.lang.String key)
Get statistic counter- Parameters:
key- the key / name of the statistic- Returns:
- the statistic counter
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object- See Also:
Object.hashCode()
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object- See Also:
Object.equals(java.lang.Object)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- See Also:
Object.toString()
-
-