Utilities
Object containing various utility methods for sequence filtering, XML parsing, and rendering XML nodes as strings. CONSIDER splitting this object among FP and XML.
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Utilities.type
Members list
Value members
Concrete methods
Method to filter a sequence of object according to a value and a lens function.
Method to filter a sequence of object according to a value and a lens function.
CONSIDER is there a method in the standard library which does this?
Type parameters
- A
-
the type of the value to be matched.
- T
-
the underlying type of the input and output sequences.
Value parameters
- a
-
the value that must be matched.
- lens
-
the function which will extract an A from a T.
- ts
-
the sequence to be filtered.
Attributes
- Returns
-
the filtered version of the sequence.
The purpose of this method is to allow a String to be parsed as an XML entity, WITHOUT replace " by "
The purpose of this method is to allow a String to be parsed as an XML entity, WITHOUT replace " by "
Value parameters
- w
-
the XML string to be parsed.
Attributes
- Returns
-
an XML element.
Renders a detailed representation of an XML node, including its attributes, descendants, and optionally its children in a deep or shallow manner.
Renders a detailed representation of an XML node, including its attributes, descendants, and optionally its children in a deep or shallow manner.
Value parameters
- deep
-
a boolean indicating if children should be rendered recursively. Defaults to false.
- node
-
the XML node to be rendered.
Attributes
- Returns
-
a string containing the rendered representation of the XML node.
Renders a sequence of XML nodes into a single formatted string.
Renders a sequence of XML nodes into a single formatted string.
Value parameters
- nodes
-
the sequence of XML nodes to be rendered.
Attributes
- Returns
-
a string representation of the rendered XML nodes.
Prints the rendered representation of an XML node using the provided function.
Prints the rendered representation of an XML node using the provided function.
Value parameters
- f
-
the function used to output the rendered node as a string. Defaults to
println. - node
-
the XML node to be rendered and displayed.
Attributes
- Returns
-
an
IO[Unit]representing the execution of the display action.