Class InvalidField


  • public class InvalidField
    extends Object
    InvalidField
    • Constructor Detail

      • InvalidField

        public InvalidField()
    • Method Detail

      • getMessage

        public String getMessage()
        Description of the validation error.
        Returns:
        message
      • setMessage

        public void setMessage​(String message)
      • getName

        public String getName()
        The field that has an invalid value.
        Returns:
        name
      • setName

        public void setName​(String name)
      • getValue

        public String getValue()
        The invalid value.
        Returns:
        value
      • setValue

        public void setValue​(String value)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • validateJsonObject

        public static void validateJsonObject​(com.google.gson.JsonObject jsonObj)
                                       throws IOException
        Throws:
        IOException
      • validateJsonObject

        public static void validateJsonObject​(com.google.gson.JsonObject jsonObj,
                                              boolean strictValidation)
                                       throws IOException
        Validates the JSON Object and throws an exception if issues found
        Parameters:
        jsonObj - JSON Object
        strictValidation - reject (new) fields missing from the specifications
        Throws:
        IOException - if the JSON Object is invalid with respect to InvalidField
      • fromJson

        public static InvalidField fromJson​(String jsonString)
                                     throws IOException
        Create an instance of InvalidField given an JSON string
        Parameters:
        jsonString - JSON string
        Returns:
        An instance of InvalidField
        Throws:
        IOException - if the JSON string is invalid with respect to InvalidField
      • toJson

        public String toJson()
        Convert an instance of InvalidField to an JSON string
        Returns:
        JSON string