Class LetterCase

java.lang.Object
org.assertj.db.type.lettercase.LetterCase
All Implemented Interfaces:
Comparator<String>, CaseComparison, CaseConversion

public class LetterCase extends Object implements CaseConversion, CaseComparison
The letter case which indicates a case conversion and a case comparison.
Since:
1.1.0
Author:
Régis Pouiller
  • Field Details

    • TABLE_DEFAULT

      public static final LetterCase TABLE_DEFAULT
      The default letter case for table.
    • COLUMN_DEFAULT

      public static final LetterCase COLUMN_DEFAULT
      The default letter case for table.
    • PRIMARY_KEY_DEFAULT

      public static final LetterCase PRIMARY_KEY_DEFAULT
      The default letter case for table.
  • Method Details

    • getLetterCase

      public static LetterCase getLetterCase(CaseConversion conversion, CaseComparison comparison)
      Returns a instance of a letter case.
      Parameters:
      conversion - The conversion of the case of a String.
      comparison - The comparison on String which consider the case.
      Returns:
      An instance of a letter case.
    • getComparisonName

      public String getComparisonName()
      Returns the name of the comparison.
      Specified by:
      getComparisonName in interface CaseComparison
      Returns:
      The name of the comparison.
    • isEqual

      public boolean isEqual(String value1, String value2)
      Returns if value1 is equal to value2.
      Specified by:
      isEqual in interface CaseComparison
      Parameters:
      value1 - The first value to compare.
      value2 - The second value to compare.
      Returns:
      If the two values are equal.
    • compare

      public int compare(String value1, String value2)
      Specified by:
      compare in interface Comparator<String>
    • getConversionName

      public String getConversionName()
      Returns the name of the conversion.
      Specified by:
      getConversionName in interface CaseConversion
      Returns:
      The name of the conversion.
    • convert

      public String convert(String value)
      Converts the String in parameter to another.
      Specified by:
      convert in interface CaseConversion
      Parameters:
      value - The String to convert.
      Returns:
      The result.