Class ExpressionTemplates

java.lang.Object
ch.andre601.expressionparser.templates.ExpressionTemplates

public class ExpressionTemplates extends Object
Class containing a collection of pre-made ExpressionTemplate actions.
  • Constructor Details

    • ExpressionTemplates

      public ExpressionTemplates()
  • Method Details

    • negate

      public static ExpressionTemplate negate(ExpressionTemplate template)
      Negates the provided ExpressionTemplate's output.
      Parameters:
      template - The ExpressionTemplate to negate.
      Returns:
      ExpressionTemplate with its value negated.
    • and

      public static ExpressionTemplate and(Collection<ExpressionTemplate> operands)
      Returns a ExpressionTemplate who's boolean value returns true if and only if all provided ExpressionTemplates return true.
      Parameters:
      operands - Collection of ExpressionTemplates to chain.
      Returns:
      ExpressionTemplate who's boolean value returns true if and only if all provided ExpressionTemplates return true.
    • or

      public static ExpressionTemplate or(Collection<ExpressionTemplate> operands)
      Returns a ExpressionTemplate who's boolean value returns true if any of the provided ExpressionTemplates returns true.
      Parameters:
      operands - Collection of ExpressionTemplates to chain.
      Returns:
      ExpressionTemplate who's boolean value returns true when any of the provided ExpressionTemplates returns true.
    • concat

      public static ExpressionTemplate concat(Collection<ExpressionTemplate> operands)
      Returns a ExpressionTemplate with the String values of the provided ExpressionTemplates merged together.
      Parameters:
      operands - Collection of ExpressionTemplates to merge String values of.
      Returns:
      ExpressionTemplate with the String values of all provided ExpressionTemplates merged together.
    • equal

      Returns a ExpressionTemplate who's boolean value is true if and only if the two provided ExpressionTemplates do have equal String values.
      This method is case-sensitive. For a case-insensitive option, use equalIgnoreCase.
      Parameters:
      a - The first ExpressionTemplate to check for equality.
      b - The second ExpressionTemplate to check for equality.
      Returns:
      ExpressionTemplate who's boolean value is true if and only if both ExpressionTemplate's String value is equal.
      See Also:
    • notEqual

      Returns a ExpressionTemplate who's boolean value is true if and only if the two provided ExpressionTemplates do not have equal String values.
      This method is case-sensitive. For a case-insensitive option, use notEqualIgnoreCase.
      Parameters:
      a - The first ExpressionTemplate to check for equality.
      b - The second ExpressionTemplate to check for equality.
      Returns:
      ExpressionTemplate who's boolean value is true if and only if both ExpressionTemplate's String values are not equal.
      See Also:
    • equalIgnoreCase

      public static ExpressionTemplate equalIgnoreCase(ExpressionTemplate a, ExpressionTemplate b)
      Returns a ExpressionTemplate who's boolean value is true if and only if the two provided ExpressionTemplates do have equal String values.
      This method is case-insensitive. For a case-insensitive option, use equal.
      Parameters:
      a - The first ExpressionTemplate to check for equality.
      b - The second ExpressionTemplate to check for equality.
      Returns:
      ExpressionTemplate who's boolean value is true if and only if both ExpressionTemplate's String value is equal.
      See Also:
    • notEqualIgnoreCase

      public static ExpressionTemplate notEqualIgnoreCase(ExpressionTemplate a, ExpressionTemplate b)
      Returns a ExpressionTemplate who's boolean value is true if and only if the two provided ExpressionTemplates do not have equal String values.
      This method is case-sensitive. For a case-insensitive option, use notEqual.
      Parameters:
      a - The first ExpressionTemplate to check for equality.
      b - The second ExpressionTemplate to check for equality.
      Returns:
      ExpressionTemplate who's boolean value is true if and only if both ExpressionTemplate's String values are not equal.
      See Also:
    • startsWith

      public static ExpressionTemplate startsWith(ExpressionTemplate a, ExpressionTemplate b)
      Returns a ExpressionTemplate who's boolean value returns true when the String value of the first ExpressionTemplate starts with the String value of the second ExpressionTemplate.
      Parameters:
      a - The first ExpressionTemplate to check the String value of.
      b - The second ExpressionTemplate with the String value to look for in the first ExpressionTemplate.
      Returns:
      True if the first ExpressionTemplate's String value starts with the String value of the second ExpressionTemplate.
    • startsWithIgnoreCase

      public static ExpressionTemplate startsWithIgnoreCase(ExpressionTemplate a, ExpressionTemplate b)
      Returns a ExpressionTemplate who's boolean value returns true when the String value of the first ExpressionTemplate starts with the String value of the second ExpressionTemplate.
      This check ignores the casing of the provided ExpressionTemplates by lowercasing their String values.
      Parameters:
      a - The first ExpressionTemplate to check the String value of.
      b - The second ExpressionTemplate with the String value to look for in the first ExpressionTemplate.
      Returns:
      True if the first ExpressionTemplate's String value starts with the String value of the second ExpressionTemplate.
    • endsWith

      Returns a ExpressionTemplate who's boolean value returns true when the String value of the first ExpressionTemplate ends with the String value of the second ExpressionTemplate.
      Parameters:
      a - The first ExpressionTemplate to check the String value of.
      b - The second ExpressionTemplate with the String value to look for in the first ExpressionTemplate.
      Returns:
      True if the first ExpressionTemplate's String value ends with the String value of the second ExpressionTemplate.
    • endsWithIgnoreCase

      public static ExpressionTemplate endsWithIgnoreCase(ExpressionTemplate a, ExpressionTemplate b)
      Returns a ExpressionTemplate who's boolean value returns true when the String value of the first ExpressionTemplate ends with the String value of the second ExpressionTemplate.
      This check ignores the casing of the provided ExpressionTemplates by lowercasing their String values.
      Parameters:
      a - The first ExpressionTemplate to check the String value of.
      b - The second ExpressionTemplate with the String value to look for in the first ExpressionTemplate.
      Returns:
      True if the first ExpressionTemplate's String value ends with the String value of the second ExpressionTemplate.
    • contains

      Returns a ExpressionTemplate who's boolean value returns true when the String value of the first ExpressionTemplate contains the String value of the second ExpressionTemplate.
      Parameters:
      a - The first ExpressionTemplate to check the String value of.
      b - The second ExpressionTemplate with the String value to look for in the first ExpressionTemplate.
      Returns:
      True if the first ExpressionTemplate's String value contains the String value of the second ExpressionTemplate.
    • containsIgnoreCase

      public static ExpressionTemplate containsIgnoreCase(ExpressionTemplate a, ExpressionTemplate b)
      Returns a ExpressionTemplate who's boolean value returns true when the String value of the first ExpressionTemplate contains the String value of the second ExpressionTemplate.
      This check ignores the casing of the provided ExpressionTemplates by lowercasing their String values.
      Parameters:
      a - The first ExpressionTemplate to check the String value of.
      b - The second ExpressionTemplate with the String value to look for in the first ExpressionTemplate.
      Returns:
      True if the first ExpressionTemplate's String value contains the String value of the second ExpressionTemplate.
    • greater

      Returns a ExpressionTemplate who's boolean value returns true when the double value of the first ExpressionTemplate is larger than the double value of the second ExpressionTemplate.
      Parameters:
      a - The first ExpressionTemplate to do a check with.
      b - The second ExpressionTemplate to do a check with.
      Returns:
      ExpressionTemplate who's boolean value returns true when the double value of the first ExpressionTemplate is larger than the double value of the second ExpressionTemplate.
    • greaterOrEqual

      public static ExpressionTemplate greaterOrEqual(ExpressionTemplate a, ExpressionTemplate b)
      Returns a ExpressionTemplate who's boolean value returns true when the double value of the first ExpressionTemplate is larger than or equal to the double value of the second ExpressionTemplate.
      Parameters:
      a - The first ExpressionTemplate to do a check with.
      b - The second ExpressionTemplate to do a check with.
      Returns:
      ExpressionTemplate who's boolean value returns true when the double value of the first ExpressionTemplate is larger than or equal to the double value of the second ExpressionTemplate.
    • less

      Returns a ExpressionTemplate who's boolean value returns true when the double value of the first ExpressionTemplate is less than the double value of the second ExpressionTemplate.
      Parameters:
      a - The first ExpressionTemplate to do a check with.
      b - The second ExpressionTemplate to do a check with.
      Returns:
      ExpressionTemplate who's boolean value returns true when the double value of the first ExpressionTemplate is less than the double value of the second ExpressionTemplate.
    • lessOrEqual

      public static ExpressionTemplate lessOrEqual(ExpressionTemplate a, ExpressionTemplate b)
      Returns a ExpressionTemplate who's boolean value returns true when the double value of the first ExpressionTemplate is less than or equal to the double value of the second ExpressionTemplate.
      Parameters:
      a - The first ExpressionTemplate to do a check with.
      b - The second ExpressionTemplate to do a check with.
      Returns:
      ExpressionTemplate who's boolean value returns true when the double value of the first ExpressionTemplate is less than or equal to the double value of the second ExpressionTemplate.
    • sum

      public static ExpressionTemplate sum(Collection<ExpressionTemplate> operands)
      Returns a ExpressionTemplate who's double value is the sum of all double values from the provided ExpressionTemplates.
      Parameters:
      operands - Collection of ExpressionTemplates to sum.
      Returns:
      ExpressionTemplate who's double value is the sum of all double values of the provided ExpressionTemplates.
    • product

      public static ExpressionTemplate product(Collection<ExpressionTemplate> operands)
      Returns a ExpressionTemplate who's double value is the product of all double values from the provided ExpressionTemplates.
      Parameters:
      operands - Collection of ExpressionTemplates to sum.
      Returns:
      ExpressionTemplate who's double value is the product of all double values of the provided ExpressionTemplates.
    • sub

      Returns a ExpressionTemplate who's double value is the double value of the first ExpressionTemplate minus the double value of the second ExpressionTemplate.
      Parameters:
      a - First ExpressionTemplate who's double value to use.
      b - Second ExpressionTemplate who's double value to subtract from the first ExpressionTemplate's double value.
      Returns:
      ExpressionTemplate who's double value is the double value of the first ExpressionTemplate minus the double value of the second ExpressionTemplate.
    • div

      Returns a ExpressionTemplate who's double value is the double value of the first ExpressionTemplate divided by the double value of the second ExpressionTemplate.
      Parameters:
      a - First ExpressionTemplate who's double value to use.
      b - Second ExpressionTemplate who's double value to divide the double value of the first ExpressionTemplate with.
      Returns:
      ExpressionTemplate who's double value is the double value of the first ExpressionTemplate divided by the double value of the second ExpressionTemplate.
    • negateNumber

      public static ExpressionTemplate negateNumber(ExpressionTemplate template)
      Negates the provided ExpressionTemplate's double value.
      Parameters:
      template - The ExpressionTemplate to negate the double value of.
      Returns:
      ExpressionTemplate who's double value has been negated.