Package cz.martlin.xspf.util
Interface XMLDocumentUtilityHelper.NullableValueToTextMapper<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.NullableValueToTextMapper<T>
An mapping of the particular java object (or null) to text to fill into the XML file. To convert a string, you can useSTRING_TO_TEXTmapping.- Author:
- martin
-
-
Field Summary
Fields Modifier and Type Field Description static XMLDocumentUtilityHelper.NullableValueToTextMapper<String>STRING_TO_TEXTAn identity (i.e. empty) mapping.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static <T> XMLDocumentUtilityHelper.NullableValueToTextMapper<T>checked(XMLDocumentUtilityHelper.NonNullValueToTextMapper<T> nonNullMapper)Encapsulates the givenXMLDocumentUtilityHelper.NonNullValueToTextMapperto beXMLDocumentUtilityHelper.NullableValueToTextMapper.StringvalueOrNullToText(T value)Converts the given (possibly null) java object to the xml text.
-
-
-
Field Detail
-
STRING_TO_TEXT
static final XMLDocumentUtilityHelper.NullableValueToTextMapper<String> STRING_TO_TEXT
An identity (i.e. empty) mapping.
-
-
Method Detail
-
valueOrNullToText
String valueOrNullToText(T value) throws Exception
Converts the given (possibly null) java object to the xml text.- Parameters:
value-- Returns:
- Throws:
Exception
-
checked
static <T> XMLDocumentUtilityHelper.NullableValueToTextMapper<T> checked(XMLDocumentUtilityHelper.NonNullValueToTextMapper<T> nonNullMapper)
Encapsulates the givenXMLDocumentUtilityHelper.NonNullValueToTextMapperto beXMLDocumentUtilityHelper.NullableValueToTextMapper.- Type Parameters:
T-- Parameters:
nonNullMapper-- Returns:
-
-