Groovy Documentation

org.linkedin.glu.groovy.utils
[Groovy] Class GluGroovyLangUtils

java.lang.Object
  org.linkedin.groovy.util.lang.GroovyLangUtils
      org.linkedin.glu.groovy.utils.GluGroovyLangUtils

class GluGroovyLangUtils
extends GroovyLangUtils

Authors:
yan@pongasoft.com


Method Summary
static T copyProperties(java.lang.Object source, T target)

Copy the properties from source to target and copy only the properties that exist in target

static boolean getOptionalBoolean(java.lang.Object value, boolean defaultValue)

static long getOptionalLong(java.lang.Object config, java.lang.String name, long defaultValue)

@return the long found in the config or the default value

static java.lang.Object noException(java.util.Collection closures)

Call all the closures and make sure none of it throws an exception.

static java.lang.Object onlyOneException(java.util.Collection closures)

Throw only 1 exception (at most) even if there are multiple.

 

Method Detail

copyProperties

static T copyProperties(java.lang.Object source, T target)
Copy the properties from source to target and copy only the properties that exist in target
Returns:
target


getOptionalBoolean

static boolean getOptionalBoolean(java.lang.Object value, boolean defaultValue)


getOptionalLong

static long getOptionalLong(java.lang.Object config, java.lang.String name, long defaultValue)
Returns:
the long found in the config or the default value


noException

static java.lang.Object noException(java.util.Collection closures)
Call all the closures and make sure none of it throws an exception. This method itself does not throws exception. The value returned by the last closure in the collection will be returned


onlyOneException

static java.lang.Object onlyOneException(java.util.Collection closures)
Throw only 1 exception (at most) even if there are multiple.


 

Groovy Documentation