Package org.wso2.carbon.utils
Class DiagnosticLog.DiagnosticLogBuilder
- java.lang.Object
-
- org.wso2.carbon.utils.DiagnosticLog.DiagnosticLogBuilder
-
- Enclosing class:
- DiagnosticLog
public static class DiagnosticLog.DiagnosticLogBuilder extends Object
Builder class for DiagnosticLog. This class follows the Builder design pattern, providing a way to construct a DiagnosticLog object step by step.
-
-
Constructor Summary
Constructors Constructor Description DiagnosticLogBuilder(String componentId, String actionId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DiagnosticLogbuild()Constructs a DiagnosticLog object using the set parameters.DiagnosticLog.DiagnosticLogBuilderconfigParam(String key, Object value)Adds a new key-value pair to the configurations map of the DiagnosticLog.DiagnosticLog.DiagnosticLogBuilderconfigParams(Map<String,?> configurations)Adds all entries from the provided map to the configurations map of the DiagnosticLog.DiagnosticLog.DiagnosticLogBuilderinputParam(String key, Object value)Adds a new key-value pair to the input map of the DiagnosticLog.DiagnosticLog.DiagnosticLogBuilderinputParams(Map<String,?> input)Adds all entries from the provided map to the input map of the DiagnosticLog.DiagnosticLog.DiagnosticLogBuilderlogDetailLevel(DiagnosticLog.LogDetailLevel logDetailLevel)Sets the log detail level of the DiagnosticLog.DiagnosticLog.DiagnosticLogBuilderresultMessage(String resultMessage)Sets the result message of the DiagnosticLog.DiagnosticLog.DiagnosticLogBuilderresultStatus(DiagnosticLog.ResultStatus resultStatus)Sets the result status of the DiagnosticLog.
-
-
-
Method Detail
-
resultStatus
public DiagnosticLog.DiagnosticLogBuilder resultStatus(DiagnosticLog.ResultStatus resultStatus)
Sets the result status of the DiagnosticLog.- Parameters:
resultStatus- the result message to be set.- Returns:
- the current DiagnosticLogBuilder instance.
-
resultMessage
public DiagnosticLog.DiagnosticLogBuilder resultMessage(String resultMessage)
Sets the result message of the DiagnosticLog.- Parameters:
resultMessage- the action ID to be set.- Returns:
- the current DiagnosticLogBuilder instance.
-
inputParam
public DiagnosticLog.DiagnosticLogBuilder inputParam(String key, Object value)
Adds a new key-value pair to the input map of the DiagnosticLog. If the input map has not been initialized yet, this method will initialize it.- Parameters:
key- the key to be added to the input map.value- the value to be associated with the key in the input map.- Returns:
- the current DiagnosticLogBuilder instance.
-
configParam
public DiagnosticLog.DiagnosticLogBuilder configParam(String key, Object value)
Adds a new key-value pair to the configurations map of the DiagnosticLog. If the configurations map has not been initialized yet, this method will initialize it.- Parameters:
key- the key to be added to the configurations map.value- the value to be associated with the key in the configurations map.- Returns:
- the current DiagnosticLogBuilder instance.
-
inputParams
public DiagnosticLog.DiagnosticLogBuilder inputParams(Map<String,?> input)
Adds all entries from the provided map to the input map of the DiagnosticLog. If the input map has not been initialized yet, this method will initialize it.- Parameters:
input- the map containing entries to be added to the input map.- Returns:
- the current DiagnosticLogBuilder instance.
-
configParams
public DiagnosticLog.DiagnosticLogBuilder configParams(Map<String,?> configurations)
Adds all entries from the provided map to the configurations map of the DiagnosticLog. If the configurations map has not been initialized yet, this method will initialize it.- Parameters:
configurations- the map containing entries to be added to the configurations map.- Returns:
- the current DiagnosticLogBuilder instance.
-
logDetailLevel
public DiagnosticLog.DiagnosticLogBuilder logDetailLevel(DiagnosticLog.LogDetailLevel logDetailLevel)
Sets the log detail level of the DiagnosticLog.- Parameters:
logDetailLevel- the log detail level to be set.- Returns:
- the current DiagnosticLogBuilder instance.
-
build
public DiagnosticLog build()
Constructs a DiagnosticLog object using the set parameters.- Returns:
- a new DiagnosticLog object.
-
-