Package nu.studer.gradle.jooq.util
Class Objects
java.lang.Object
nu.studer.gradle.jooq.util.Objects
Utility class.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidapplyClosureToDelegate(groovy.lang.Closure<?> closure, Object delegate) Applies the given closure to the given delegate.static <T> TcloneObject(T obj) Clones the given object via in-memory object serialization and deserialization.static StringCalculates a hash of the given object from its serialized version.
-
Method Details
-
applyClosureToDelegate
Applies the given closure to the given delegate.- Parameters:
closure- the closure to applydelegate- the delegate that the closure is applied to
-
cloneObject
public static <T> T cloneObject(T obj) Clones the given object via in-memory object serialization and deserialization.- Type Parameters:
T- the type of the object to clone- Parameters:
obj- the object to clone- Returns:
- the cloned object
-
deepHash
Calculates a hash of the given object from its serialized version. This method is thread-safe, can be used in parallel builds without an issue.- Parameters:
obj- the object for which to calculate the hash- Returns:
- the hash
-