Interface EventBuilder
-
- All Known Implementing Classes:
DefaultEventLogger.NoOpEventBuilder,SdkEventBuilder
public interface EventBuilderThe EventBuilder is used toemit()events.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidemit()Emit an event.default <T> EventBuilderput(AttributeKey<T> key, T value)Put the given key and value in the payload.default EventBuilderput(java.lang.String key, boolean value)Put the givenkeyandvaluein the payload.default EventBuilderput(java.lang.String key, boolean... value)Put the givenkeyandvaluein the payload.default EventBuilderput(java.lang.String key, double value)Put the givenkeyandvaluein the payload.default EventBuilderput(java.lang.String key, double... value)Put the givenkeyandvaluein the payload.default EventBuilderput(java.lang.String key, long value)Put the givenkeyandvaluein the payload.default EventBuilderput(java.lang.String key, long... value)Put the givenkeyandvaluein the payload.EventBuilderput(java.lang.String key, Value<?> value)Put the givenkeyandvaluein the payload.default EventBuilderput(java.lang.String key, java.lang.String value)Put the givenkeyandvaluein the payload.default EventBuilderput(java.lang.String key, java.lang.String... value)Put the givenkeyandvaluein the payload.EventBuildersetAttributes(Attributes attributes)Set the attributes.EventBuildersetContext(Context context)Set the context.EventBuildersetSeverity(Severity severity)Set the severity.EventBuildersetTimestamp(long timestamp, java.util.concurrent.TimeUnit unit)Set the epochtimestamp, using the timestamp and unit.EventBuildersetTimestamp(java.time.Instant instant)Set the epochtimestamp, using the instant.
-
-
-
Method Detail
-
put
default EventBuilder put(java.lang.String key, java.lang.String value)
Put the givenkeyandvaluein the payload.
-
put
default EventBuilder put(java.lang.String key, long value)
Put the givenkeyandvaluein the payload.
-
put
default EventBuilder put(java.lang.String key, double value)
Put the givenkeyandvaluein the payload.
-
put
default EventBuilder put(java.lang.String key, boolean value)
Put the givenkeyandvaluein the payload.
-
put
default EventBuilder put(java.lang.String key, java.lang.String... value)
Put the givenkeyandvaluein the payload.
-
put
default EventBuilder put(java.lang.String key, long... value)
Put the givenkeyandvaluein the payload.
-
put
default EventBuilder put(java.lang.String key, double... value)
Put the givenkeyandvaluein the payload.
-
put
default EventBuilder put(java.lang.String key, boolean... value)
Put the givenkeyandvaluein the payload.
-
put
default <T> EventBuilder put(AttributeKey<T> key, T value)
Put the given key and value in the payload.NOTE: The key value pair is NOT added to the event attributes. Setting event attributes is less common than adding entries to the event payload. Use
setAttributes(Attributes)if intending the data to be set in attributes instead of the payload.
-
put
EventBuilder put(java.lang.String key, Value<?> value)
Put the givenkeyandvaluein the payload.
-
setTimestamp
EventBuilder setTimestamp(long timestamp, java.util.concurrent.TimeUnit unit)
Set the epochtimestamp, using the timestamp and unit.The
timestampis the time at which the event occurred. If unset, it will be set to the current time whenemit()is called.
-
setTimestamp
EventBuilder setTimestamp(java.time.Instant instant)
Set the epochtimestamp, using the instant.The
timestampis the time at which the event occurred. If unset, it will be set to the current time whenemit()is called.
-
setContext
EventBuilder setContext(Context context)
Set the context.
-
setSeverity
EventBuilder setSeverity(Severity severity)
Set the severity.
-
setAttributes
EventBuilder setAttributes(Attributes attributes)
Set the attributes.Event
Attributesprovide additional details about the Event which are not part of the well-definedValuepayload. Setting event attributes is less common than adding entries to the event payload. Most users will want to call one of the#put(String, ?)methods instead.
-
emit
void emit()
Emit an event.
-
-