Class Util
java.lang.Object
org.apache.sling.commons.log.logback.internal.util.Util
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidclose(InputSource is) static booleanReturns the boolean value of the parameter or thedefaultValueif the parameter isnull.static intReturns the parameter as an integer or thedefaultValueif the parameter isnullor if the parameter is not anIntegerand cannot be converted to anIntegerfrom the parameter's string value.static ObjectReturns the parameter as a single value.
-
Constructor Details
-
Util
public Util()
-
-
Method Details
-
toList
-
close
-
toBoolean
Returns the boolean value of the parameter or thedefaultValueif the parameter isnull. If the parameter is not aBooleanit is converted by callingBoolean.valueOfon the string value of the object.- Parameters:
propValue- the property value ornulldefaultValue- the default boolean value
-
toInteger
Returns the parameter as an integer or thedefaultValueif the parameter isnullor if the parameter is not anIntegerand cannot be converted to anIntegerfrom the parameter's string value.- Parameters:
propValue- the property value ornulldefaultValue- the default integer value
-
toObject
Returns the parameter as a single value. If the parameter is neither an array nor ajava.util.Collectionthe 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. Otherwisenullis returned.- Parameters:
propValue- the parameter to convert.
-