Package akka.javasdk

Interface CloudEvent


public interface CloudEvent
CloudEvent representation of Metadata.
  • Method Details

    • specversion

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

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

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

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

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

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

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

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

      CloudEvent withDatacontenttype(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

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

      CloudEvent withDataschema(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

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

      CloudEvent withSubject(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

      The time of this CloudEvent.
      Returns:
      The time, if set.
    • withTime

      CloudEvent withTime(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 metadata.
    • of

      static CloudEvent of(String id, URI source, 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.