Class TypeParseException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.ultikits.ultitools.abstracts.command.parser.TypeParseException
All Implemented Interfaces:
Serializable

public class TypeParseException extends RuntimeException
Exception thrown when type parsing fails.
Since:
6.2.0
Version:
2.0.0
Author:
wisdomme
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • inputValue

      private final String inputValue
    • targetType

      private final Class<?> targetType
  • Constructor Details

    • TypeParseException

      public TypeParseException(String message)
      Constructs a new TypeParseException with just a message.
      Parameters:
      message - the detail message
    • TypeParseException

      public TypeParseException(String message, Throwable cause)
      Constructs a new TypeParseException with a message and cause.
      Parameters:
      message - the detail message
      cause - the cause of the exception
    • TypeParseException

      public TypeParseException(String inputValue, Class<?> targetType, String message)
      Constructs a new TypeParseException.
      Parameters:
      inputValue - the input value that failed to parse
      targetType - the target type that was expected
      message - the detail message
    • TypeParseException

      public TypeParseException(String inputValue, Class<?> targetType, String message, Throwable cause)
      Constructs a new TypeParseException with a cause.
      Parameters:
      inputValue - the input value that failed to parse
      targetType - the target type that was expected
      message - the detail message
      cause - the cause of the exception
  • Method Details

    • getInputValue

      public String getInputValue()
      Gets the input value that failed to parse.
      Returns:
      the input value
    • getTargetType

      public Class<?> getTargetType()
      Gets the target type that was expected.
      Returns:
      the target type
    • invalidFormat

      public static TypeParseException invalidFormat(String value, Class<?> targetType)
      Creates a TypeParseException for an invalid format.
      Parameters:
      value - the invalid value
      targetType - the expected type
      Returns:
      a new TypeParseException
    • nullValue

      public static TypeParseException nullValue(Class<?> targetType)
      Creates a TypeParseException for a null value.
      Parameters:
      targetType - the expected type
      Returns:
      a new TypeParseException