Top Description Methods
io.github.kusoroadeolu.clique.components

public Interface Component

Known Direct Subinterfaces
io.github.kusoroadeolu.clique.components.Table
Known Direct Implementers
io.github.kusoroadeolu.clique.components.Divider, io.github.kusoroadeolu.clique.components.Frame, io.github.kusoroadeolu.clique.components.ItemList, io.github.kusoroadeolu.clique.components.ProgressBar, io.github.kusoroadeolu.clique.components.Tree, io.github.kusoroadeolu.clique.components.Box
Annotations
@Stable
since:3.2.0
@SuppressWarnings:java:S106
Imports
io.github.kusoroadeolu.clique.internal.documentation.Stable, java.io.PrintStream

Base interface for all renderable components.

Implementations produce a fully formatted string via get(), which is then written to a PrintStream by the render methods. All built-in components — such as Frame and Tree — implement this interface.

Example:

Component component = new Frame().nest("Hello");
component.render();               // prints to System.out
component.render(System.err);     // prints to a specific stream
String raw = component.get();     // retrieve without printing
Since
2.0.0

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the rendered content; never null
get
()

Builds and returns the fully formatted string representation of this component.

public default void
render()

Prints the rendered component to System#out, followed by a newline.

public default void
render(PrintStream
the stream to print to; must not be null
stream
)

Prints the rendered component to the given PrintStream, followed by a newline.

Method Detail

getback to summary
public String get()

Builds and returns the fully formatted string representation of this component.

Each call performs a full render — no caching is implied by this interface. Implementations may document their own caching behavior if applicable.

Returns:String

the rendered content; never null

renderback to summary
public default void render()

Prints the rendered component to System#out, followed by a newline.

Equivalent to render(System.out).

renderback to summary
public default void render(PrintStream stream)

Prints the rendered component to the given PrintStream, followed by a newline.

Parameters
stream:PrintStream

the stream to print to; must not be null

Exceptions
NullPointerException:
if stream is null