Impl of EventBuilder interface
Signed-off-by: Fabio José <fabiojose@gmail.com>
This commit is contained in:
parent
059a3e7206
commit
137dcaa016
|
@ -15,6 +15,7 @@ import javax.validation.Validator;
|
||||||
|
|
||||||
import io.cloudevents.Event;
|
import io.cloudevents.Event;
|
||||||
import io.cloudevents.ExtensionFormat;
|
import io.cloudevents.ExtensionFormat;
|
||||||
|
import io.cloudevents.fun.EventBuilder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The event builder.
|
* The event builder.
|
||||||
|
@ -22,7 +23,7 @@ import io.cloudevents.ExtensionFormat;
|
||||||
* @author fabiojose
|
* @author fabiojose
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public final class CloudEventBuilder<T> {
|
public final class CloudEventBuilder<T> implements EventBuilder<T, AttributesImpl> {
|
||||||
|
|
||||||
private static Validator VALIDATOR;
|
private static Validator VALIDATOR;
|
||||||
|
|
||||||
|
@ -103,6 +104,11 @@ public final class CloudEventBuilder<T> {
|
||||||
return builder.build();
|
return builder.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Event<AttributesImpl, T> build(T data, AttributesImpl attributes){
|
||||||
|
return CloudEventBuilder.<T>of(data, attributes);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @return An new {@link Event} immutable instance
|
* @return An new {@link Event} immutable instance
|
||||||
|
|
Loading…
Reference in New Issue