Now all javadocs pass the minimum checks (#186)
* Fixed all javadocs Signed-off-by: Francesco Guardiani <francescoguard@gmail.com> * Applied suggestions Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
This commit is contained in:
parent
a012e1e434
commit
bd50e6f284
|
@ -25,9 +25,9 @@ import java.util.Set;
|
|||
|
||||
/**
|
||||
* An <a href="https://github.com/cloudevents/spec/blob/v1.0/spec.md#event-format">Event format</a>
|
||||
* specifies how to serialize a CloudEvent as a sequence of bytes. <br/>
|
||||
* specifies how to serialize a CloudEvent as a sequence of bytes.
|
||||
* <p>
|
||||
* An implementation of this interface should support all specification versions of {@link CloudEvent}. <br/>
|
||||
* An implementation of this interface should support all specification versions of {@link CloudEvent}.
|
||||
* <p>
|
||||
* Implementations of this interface can be registered to the {@link io.cloudevents.core.provider.EventFormatProvider} to use them.
|
||||
*
|
||||
|
|
|
@ -32,7 +32,7 @@ import java.util.stream.Stream;
|
|||
public class MessageUtils {
|
||||
|
||||
/**
|
||||
* Common flow to parse an incoming message that could be structured or binary.<br/>
|
||||
* Common flow to parse an incoming message that could be structured or binary.
|
||||
*/
|
||||
public static MessageReader parseStructuredOrBinaryMessage(
|
||||
Supplier<String> contentTypeHeaderReader,
|
||||
|
|
|
@ -26,11 +26,11 @@ import java.util.ServiceLoader;
|
|||
import java.util.stream.StreamSupport;
|
||||
|
||||
/**
|
||||
* Singleton holding the discovered {@link EventFormat} implementations through {@link ServiceLoader}.<br/>
|
||||
* Singleton holding the discovered {@link EventFormat} implementations through {@link ServiceLoader}.
|
||||
* <p>
|
||||
* You can resolve an event format using {@code EventFormatProvider.getInstance().resolveFormat(contentType)}.<br/>
|
||||
* You can resolve an event format using {@code EventFormatProvider.getInstance().resolveFormat(contentType)}.
|
||||
* <p>
|
||||
* You can programmatically add a new {@link EventFormat} implementation using {@link this#registerFormat(EventFormat)}.
|
||||
* You can programmatically add a new {@link EventFormat} implementation using {@link #registerFormat(EventFormat)}.
|
||||
*/
|
||||
@ParametersAreNonnullByDefault
|
||||
public final class EventFormatProvider {
|
||||
|
|
|
@ -28,9 +28,9 @@ import java.util.HashMap;
|
|||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* Singleton to materialize CloudEvent extensions as POJOs. <br/>
|
||||
* Singleton to materialize CloudEvent extensions as POJOs.
|
||||
* <p>
|
||||
* You can materialize an {@link Extension} POJO with {@code ExtensionProvider.getInstance().parseExtension(DistributedTracingExtension.class, event)}.<br/>
|
||||
* You can materialize an {@link Extension} POJO with {@code ExtensionProvider.getInstance().parseExtension(DistributedTracingExtension.class, event)}.
|
||||
*/
|
||||
@ParametersAreNonnullByDefault
|
||||
public final class ExtensionProvider {
|
||||
|
@ -64,11 +64,11 @@ public final class ExtensionProvider {
|
|||
}
|
||||
|
||||
/**
|
||||
* Parse an extension from the {@link CloudEventExtensions}, materializing the corresponding POJO. <br/>
|
||||
* Parse an extension from the {@link CloudEventExtensions}, materializing the corresponding POJO.
|
||||
*
|
||||
* @param extensionClass the class implementing {@link Extension}
|
||||
* @param extensionClass the class implementing {@link Extension}
|
||||
* @param eventExtensions the event extensions to read
|
||||
* @param <T> the type of the extension
|
||||
* @param <T> the type of the extension
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Nullable
|
||||
|
|
|
@ -32,6 +32,9 @@ import io.cloudevents.rw.*;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Jackson {@link com.fasterxml.jackson.databind.JsonDeserializer} for {@link CloudEvent}
|
||||
*/
|
||||
public class CloudEventDeserializer extends StdDeserializer<CloudEvent> {
|
||||
|
||||
protected CloudEventDeserializer() {
|
||||
|
|
|
@ -30,6 +30,9 @@ import io.cloudevents.rw.CloudEventReader;
|
|||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
/**
|
||||
* Jackson {@link com.fasterxml.jackson.databind.JsonSerializer} for {@link CloudEvent}
|
||||
*/
|
||||
public class CloudEventSerializer extends StdSerializer<CloudEvent> {
|
||||
|
||||
private final boolean forceDataBase64Serialization;
|
||||
|
|
|
@ -26,6 +26,10 @@ import io.cloudevents.core.format.EventSerializationException;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Implementation of {@link EventFormat} for <a href="https://github.com/cloudevents/spec/blob/v1.0/json-format.md">JSON event format</a>
|
||||
* using Jackson. This format is resolvable with {@link io.cloudevents.core.provider.EventFormatProvider} using the content type {@link #CONTENT_TYPE}.
|
||||
*/
|
||||
public final class JsonFormat implements EventFormat {
|
||||
|
||||
public static final String CONTENT_TYPE = "application/cloudevents+json";
|
||||
|
@ -89,6 +93,10 @@ public final class JsonFormat implements EventFormat {
|
|||
return getCloudEventJacksonModule(false, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return a JacksonModule with CloudEvent serializer/deserializer customizing the data serialization.
|
||||
* Look at {@link #withForceJsonDataToBase64()} and {@link #withForceNonJsonDataToString()} for more details.
|
||||
*/
|
||||
public static SimpleModule getCloudEventJacksonModule(boolean forceDataBase64Serialization, boolean forceStringSerialization) {
|
||||
final SimpleModule ceModule = new SimpleModule("CloudEvent");
|
||||
ceModule.addSerializer(CloudEvent.class, new CloudEventSerializer(forceDataBase64Serialization, forceStringSerialization));
|
||||
|
|
|
@ -56,10 +56,9 @@ public final class VertxMessageFactory {
|
|||
}
|
||||
|
||||
/**
|
||||
* Like {@link this#createReader(HttpServerRequest)}
|
||||
*
|
||||
* @param request
|
||||
* @param handler
|
||||
* @see #createReader(HttpServerRequest)
|
||||
*/
|
||||
public static void createReader(HttpServerRequest request, Handler<AsyncResult<MessageReader>> handler) {
|
||||
createReader(request).onComplete(handler);
|
||||
|
@ -76,7 +75,7 @@ public final class VertxMessageFactory {
|
|||
}
|
||||
|
||||
/**
|
||||
* Like {@link this#createReader(HttpClientResponse)}
|
||||
* @see #createReader(HttpClientResponse)
|
||||
*
|
||||
* @param response
|
||||
* @param handler
|
||||
|
|
|
@ -54,7 +54,7 @@ public final class KafkaMessageFactory {
|
|||
}
|
||||
|
||||
/**
|
||||
* Like {@link this#createReader(ConsumerRecord)}
|
||||
* @see #createReader(ConsumerRecord)
|
||||
*/
|
||||
public static MessageReader createReader(Headers headers, byte[] payload) throws IllegalArgumentException {
|
||||
return MessageUtils.parseStructuredOrBinaryMessage(
|
||||
|
@ -81,21 +81,21 @@ public final class KafkaMessageFactory {
|
|||
}
|
||||
|
||||
/**
|
||||
* Like {@link this#createWriter(String, Integer, Long, Object)}
|
||||
* @see #createWriter(String, Integer, Long, Object)
|
||||
*/
|
||||
public static <K> MessageWriter<CloudEventWriter<ProducerRecord<K, byte[]>>, ProducerRecord<K, byte[]>> createWriter(String topic, Integer partition, K key) {
|
||||
return createWriter(topic, partition, null, key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Like {@link this#createWriter(String, Integer, Long, Object)}
|
||||
* @see #createWriter(String, Integer, Long, Object)
|
||||
*/
|
||||
public static <K> MessageWriter<CloudEventWriter<ProducerRecord<K, byte[]>>, ProducerRecord<K, byte[]>> createWriter(String topic, K key) {
|
||||
return createWriter(topic, null, null, key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Like {@link this#createWriter(String, Integer, Long, Object)}
|
||||
* @see #createWriter(String, Integer, Long, Object)
|
||||
*/
|
||||
public static MessageWriter<CloudEventWriter<ProducerRecord<Void, byte[]>>, ProducerRecord<Void, byte[]>> createWriter(String topic) {
|
||||
return createWriter(topic, null, null, null);
|
||||
|
|
Loading…
Reference in New Issue