Class Util
java.lang.Object
org.apache.sling.commons.log.logback.internal.util.Util
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
close
(InputSource is) static boolean
Returns the boolean value of the parameter or thedefaultValue
if the parameter isnull
.static int
Returns the parameter as an integer or thedefaultValue
if the parameter isnull
or if the parameter is not anInteger
and cannot be converted to anInteger
from the parameter's string value.static Object
Returns the parameter as a single value.
-
Constructor Details
-
Util
public Util()
-
-
Method Details
-
toList
-
close
-
toBoolean
Returns the boolean value of the parameter or thedefaultValue
if the parameter isnull
. If the parameter is not aBoolean
it is converted by callingBoolean.valueOf
on the string value of the object.- Parameters:
propValue
- the property value ornull
defaultValue
- the default boolean value
-
toInteger
Returns the parameter as an integer or thedefaultValue
if the parameter isnull
or if the parameter is not anInteger
and cannot be converted to anInteger
from the parameter's string value.- Parameters:
propValue
- the property value ornull
defaultValue
- the default integer value
-
toObject
Returns the parameter as a single value. If the parameter is neither an array nor ajava.util.Collection
the parameter is returned unmodified. If the parameter is a non-empty array, the first array element is returned. If the property is a non-emptyjava.util.Collection
, the first collection element is returned. Otherwisenull
is returned.- Parameters:
propValue
- the parameter to convert.
-