Class ChangingStatusLogger.ChangingStatusDefault
- java.lang.Object
-
- de.fraunhofer.iosb.ilt.sensorthingsmanager.utils.ChangingStatusLogger.ChangingStatusDefault
-
- All Implemented Interfaces:
ChangingStatusLogger.ChangingStatus
- Enclosing class:
- ChangingStatusLogger
public static class ChangingStatusLogger.ChangingStatusDefault extends Object implements ChangingStatusLogger.ChangingStatus
-
-
Constructor Summary
Constructors Constructor Description ChangingStatusDefault(String logMessageTemplate, int paramCount)ChangingStatusDefault(String logMessageTemplate, Object[] status)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object[]getCopyCurrentParams()Get a copy of the parameters array.Object[]getCurrentParams()Get the parameters to pass to the logger when logging a message.StringgetLogMessageTemplate()Get the message template.voidlogIfChanged(org.slf4j.Logger logger)Check if the status changed, and if so, log the configured message to the given logger.voidsetAllTo(Object value)voidsetObjectAt(int idx, Object value)
-
-
-
Method Detail
-
setAllTo
public final void setAllTo(Object value)
-
setObjectAt
public final void setObjectAt(int idx, Object value)
-
getLogMessageTemplate
public String getLogMessageTemplate()
Description copied from interface:ChangingStatusLogger.ChangingStatusGet the message template.- Specified by:
getLogMessageTemplatein interfaceChangingStatusLogger.ChangingStatus- Returns:
- the message template, with placeholders for the parameters, to pass to the logger.
-
getCurrentParams
public final Object[] getCurrentParams()
Description copied from interface:ChangingStatusLogger.ChangingStatusGet the parameters to pass to the logger when logging a message.- Specified by:
getCurrentParamsin interfaceChangingStatusLogger.ChangingStatus- Returns:
- The parameters to pass to the logger.
-
getCopyCurrentParams
public Object[] getCopyCurrentParams()
Description copied from interface:ChangingStatusLogger.ChangingStatusGet a copy of the parameters array.- Specified by:
getCopyCurrentParamsin interfaceChangingStatusLogger.ChangingStatus- Returns:
- a copy of the parameters array.
-
logIfChanged
public void logIfChanged(org.slf4j.Logger logger)
Description copied from interface:ChangingStatusLogger.ChangingStatusCheck if the status changed, and if so, log the configured message to the given logger. The method will be periodically called.- Specified by:
logIfChangedin interfaceChangingStatusLogger.ChangingStatus- Parameters:
logger- The logger to log to.
-
-