public static final class LogMessage.Builder extends Object
LogMessage.
Initialize attributes and then invoke the build() method to create an
immutable instance.
Builder is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
| Modifier and Type | Method and Description |
|---|---|
LogMessage.Builder |
applicationId(String applicationId)
Initializes the value for the
applicationId attribute. |
LogMessage |
build()
Builds a new
LogMessage. |
LogMessage.Builder |
from(LogMessage instance)
Fill a builder with attribute values from the provided
LogMessage instance. |
LogMessage.Builder |
message(String message)
Initializes the value for the
message attribute. |
LogMessage.Builder |
messageType(MessageType messageType)
Initializes the value for the
messageType attribute. |
LogMessage.Builder |
sourceInstance(String sourceInstance)
Initializes the value for the
sourceInstance attribute. |
LogMessage.Builder |
sourceType(String sourceType)
Initializes the value for the
sourceType attribute. |
LogMessage.Builder |
timestamp(Long timestamp)
Initializes the value for the
timestamp attribute. |
public final LogMessage.Builder from(LogMessage instance)
LogMessage instance.
Regular attribute values will be replaced with those from the given instance.
Absent optional values will not replace present values.instance - The instance from which to copy valuesthis builder for use in a chained invocationpublic final LogMessage.Builder applicationId(String applicationId)
applicationId attribute.applicationId - The value for applicationId (can be null)this builder for use in a chained invocationpublic final LogMessage.Builder message(String message)
message attribute.message - The value for messagethis builder for use in a chained invocationpublic final LogMessage.Builder messageType(MessageType messageType)
messageType attribute.messageType - The value for messageTypethis builder for use in a chained invocationpublic final LogMessage.Builder sourceInstance(String sourceInstance)
sourceInstance attribute.sourceInstance - The value for sourceInstance (can be null)this builder for use in a chained invocationpublic final LogMessage.Builder sourceType(String sourceType)
sourceType attribute.sourceType - The value for sourceType (can be null)this builder for use in a chained invocationpublic final LogMessage.Builder timestamp(Long timestamp)
timestamp attribute.timestamp - The value for timestampthis builder for use in a chained invocationpublic LogMessage build()
LogMessage.IllegalStateException - if any required attributes are missingCopyright © 2017 Pivotal Software, Inc.. All rights reserved.