diff --git a/core/src/main/java/io/cloudevents/core/builder/CloudEventBuilder.java b/core/src/main/java/io/cloudevents/core/builder/CloudEventBuilder.java index 412aa0b4..a65e661c 100644 --- a/core/src/main/java/io/cloudevents/core/builder/CloudEventBuilder.java +++ b/core/src/main/java/io/cloudevents/core/builder/CloudEventBuilder.java @@ -146,11 +146,27 @@ public interface CloudEventBuilder extends CloudEventWriter { /** * Add to the builder all the extension key/values of the provided extension * - * @param extension materialized extension to set in the event + * @param extension materialized extension to set in the builder * @return self */ CloudEventBuilder withExtension(@Nonnull Extension extension); + /** + * Remove from the the builder the provided extension key, if any + * + * @param key key of the extension attribute + * @return self + */ + CloudEventBuilder withoutExtension(@Nonnull String key); + + /** + * Remove from the the builder the provided extension, if any + * + * @param extension materialized extension to remove from the builder + * @return self + */ + CloudEventBuilder withoutExtension(@Nonnull Extension extension); + /** * Build the event * diff --git a/core/src/main/java/io/cloudevents/core/impl/BaseCloudEventBuilder.java b/core/src/main/java/io/cloudevents/core/impl/BaseCloudEventBuilder.java index 12a3e5d7..19bf6eed 100644 --- a/core/src/main/java/io/cloudevents/core/impl/BaseCloudEventBuilder.java +++ b/core/src/main/java/io/cloudevents/core/impl/BaseCloudEventBuilder.java @@ -91,6 +91,18 @@ public abstract class BaseCloudEventBuilder