nu.studer.gradle.util
Class Objects

java.lang.Object
  extended by nu.studer.gradle.util.Objects

public final class Objects
extends java.lang.Object

Utility class.


Method Summary
static void applyClosureToDelegate(groovy.lang.Closure closure, java.lang.Object delegate)
          Applies the given closure to the given delegate.
static int deepHashCode(java.lang.Object element)
          Calculates a hash code for the given object by traversing recursively into each field that does not contain an Object.hashCode() implementation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

applyClosureToDelegate

public static void applyClosureToDelegate(groovy.lang.Closure closure,
                                          java.lang.Object delegate)
Applies the given closure to the given delegate.

Parameters:
closure - the closure to apply
delegate - the delegate that the closure is applied to

deepHashCode

public static int deepHashCode(java.lang.Object element)
Calculates a hash code for the given object by traversing recursively into each field that does not contain an Object.hashCode() implementation. Collections and Maps are always traversed recursively.

Parameters:
element - the element for which to create the deep hash code
Returns:
the deep hash code