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 DiagnosticLog.DiagnosticLogBuilderaddAllConfigurations(Map<String,?> configurations)Adds all entries from the provided map to the configurations map of the DiagnosticLog.DiagnosticLog.DiagnosticLogBuilderaddAllParams(Map<String,?> input)Adds all entries from the provided map to the input map of the DiagnosticLog.DiagnosticLogbuild()Constructs a DiagnosticLog object using the set parameters.DiagnosticLog.DiagnosticLogBuilderflowId(String flowId)Sets the flow ID of the DiagnosticLog.DiagnosticLog.DiagnosticLogBuilderlogId(String logId)Sets the log ID of the DiagnosticLog.DiagnosticLog.DiagnosticLogBuilderlogLevel(DiagnosticLog.LogLevel logLevel)Sets the log level of the DiagnosticLog.DiagnosticLog.DiagnosticLogBuilderputConfigurations(String key, Object value)Adds a new key-value pair to the configurations map of the DiagnosticLog.DiagnosticLog.DiagnosticLogBuilderputParams(String key, Object value)Adds a new key-value pair to the input map of the DiagnosticLog.DiagnosticLog.DiagnosticLogBuilderrecordedAt(Instant recordedAt)Sets the recordedAt timestamp of the DiagnosticLog.DiagnosticLog.DiagnosticLogBuilderrequestId(String requestId)Sets the request ID 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
-
logId
public DiagnosticLog.DiagnosticLogBuilder logId(String logId)
Sets the log ID of the DiagnosticLog.- Parameters:
logId- the log ID to be set.- Returns:
- the current DiagnosticLogBuilder instance.
-
recordedAt
public DiagnosticLog.DiagnosticLogBuilder recordedAt(Instant recordedAt)
Sets the recordedAt timestamp of the DiagnosticLog.- Parameters:
recordedAt- the timestamp to be set.- Returns:
- the current DiagnosticLogBuilder instance.
-
requestId
public DiagnosticLog.DiagnosticLogBuilder requestId(String requestId)
Sets the request ID of the DiagnosticLog.- Parameters:
requestId- the request ID to be set.- Returns:
- the current DiagnosticLogBuilder instance.
-
flowId
public DiagnosticLog.DiagnosticLogBuilder flowId(String flowId)
Sets the flow ID of the DiagnosticLog.- Parameters:
flowId- the flow ID to be set.- Returns:
- the current DiagnosticLogBuilder instance.
-
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.
-
putParams
public DiagnosticLog.DiagnosticLogBuilder putParams(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.
-
putConfigurations
public DiagnosticLog.DiagnosticLogBuilder putConfigurations(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.
-
addAllParams
public DiagnosticLog.DiagnosticLogBuilder addAllParams(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.
-
addAllConfigurations
public DiagnosticLog.DiagnosticLogBuilder addAllConfigurations(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.
-
logLevel
public DiagnosticLog.DiagnosticLogBuilder logLevel(DiagnosticLog.LogLevel logLevel)
Sets the log level of the DiagnosticLog.- Parameters:
logLevel- the log 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.
-
-