getAdditionalProperties() {
return additionalProperties;
diff --git a/serde-api/src/main/java/io/kafbat/ui/serde/api/Serde.java b/serde-api/src/main/java/io/kafbat/ui/serde/api/Serde.java
index 32ea45048..aa18512ff 100644
--- a/serde-api/src/main/java/io/kafbat/ui/serde/api/Serde.java
+++ b/serde-api/src/main/java/io/kafbat/ui/serde/api/Serde.java
@@ -5,22 +5,22 @@
import org.apache.kafka.common.header.Headers;
/**
- * Main interface of serialization/deserialization logic.
- * It provides ability to serialize, deserialize topic's keys and values, and optionally provides
- * information about data schema inside topic.
+ * Main interface for serialization/deserialization logic.
+ * It provides the ability to serialize, deserialize topic's keys and values, and optionally provides
+ * information about data schema inside a topic.
*
* Lifecycle:
* 1. on application startup kafbat-ui scans configs and finds all custom serde definitions
* 2. for each custom serde its own separated child-first classloader is created
- * 3. kafbat-ui loads class defined in configuration and instantiates instance of that class using default, non-arg constructor
+ * 3. kafbat-ui loads the class defined in configuration and instantiates an instance of that class using the default, non-arg constructor
* 4. {@code configure(...)} method called
* 5. various methods called during application runtime
* 6. on application shutdown kafbat-ui calls {@code close()} method on serde instance
*
* Implementation considerations:
- * 1. Implementation class should have default/non-arg contructor
+ * 1. Implementation class should have a default/non-arg constructor
* 2. All methods except {@code configure(...)} and {@code close()} can be called from different threads. So, your code should be thread-safe.
- * 3. All methods will be executed in separate child-first classloader.
+ * 3. All methods will be executed in a separate child-first classloader.
*/
public interface Serde extends Closeable {
@@ -39,10 +39,10 @@ enum Target {
}
/**
- * Reads configuration using property resolvers and sets up serde's internal state.
+ * Reads configuration using property resolvers and sets up the serde's internal state.
*
* @param serdeProperties specific serde instance's properties
- * @param kafkaClusterProperties properties of the custer for what serde is instantiated
+ * @param kafkaClusterProperties properties of the cluster for which serde is instantiated
* @param globalProperties global application properties
*/
void configure(
@@ -53,32 +53,32 @@ void configure(
/**
* Get serde's description.
- * @return Serde's description. Treated as Markdown text. Will be shown in UI.
+ * @return Serde's description. Treated as Markdown text. Will be shown in the UI.
*/
Optional getDescription();
/**
- * Get schema description for specified topic's key/value.
+ * Get schema description for the specified topic's key/value.
* @param topic topic name
* @param type {@code Target} for which {@code SchemaDescription} will be returned.
- * @return SchemaDescription for specified topic's key/value.
- * {@code Optional.empty} if there is not information about schema.
+ * @return SchemaDescription for the specified topic's key/value.
+ * {@code Optional.empty} if there is no information about the schema.
*/
Optional getSchema(String topic, Target type);
/**
- * Checks if this Serde can be applied to specified topic's key/value deserialization.
+ * Checks if this Serde can be applied to the specified topic's key/value deserialization.
* @param topic topic name
* @param type {@code Target} for which {@code Deserializer} will be applied.
- * @return true if this Serde can be applied to specified topic's key/value deserialization
+ * @return true if this Serde can be applied to the specified topic's key/value deserialization
*/
boolean canDeserialize(String topic, Target type);
/**
- * Checks if this Serde can be applied to specified topic's key/value serialization.
+ * Checks if this Serde can be applied to the specified topic's key/value serialization.
* @param topic topic name
* @param type {@code Target} for which {@code Serializer} will be applied.
- * @return true if this Serde can be applied to specified topic's key/value serialization
+ * @return true if this Serde can be applied to the specified topic's key/value serialization
*/
boolean canSerialize(String topic, Target type);
@@ -93,41 +93,41 @@ default void close() {
//----------------------------------------------------------------------------
/**
- * Creates {@code Serializer} for specified topic's key/value.
- * kafbat-ui doesn't cache {@code Serializes} - new one will be created each time user's message needs to be serialized.
+ * Creates {@code Serializer} for the specified topic's key/value.
+ * kafbat-ui doesn't cache {@code Serializers} - a new one will be created each time a user's message needs to be serialized.
* (Unless kafbat-ui supports batch inserts).
* @param topic topic name
* @param type {@code Target} for which {@code Serializer} will be created.
- * @return {@code Serializer} for specified topic's key/value.
+ * @return {@code Serializer} for the specified topic's key/value.
*/
Serializer serializer(String topic, Target type);
/**
- * Creates {@code Deserializer} for specified topic's key/value.
- * {@code Deserializer} will be created for each kafka polling and will be used for all messages within that polling cycle.
+ * Creates {@code Deserializer} for the specified topic's key/value.
+ * {@code Deserializer} will be created for each Kafka polling and will be used for all messages within that polling cycle.
* @param topic topic name
* @param type {@code Target} for which {@code Deserializer} will be created.
- * @return {@code Deserializer} for specified topic's key/value.
+ * @return {@code Deserializer} for the specified topic's key/value.
*/
Deserializer deserializer(String topic, Target type);
/**
- * Serializes client's input to {@code bytes[]} that will be sent to kafka as key/value (depending on what {@code Type} it was created for).
+ * Serializes client's input to {@code byte[]} that will be sent to Kafka as key/value (depending on what {@code Type} it was created for).
*/
interface Serializer {
/**
* Serializes input string to bytes.
- * @param input string entered by user into UI text field.
Note: this input is not formatted in any way.
- * @return serialized bytes. Can be null if input is null or empty string.
+ * @param input string entered by the user into the UI text field.
Note: this input is not formatted in any way.
+ * @return serialized bytes. Can be null if input is null or an empty string.
*/
byte[] serialize(String input);
/**
* Serializes input string to bytes. Uses provided headers for additional information.
- * @param input string entered by user into UI text field.
Note: this input is not formatted in any way.
- * @param headers headers entered by user into UI text field.
Note: this input is not formatted in any way.
- * @return serialized bytes. Can be null if input is null or empty string.
+ * @param input string entered by the user into the UI text field.
Note: this input is not formatted in any way.
+ * @param headers headers entered by the user into the UI text field.
Note: this input is not formatted in any way.
+ * @return serialized bytes. Can be null if input is null or an empty string.
*/
default byte[] serialize(String input, Headers headers) {
return serialize(input);
@@ -139,10 +139,10 @@ default byte[] serialize(String input, Headers headers) {
*/
interface Deserializer {
/**
- * Deserializes record's key/value to string.
+ * Deserializes record's key/value to a string.
* @param headers record's headers
* @param data record's key/value
- * @return deserialized object. Can be null if input is null or empty string.
+ * @return deserialized object. Can be null if input is null or an empty string.
*/
DeserializeResult deserialize(RecordHeaders headers, byte[] data);
}