java.lang.Object
com.redhat.cloud.notifications.ingress.Parser

public class Parser extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static Action
    decode(String actionJson)
    Validates and decodes the json string to an Action - Default values are set for supported values (see schema)
    static String
    encode(Action action)
    Validates and encodes an Action to a json-string - Default values are set for supported values (see schema)
    static void
    validate(com.fasterxml.jackson.databind.JsonNode action, com.networknt.schema.JsonSchema jsonSchema)
    Validates action and ensures all the values conform to the schema.
    static void
    validate(Action action)
    Validates action and ensures all the values conform to the schema.
    static void
    validate(ActionOut actionOut)
    Validates an "Action out" and ensures that all the values conform to the schema.
    static void
    validate(String actionJson)
    Validates action and ensures all the values conform to the schema.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Parser

      public Parser()
  • Method Details

    • decode

      public static Action decode(String actionJson)
      Validates and decodes the json string to an Action - Default values are set for supported values (see schema)
      Parameters:
      actionJson - json-serialized Action
      Returns:
      Action valid Action
    • encode

      public static String encode(Action action)
      Validates and encodes an Action to a json-string - Default values are set for supported values (see schema)
      Parameters:
      action - Action to be encoded
      Returns:
      String json-serialized action.
    • validate

      public static void validate(Action action)
      Validates action and ensures all the values conform to the schema.
      Parameters:
      action - to be validated
    • validate

      public static void validate(String actionJson)
      Validates action and ensures all the values conform to the schema.
      Parameters:
      actionJson - string of json encoded action to be validated Note that this validate does not perform the string-to-json of the context and events[*].payload fields and are reported as errors.
    • validate

      public static void validate(com.fasterxml.jackson.databind.JsonNode action, com.networknt.schema.JsonSchema jsonSchema)
      Validates action and ensures all the values conform to the schema.
      Parameters:
      action - JsonNode to be validated Note that this validate does not perform the string-to-json of the context and events[*].payload fields and are reported as errors.
    • validate

      public static void validate(ActionOut actionOut)
      Validates an "Action out" and ensures that all the values conform to the schema.
      Parameters:
      actionOut - ActionOut to be validated.