Class EventResourcesImpl
- java.lang.Object
-
- org.apache.pulsar.structuredeventlog.EventResourcesImpl
-
- All Implemented Interfaces:
EventResources
public class EventResourcesImpl extends java.lang.Object implements EventResources
-
-
Constructor Summary
Constructors Constructor Description EventResourcesImpl(EventResourcesImpl parent)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcopyFrom(EventResourcesImpl other)voidforEach(java.util.function.BiConsumer<java.lang.String,java.lang.String> process)static voidforEach(java.util.List<java.lang.Object> list, java.util.function.BiConsumer<java.lang.String,java.lang.String> process)EventResourcesresource(java.lang.String key, java.lang.Object value)Add a resource for the event.EventResourcesresource(java.lang.String key, java.util.function.Supplier<java.lang.String> value)Add a resource for the event using a supplier.
-
-
-
Constructor Detail
-
EventResourcesImpl
public EventResourcesImpl(EventResourcesImpl parent)
-
-
Method Detail
-
resource
public EventResources resource(java.lang.String key, java.lang.Object value)
Description copied from interface:EventResourcesAdd a resource for the event. Resources are inherited by child events.- Specified by:
resourcein interfaceEventResources- Parameters:
key- the key to identify the resourcevalue- the value which will be logged for the resource. This is converted to a string before logging.- Returns:
- this
-
resource
public EventResources resource(java.lang.String key, java.util.function.Supplier<java.lang.String> value)
Description copied from interface:EventResourcesAdd a resource for the event using a supplier. The supplier is used in the case that generating the string from the object is expensive or we want to generate a custom string.- Specified by:
resourcein interfaceEventResources- Parameters:
key- the key to identify the resourcevalue- a supplier which returns the value to be logged for this resource- See Also:
EventResources.resource(java.lang.String,java.lang.Object)
-
copyFrom
public void copyFrom(EventResourcesImpl other)
-
forEach
public void forEach(java.util.function.BiConsumer<java.lang.String,java.lang.String> process)
-
forEach
public static void forEach(java.util.List<java.lang.Object> list, java.util.function.BiConsumer<java.lang.String,java.lang.String> process)
-
-