Package org.apache.tika.util
Class PropsUtil
- java.lang.Object
-
- org.apache.tika.util.PropsUtil
-
public class PropsUtil extends Object
Utility class to handle properties. If the value is null, or if there is a parser error, the defaultMissing value will be returned.
-
-
Constructor Summary
Constructors Constructor Description PropsUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BooleangetBoolean(String v, Boolean defaultMissing)Parses v.static IntegergetInt(String v, Integer defaultMissing)Parses v.static LonggetLong(String v, Long defaultMissing)Parses v.static PathgetPath(String v, Path defaultMissing)Parses v.static StringgetString(String v, String defaultMissing)Parses v.
-
-
-
Method Detail
-
getBoolean
public static Boolean getBoolean(String v, Boolean defaultMissing)
Parses v. If there is a problem, this returns defaultMissing.- Parameters:
v- string to parsedefaultMissing- value to return if value is null or unparseable- Returns:
- parsed value
-
getInt
public static Integer getInt(String v, Integer defaultMissing)
Parses v. If there is a problem, this returns defaultMissing.- Parameters:
v- string to parsedefaultMissing- value to return if value is null or unparseable- Returns:
- parsed value
-
getLong
public static Long getLong(String v, Long defaultMissing)
Parses v. If there is a problem, this returns defaultMissing.- Parameters:
v- string to parsedefaultMissing- value to return if value is null or unparseable- Returns:
- parsed value
-
getString
public static String getString(String v, String defaultMissing)
Parses v. If v is null, this returns defaultMissing.- Parameters:
v- string to parsedefaultMissing- value to return if value is null- Returns:
- parsed value
-
getPath
public static Path getPath(String v, Path defaultMissing)
Parses v. If there is a problem, this returns defaultMissing.- Parameters:
v- string to parsedefaultMissing- value to return if value is null or unparseable- Returns:
- parsed value
- See Also:
getPath(String, Path)
-
-