Class CharSequenceTooLongException

All Implemented Interfaces:
Serializable

@ClassVersion(sourceVersion="$Id: CharSequenceTooLongException.java 1060 2023-09-24 19:21:40Z tquadrat $") @API(status=STABLE, since="0.0.5") public final class CharSequenceTooLongException extends ValidationException
This is a specialized implementation for the IllegalArgumentException that should be used instead of the latter in cases where a CharSequence provided as a method argument is too long according to some external constraints, like the column definition of a database.
Author:
Thomas Thrien (thomas.thrien@tquadrat.org)
Version:
$Id: CharSequenceTooLongException.java 1060 2023-09-24 19:21:40Z tquadrat $
Since:
0.0.5
See Also:
UML Diagram
UML Diagram for "org.tquadrat.foundation.exception.CharSequenceTooLongException"

UML Diagram for "org.tquadrat.foundation.exception.CharSequenceTooLongException"

UML Diagram for "org.tquadrat.foundation.exception.CharSequenceTooLongException"
  • Constructor Details

    • CharSequenceTooLongException

      public CharSequenceTooLongException(String argName, int maxLength)
      Creates a new instance of CharSequenceTooLongException.
      Parameters:
      argName - The name of the argument whose value was too long.
      maxLength - The maximum length.
    • CharSequenceTooLongException

      public CharSequenceTooLongException(int maxLength)
      Creates a new instance of CharSequenceTooLongException.
      Parameters:
      maxLength - The maximum length.
  • Method Details

    • checkLength

      private static int checkLength(int maxLength) throws ValidationException
      Checks the given value.
      Parameters:
      maxLength - The provided legal length for a text.
      Returns:
      The given value.
      Throws:
      ValidationException - The given value was less than 1.