Package dev.cdevents

Class CDEvents


  • public final class CDEvents
    extends Object
    • Method Detail

      • cdEventAsJson

        public static String cdEventAsJson​(CDEvent cdEvent)
        Parameters:
        cdEvent -
        Returns:
        json string of a cdEvent
      • cdEventAsCloudEvent

        public static io.cloudevents.CloudEvent cdEventAsCloudEvent​(CDEvent cdEvent)
        Creates a CloudEvent from the cdEvent.
        Parameters:
        cdEvent -
        Returns:
        CloudEvent
      • validateCDEvent

        public static boolean validateCDEvent​(CDEvent cdEvent)
        Validates the cdEvent against the Schema URL.
        Parameters:
        cdEvent -
        Returns:
        valid cdEvent
      • cdEventFromJson

        public static CDEvent cdEventFromJson​(String cdEventJson)
        Creates cdEvent from cdEventJson string and validates against schema.
        Parameters:
        cdEventJson -
        Returns:
        CDEvent, needs type casting to specific CDEvent class
      • validateCDEventJson

        public static boolean validateCDEventJson​(String cdEventJson)
        Validates the cdEventJson against the Schema URL.
        Parameters:
        cdEventJson -
        Returns:
        true, If cdEventJson is valid