Package cdc.util.data.util
Interface TextContentConverter
-
- 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 interface TextContentConverter
-
-
Field Summary
Fields Modifier and Type Field Description static TextContentConverterIDENTITY
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default TextContentConverterandThen(TextContentConverter other)Returns a converter that first applies this converter and thenother.default TextContentConvertercompose(TextContentConverter other)Returns a converter that first appliesotherthen this converter.StringconvertTextContent(Parent parent, String content)static TextContentConverterfromContentFunction(UnaryOperator<String> function)Creates a new TextContentConverter from a content converter function.static TextContentConverterfromContentMap(Map<String,String> map)Creates a new TextContentConverter from a map.static TextContentConverterfromNameMap(Map<String,String> map)static TextContentConverterfromPathMap(Map<SPath,String> map)static TextContentConverterfromString(String s)static TextContentConverterscramble(boolean preserveSpaces)
-
-
-
Field Detail
-
IDENTITY
static final TextContentConverter IDENTITY
-
-
Method Detail
-
compose
default TextContentConverter compose(TextContentConverter other)
Returns a converter that first appliesotherthen this converter.- Parameters:
other- The other converter.- Returns:
- A converter that first applies
otherthen this converter. - Throws:
IllegalArgumentException- Whenotherisnull.
-
andThen
default TextContentConverter andThen(TextContentConverter other)
Returns a converter that first applies this converter and thenother.- Parameters:
other- The other converter.- Returns:
- A converter that first applies this converter and then
other. - Throws:
IllegalArgumentException- Whenotherisnull.
-
fromString
static TextContentConverter fromString(String s)
-
scramble
static TextContentConverter scramble(boolean preserveSpaces)
-
fromContentFunction
static TextContentConverter fromContentFunction(UnaryOperator<String> function)
Creates a new TextContentConverter from a content converter function.Conversion is independent of element.
- Parameters:
function- The function used to convert content.- Returns:
- A new TextContentConverter from
function. - Throws:
IllegalArgumentException- Whenfunctionisnull.
-
fromContentMap
static TextContentConverter fromContentMap(Map<String,String> map)
Creates a new TextContentConverter from a map.Conversion is independent of element and attribute name.
If a value is not mapped, then result is that value.- Parameters:
map- The map.- Returns:
- A new TextContentConverter from
map. - Throws:
IllegalArgumentException- Whenmapisnull.
-
fromNameMap
static TextContentConverter fromNameMap(Map<String,String> map)
-
fromPathMap
static TextContentConverter fromPathMap(Map<SPath,String> map)
-
-