Package dev.cdevents
Class CDEvents
- java.lang.Object
-
- dev.cdevents.CDEvents
-
public final class CDEvents extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static io.cloudevents.CloudEventcdEventAsCloudEvent(CDEvent cdEvent)Creates a CloudEvent from the cdEvent.static StringcdEventAsJson(CDEvent cdEvent)static CDEventcdEventFromJson(String cdEventJson)Creates cdEvent from cdEventJson string and validates against schema.static booleanvalidateCDEvent(CDEvent cdEvent)Validates the cdEvent against the Schema URL.static booleanvalidateCDEventJson(String cdEventJson)Validates the cdEventJson against the Schema URL.
-
-
-
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
-
-