Class Element<T extends Element<T>>
- java.lang.Object
-
- org.opentest4j.reporting.events.api.Element<T>
-
- Type Parameters:
T
- element type
- All Implemented Interfaces:
Appendable<T>
- Direct Known Subclasses:
ChildElement
,Events
public class Element<T extends Element<T>> extends java.lang.Object implements Appendable<T>
Base class for elements.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <C extends ChildElement<T,? super C>>
Appendable<T>append(Factory<C> creator, java.util.function.Consumer<? super C> configurer)
Append the child element created by the supplied factory configured by the supplied consumer.java.lang.String
toString()
Element<T>
withAttribute(org.opentest4j.reporting.schema.QualifiedName qualifiedName, java.lang.String value)
Add an attribute to this element.Element<T>
withCDataSection(java.lang.String value)
Add a CDATA section to this element.Element<T>
withContent(java.lang.String value)
Add text content to this element.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.opentest4j.reporting.events.api.Appendable
append
-
-
-
-
Method Detail
-
withContent
public Element<T> withContent(java.lang.String value)
Add text content to this element.- Parameters:
value
- the text content- Returns:
- this element
-
withCDataSection
public Element<T> withCDataSection(java.lang.String value)
Add a CDATA section to this element.- Parameters:
value
- the content of the CDATA section- Returns:
- this element
-
withAttribute
public Element<T> withAttribute(org.opentest4j.reporting.schema.QualifiedName qualifiedName, java.lang.String value)
Add an attribute to this element.- Parameters:
qualifiedName
- the qualified name of the attributevalue
- the attribute value- Returns:
- this element
-
append
public <C extends ChildElement<T,? super C>> Appendable<T> append(Factory<C> creator, java.util.function.Consumer<? super C> configurer)
Description copied from interface:Appendable
Append the child element created by the supplied factory configured by the supplied consumer.- Specified by:
append
in interfaceAppendable<T extends Element<T>>
- Type Parameters:
C
- child element type- Parameters:
creator
- child element factoryconfigurer
- child element configurer- Returns:
- self reference to allow method chaining
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-