Groovy Documentation

groovy.org.codenarc.rule.dry
[Groovy] Class DryUtil

java.lang.Object
  groovy.org.codenarc.rule.dry.DryUtil

class DryUtil

Utility methods for the DRY rule classes

Authors:
Chris Mair


Method Summary
static boolean areTheSameConstantOrLiteralLists(org.codehaus.groovy.ast.expr.ListExpression listExpression1, org.codehaus.groovy.ast.expr.ListExpression listExpression2)

@return true only if both ListExpressions have the same set of constant or literal values, in the same order.

static boolean areTheSameConstantOrLiteralMapEntryExpression(org.codehaus.groovy.ast.expr.MapEntryExpression mapEntryExpression1, org.codehaus.groovy.ast.expr.MapEntryExpression mapEntryExpression2)

@return true only if both MapEntryExpressions have the same constant or literal key and value

static boolean areTheSameConstantOrLiteralMaps(org.codehaus.groovy.ast.expr.MapExpression mapExpression1, org.codehaus.groovy.ast.expr.MapExpression mapExpression2)

@return true only if both MapExpressions have the same set of constant or literal keys and values, in the same order.

static boolean haveTheSameConstantOrLiteralValue(org.codehaus.groovy.ast.expr.Expression expression1, org.codehaus.groovy.ast.expr.Expression expression2)

@return true only if both Expressions have the same constant or literal value

static boolean haveTheSameConstantPropertyExpression(org.codehaus.groovy.ast.expr.Expression expression1, org.codehaus.groovy.ast.expr.Expression expression2)

@return true only if both Expressions have the same constant property expression (e.g., Object.Property)

static boolean haveTheSameConstantValue(org.codehaus.groovy.ast.expr.Expression expression1, org.codehaus.groovy.ast.expr.Expression expression2)

@return true only if both Expressions have the same constant or literal values

static boolean haveTheSameListLiteralValue(org.codehaus.groovy.ast.expr.Expression expression1, org.codehaus.groovy.ast.expr.Expression expression2)

@return true only if both Expressions are ListExpressions and both have the same set of constant or literal values, in the same order.

static boolean haveTheSameMapLiteralValue(org.codehaus.groovy.ast.expr.Expression expression1, org.codehaus.groovy.ast.expr.Expression expression2)

@return true only if both Expressions are MapExpressions and both have the same set of constant or literal keys and values, in the same order.

 
Methods inherited from class Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 

Method Detail

areTheSameConstantOrLiteralLists

static boolean areTheSameConstantOrLiteralLists(org.codehaus.groovy.ast.expr.ListExpression listExpression1, org.codehaus.groovy.ast.expr.ListExpression listExpression2)
Returns:
true only if both ListExpressions have the same set of constant or literal values, in the same order.


areTheSameConstantOrLiteralMapEntryExpression

static boolean areTheSameConstantOrLiteralMapEntryExpression(org.codehaus.groovy.ast.expr.MapEntryExpression mapEntryExpression1, org.codehaus.groovy.ast.expr.MapEntryExpression mapEntryExpression2)
Returns:
true only if both MapEntryExpressions have the same constant or literal key and value


areTheSameConstantOrLiteralMaps

static boolean areTheSameConstantOrLiteralMaps(org.codehaus.groovy.ast.expr.MapExpression mapExpression1, org.codehaus.groovy.ast.expr.MapExpression mapExpression2)
Returns:
true only if both MapExpressions have the same set of constant or literal keys and values, in the same order.


haveTheSameConstantOrLiteralValue

static boolean haveTheSameConstantOrLiteralValue(org.codehaus.groovy.ast.expr.Expression expression1, org.codehaus.groovy.ast.expr.Expression expression2)
Returns:
true only if both Expressions have the same constant or literal value


haveTheSameConstantPropertyExpression

static boolean haveTheSameConstantPropertyExpression(org.codehaus.groovy.ast.expr.Expression expression1, org.codehaus.groovy.ast.expr.Expression expression2)
Returns:
true only if both Expressions have the same constant property expression (e.g., Object.Property)


haveTheSameConstantValue

static boolean haveTheSameConstantValue(org.codehaus.groovy.ast.expr.Expression expression1, org.codehaus.groovy.ast.expr.Expression expression2)
Returns:
true only if both Expressions have the same constant or literal values


haveTheSameListLiteralValue

static boolean haveTheSameListLiteralValue(org.codehaus.groovy.ast.expr.Expression expression1, org.codehaus.groovy.ast.expr.Expression expression2)
Returns:
true only if both Expressions are ListExpressions and both have the same set of constant or literal values, in the same order.


haveTheSameMapLiteralValue

static boolean haveTheSameMapLiteralValue(org.codehaus.groovy.ast.expr.Expression expression1, org.codehaus.groovy.ast.expr.Expression expression2)
Returns:
true only if both Expressions are MapExpressions and both have the same set of constant or literal keys and values, in the same order.


 

Groovy Documentation