Class ImmutableCloudEvent

  • All Implemented Interfaces:
    Derivable<CloudEvent>

    @Generated("org.immutables.processor.ProxyProcessor")
    public final class ImmutableCloudEvent
    extends CloudEvent
    Immutable implementation of CloudEvent.

    Use the builder to create immutable instances: ImmutableCloudEvent.builder().

    • Method Detail

      • getName

        public String getName()
        Specified by:
        getName in class CloudEntity
        Returns:
        The value of the name attribute
      • getV3Metadata

        public org.cloudfoundry.client.v3.Metadata getV3Metadata()
        Specified by:
        getV3Metadata in class CloudEntity
        Returns:
        The value of the v3Metadata attribute
      • getType

        public String getType()
        Specified by:
        getType in class CloudEvent
        Returns:
        The value of the type attribute
      • getTimestamp

        public Date getTimestamp()
        Specified by:
        getTimestamp in class CloudEvent
        Returns:
        The value of the timestamp attribute
      • withName

        public final ImmutableCloudEvent withName​(String value)
        Copy the current immutable object by setting a value for the name attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for name (can be null)
        Returns:
        A modified copy of the this object
      • withMetadata

        public final ImmutableCloudEvent withMetadata​(CloudMetadata value)
        Copy the current immutable object by setting a value for the metadata attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for metadata (can be null)
        Returns:
        A modified copy of the this object
      • withV3Metadata

        public final ImmutableCloudEvent withV3Metadata​(org.cloudfoundry.client.v3.Metadata value)
        Copy the current immutable object by setting a value for the v3Metadata attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for v3Metadata (can be null)
        Returns:
        A modified copy of the this object
      • withType

        public final ImmutableCloudEvent withType​(String value)
        Copy the current immutable object by setting a value for the type attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for type (can be null)
        Returns:
        A modified copy of the this object
      • withActor

        public final ImmutableCloudEvent withActor​(CloudEvent.Participant value)
        Copy the current immutable object by setting a value for the actor attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for actor (can be null)
        Returns:
        A modified copy of the this object
      • withActee

        public final ImmutableCloudEvent withActee​(CloudEvent.Participant value)
        Copy the current immutable object by setting a value for the actee attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for actee (can be null)
        Returns:
        A modified copy of the this object
      • withTimestamp

        public final ImmutableCloudEvent withTimestamp​(Date value)
        Copy the current immutable object by setting a value for the timestamp attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for timestamp (can be null)
        Returns:
        A modified copy of the this object
      • equals

        public boolean equals​(Object another)
        This instance is equal to all instances of ImmutableCloudEvent that have equal attribute values.
        Overrides:
        equals in class Object
        Returns:
        true if this is equal to another instance
      • hashCode

        public int hashCode()
        Computes a hash code from attributes: name, metadata, v3Metadata, type, actor, actee, timestamp.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

        public String toString()
        Prints the immutable value CloudEvent with attribute values.
        Overrides:
        toString in class Object
        Returns:
        A string representation of the value
      • copyOf

        public static ImmutableCloudEvent copyOf​(CloudEvent instance)
        Creates an immutable copy of a CloudEvent value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
        Parameters:
        instance - The instance to copy
        Returns:
        A copied immutable CloudEvent instance
      • builder

        public static ImmutableCloudEvent.Builder builder()
        Creates a builder for ImmutableCloudEvent.
         ImmutableCloudEvent.builder()
            .name(String | null) // nullable name
            .metadata(com.sap.cloudfoundry.client.facade.domain.CloudMetadata | null) // nullable metadata
            .v3Metadata(org.cloudfoundry.client.v3.Metadata | null) // nullable v3Metadata
            .type(String | null) // nullable type
            .actor(com.sap.cloudfoundry.client.facade.domain.CloudEvent.Participant | null) // nullable actor
            .actee(com.sap.cloudfoundry.client.facade.domain.CloudEvent.Participant | null) // nullable actee
            .timestamp(Date | null) // nullable timestamp
            .build();
         
        Returns:
        A new ImmutableCloudEvent builder