All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.smallrye.reactive.messaging.ce.impl.DefaultIncomingCloudEventMetadata Maven / Gradle / Ivy

There is a newer version: 4.26.0
Show newest version
package io.smallrye.reactive.messaging.ce.impl;

import java.net.URI;
import java.time.ZonedDateTime;
import java.util.Map;

import io.smallrye.reactive.messaging.ce.CloudEventMetadata;
import io.smallrye.reactive.messaging.ce.IncomingCloudEventMetadata;

/**
 * Default implementation of the {@link IncomingCloudEventMetadata} interface
 *
 * @param  the type of data
 */
public class DefaultIncomingCloudEventMetadata extends BaseCloudEventMetadata implements IncomingCloudEventMetadata {

    public DefaultIncomingCloudEventMetadata(String specVersion, String id, URI source, String type,
            String dataContentType, URI dataSchema, String subject, ZonedDateTime timestamp,
            Map extensions, T data) {
        super(specVersion, id, source, type, dataContentType, dataSchema, subject, timestamp, extensions, data);
        validate();
    }

    public DefaultIncomingCloudEventMetadata(CloudEventMetadata existing) {
        this(existing.getSpecVersion(), existing.getId(), existing.getSource(), existing.getType(),
                existing.getDataContentType().orElse(null), existing.getDataSchema().orElse(null),
                existing.getSubject().orElse(null),
                existing.getTimeStamp().orElse(null),
                existing.getExtensions(), existing.getData());
        validate();
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy