From 45e194824aa88da32d99ba4af45acf6739b2afa1 Mon Sep 17 00:00:00 2001 From: Alvaro <102966649+AlvaroStream@users.noreply.github.com> Date: Mon, 26 Dec 2022 09:43:09 +0100 Subject: [PATCH] [improve][doc] Java example explaining code without using lombok (#19019) --- site2/docs/schema-understand.md | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/site2/docs/schema-understand.md b/site2/docs/schema-understand.md index 239c81aad57e0b..3aa27c0056b072 100644 --- a/site2/docs/schema-understand.md +++ b/site2/docs/schema-understand.md @@ -122,15 +122,25 @@ Pulsar gets the schema definition from the predefined `struct` using an Avro lib 1. Create the _User_ class to define the messages sent to Pulsar topics. ```java + # If you use Lombok + + @Builder + @AllArgsConstructor + @NoArgsConstructor public static class User { public String name; public int age; - public User(String name, int age) { - this.name = name; - this.age = age - } - public User() {} } + + # If you DON'T use Lombok you will need to add the constructor like this + # + # public static class User { + # String name; + # int age; + # public User() { } + # public User(String name, int age) { this.name = name; this.age = age; } } + #} + ``` 2. Create a producer with a `struct` schema and send messages. @@ -363,4 +373,4 @@ The following table outlines the mapping between the schema compatibility check | `ALWAYS_INCOMPATIBLE` | N/A | The schema evolution is disabled. | |