Package cz.martlin.xspf.util
Interface XMLDocumentUtilityHelper.NullableTextToValueMapper<T>
-
- Type Parameters:
T-
- Enclosing class:
- XMLDocumentUtilityHelper
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public static interface XMLDocumentUtilityHelper.NullableTextToValueMapper<T>
An mapping of the text (or null) obtained from the XML file to some particular java type. To convert to string, you can useTEXT_TO_STRINGmapping.- Author:
- martin
-
-
Field Summary
Fields Modifier and Type Field Description static XMLDocumentUtilityHelper.NullableTextToValueMapper<String>TEXT_TO_STRINGAn identity (i.e. empty) mapping.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static <T> XMLDocumentUtilityHelper.NullableTextToValueMapper<T>checked(XMLDocumentUtilityHelper.NonNullTextToValueMapper<T> nonNullMapper)Encapsulates the givenXMLDocumentUtilityHelper.NonNullTextToValueMapperto beXMLDocumentUtilityHelper.NullableTextToValueMapper.TtextOrNullToValue(String text)Converts the given (possibly null) text to the particular value.
-
-
-
Field Detail
-
TEXT_TO_STRING
static final XMLDocumentUtilityHelper.NullableTextToValueMapper<String> TEXT_TO_STRING
An identity (i.e. empty) mapping.
-
-
Method Detail
-
textOrNullToValue
T textOrNullToValue(String text) throws Exception
Converts the given (possibly null) text to the particular value.- Parameters:
text-- Returns:
- Throws:
Exception
-
checked
static <T> XMLDocumentUtilityHelper.NullableTextToValueMapper<T> checked(XMLDocumentUtilityHelper.NonNullTextToValueMapper<T> nonNullMapper)
Encapsulates the givenXMLDocumentUtilityHelper.NonNullTextToValueMapperto beXMLDocumentUtilityHelper.NullableTextToValueMapper.- Type Parameters:
T-- Parameters:
nonNullMapper-- Returns:
-
-