Class ErrorFactory


  • public class ErrorFactory
    extends Object
    A Factory class to help with building Error objects.
    Since:
    0.0.1
    • Constructor Detail

      • ErrorFactory

        public ErrorFactory()
    • Method Detail

      • createErrorFromJson

        public static EthosError createErrorFromJson​(String json)
                                              throws com.fasterxml.jackson.core.JsonProcessingException
        Create an Error object using a JSON string. This will attempt to parse the given string into an Error object.
        Parameters:
        json - the JSON string representing an error
        Returns:
        an Error object created from the given JSON string.
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException - if the string cannot be parsed to create an Error
      • createErrorListFromJson

        public static List<EthosError> createErrorListFromJson​(String json)
                                                        throws com.fasterxml.jackson.core.JsonProcessingException
        Create an Error array using a JSON string. This will attempt to parse the given string into a list of Errors.
        Parameters:
        json - the JSON string representing an array of errors.
        Returns:
        a List of Errors created from the given JSON string.
        Throws:
        com.fasterxml.jackson.core.JsonProcessingException - Thrown if the string cannot be parsed to create a list of Errors.