Interface CloudEvent


  • public interface CloudEvent
    CloudEvent representation of Metadata.
    • Method Detail

      • specversion

        java.lang.String specversion()
        The CloudEvent spec version.
        Returns:
        The spec version.
      • id

        java.lang.String id()
        The id of this CloudEvent.
        Returns:
        The id.
      • withId

        CloudEvent withId​(java.lang.String id)
        Return a new CloudEvent with the given id.
        Parameters:
        id - The id to set.
        Returns:
        A copy of this CloudEvent.
      • source

        java.net.URI source()
        The source of this CloudEvent.
        Returns:
        The source.
      • withSource

        CloudEvent withSource​(java.net.URI source)
        Return a new CloudEvent with the given source.
        Parameters:
        source - The source to set.
        Returns:
        A copy of this CloudEvent.
      • type

        java.lang.String type()
        The type of this CloudEvent.
        Returns:
        The type.
      • withType

        CloudEvent withType​(java.lang.String type)
        Return a new CloudEvent with the given type.
        Parameters:
        type - The type to set.
        Returns:
        A copy of this CloudEvent.
      • datacontenttype

        java.util.Optional<java.lang.String> datacontenttype()
        The data content type of this CloudEvent.
        Returns:
        The data content type, if set.
      • withDatacontenttype

        CloudEvent withDatacontenttype​(java.lang.String datacontenttype)
        Return a new CloudEvent with the given data content type.
        Parameters:
        datacontenttype - The data content type to set.
        Returns:
        A copy of this CloudEvent.
      • clearDatacontenttype

        CloudEvent clearDatacontenttype()
        Clear the data content type of this CloudEvent, if set.
        Returns:
        A copy of this CloudEvent.
      • dataschema

        java.util.Optional<java.net.URI> dataschema()
        The data schema of this CloudEvent.
        Returns:
        The data schema, if set.
      • withDataschema

        CloudEvent withDataschema​(java.net.URI dataschema)
        Return a new CloudEvent with the given data schema.
        Parameters:
        dataschema - The data schema to set.
        Returns:
        A copy of this CloudEvent.
      • clearDataschema

        CloudEvent clearDataschema()
        Clear the data schema of this CloudEvent, if set.
        Returns:
        A copy of this CloudEvent.
      • subject

        java.util.Optional<java.lang.String> subject()
        The subject of this CloudEvent.
        Returns:
        The subject, if set.
      • withSubject

        CloudEvent withSubject​(java.lang.String subject)
        Return a new CloudEvent with the given subject.
        Parameters:
        subject - The subject to set.
        Returns:
        A copy of this CloudEvent.
      • clearSubject

        CloudEvent clearSubject()
        Clear the subject of this CloudEvent, if set.
        Returns:
        A copy of this CloudEvent.
      • time

        java.util.Optional<java.time.ZonedDateTime> time()
        The time of this CloudEvent.
        Returns:
        The time, if set.
      • withTime

        CloudEvent withTime​(java.time.ZonedDateTime time)
        Return a new CloudEvent with the given time.
        Parameters:
        time - The time to set.
        Returns:
        A copy of this CloudEvent.
      • clearTime

        CloudEvent clearTime()
        Clear the time of this CloudEvent, if set.
        Returns:
        A copy of this CloudEvent.
      • asMetadata

        Metadata asMetadata()
        Return this CloudEvent represented as Metadata.

        If this CloudEvent was created by {Metadata.asCloudEvent()}, then any non CloudEvent metadata that was present will still be present.

        Returns:
        This CloudEvent expressed as Cloudstate metadata.
      • of

        static CloudEvent of​(java.lang.String id,
                             java.net.URI source,
                             java.lang.String type)
        Create a CloudEvent.
        Parameters:
        id - The id of the CloudEvent.
        source - The source of the CloudEvent.
        type - The type of the CloudEvent.
        Returns:
        The newly created CloudEvent.