@Test void testNewBuilder() { io.cloudevents.core.v03.CloudEventBuilder templateBuilder = CloudEventBuilder.v03() .withId(ID) .withType(TYPE) .withSource(SOURCE) .withData(DATACONTENTTYPE_JSON, DATASCHEMA, DATA_JSON_SERIALIZED) .withSubject(SUBJECT) .withTime(TIME) .withExtension("astring", "aaa") .withExtension("aboolean", "true") .withExtension("anumber", "10"); CloudEvent event = templateBuilder.build(); CloudEvent cloned = templateBuilder.newBuilder().build(); assertThat(cloned).isEqualTo(event); }
@Override public CloudEventBuilder newBuilder() { CloudEventBuilder newBuilder = new CloudEventBuilder(); newBuilder.id = this.id; newBuilder.source = this.source; newBuilder.type = this.type; newBuilder.time = this.time; newBuilder.schemaurl = this.schemaurl; newBuilder.datacontenttype = this.datacontenttype; newBuilder.subject = this.subject; newBuilder.data = this.data; newBuilder.extensions.putAll(this.extensions); return newBuilder; }
CloudEventBuilder extends BaseCloudEventBuilder<CloudEventBuilder, CloudEventV03> { @Override public CloudEventBuilder newBuilder() { CloudEventBuilder newBuilder = new CloudEventBuilder(); newBuilder.id = this.id; newBuilder.source = this.source; newBuilder.type = this.type; newBuilder.time = this.time; newBuilder.schemaurl = this.schemaurl; newBuilder.datacontenttype = this.datacontenttype; newBuilder.subject = this.subject; newBuilder.data = this.data; newBuilder.extensions.putAll(this.extensions); return newBuilder; } }
CloudEventBuilder extends BaseCloudEventBuilder<CloudEventBuilder, CloudEventV03> { @Override public CloudEventBuilder newBuilder() { CloudEventBuilder newBuilder = new CloudEventBuilder(); newBuilder.id = this.id; newBuilder.source = this.source; newBuilder.type = this.type; newBuilder.time = this.time; newBuilder.schemaurl = this.schemaurl; newBuilder.datacontenttype = this.datacontenttype; newBuilder.subject = this.subject; newBuilder.data = this.data; newBuilder.extensions.putAll(this.extensions); return newBuilder; } CloudEventBuilder();  CloudEventBuilder(io.cloudevents.CloudEvent event); }
CloudEventBuilder extends BaseCloudEventBuilder<CloudEventBuilder, CloudEventV03> { @Override public CloudEventBuilder newBuilder() { CloudEventBuilder newBuilder = new CloudEventBuilder(); newBuilder.id = this.id; newBuilder.source = this.source; newBuilder.type = this.type; newBuilder.time = this.time; newBuilder.schemaurl = this.schemaurl; newBuilder.datacontenttype = this.datacontenttype; newBuilder.subject = this.subject; newBuilder.data = this.data; newBuilder.extensions.putAll(this.extensions); return newBuilder; } CloudEventBuilder();  CloudEventBuilder(io.cloudevents.CloudEvent event); CloudEventBuilder withId(String id); CloudEventBuilder withSource(URI source); CloudEventBuilder withType(String type); CloudEventBuilder withTime(OffsetDateTime time); CloudEventBuilder withSubject(String subject); @Override CloudEventBuilder withDataContentType(String dataContentType); CloudEventBuilder withSchemaUrl(URI schemaUrl); @Override CloudEventBuilder withDataSchema(URI dataSchema); @Override CloudEventV03 build(); @Override CloudEventBuilder newBuilder(); @Override CloudEventBuilder withAttribute(String name, String value); @Override CloudEventBuilder withAttribute(String name, URI value); @Override CloudEventBuilder withAttribute(String name, OffsetDateTime value); }
CloudEventBuilder extends BaseCloudEventBuilder<CloudEventBuilder, CloudEventV03> { @Override public CloudEventBuilder newBuilder() { CloudEventBuilder newBuilder = new CloudEventBuilder(); newBuilder.id = this.id; newBuilder.source = this.source; newBuilder.type = this.type; newBuilder.time = this.time; newBuilder.schemaurl = this.schemaurl; newBuilder.datacontenttype = this.datacontenttype; newBuilder.subject = this.subject; newBuilder.data = this.data; newBuilder.extensions.putAll(this.extensions); return newBuilder; } CloudEventBuilder();  CloudEventBuilder(io.cloudevents.CloudEvent event); CloudEventBuilder withId(String id); CloudEventBuilder withSource(URI source); CloudEventBuilder withType(String type); CloudEventBuilder withTime(OffsetDateTime time); CloudEventBuilder withSubject(String subject); @Override CloudEventBuilder withDataContentType(String dataContentType); CloudEventBuilder withSchemaUrl(URI schemaUrl); @Override CloudEventBuilder withDataSchema(URI dataSchema); @Override CloudEventV03 build(); @Override CloudEventBuilder newBuilder(); @Override CloudEventBuilder withAttribute(String name, String value); @Override CloudEventBuilder withAttribute(String name, URI value); @Override CloudEventBuilder withAttribute(String name, OffsetDateTime value);  }