Class TableFormatter<T>
- java.lang.Object
-
- com.android.sdklib.tool.sdkmanager.TableFormatter<T>
-
public class TableFormatter<T> extends java.lang.ObjectMechanism for outputting tabular data to a stream.
-
-
Constructor Summary
Constructors Constructor Description TableFormatter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddColumn(java.lang.String title, java.util.function.Function<T,java.lang.String> valueGetter, int prefixLimit, int suffixLimit)Adds a column to be printed in this table.voidprint(java.util.Collection<T> values, java.io.PrintStream out)Print out a table with the given values to the given stream.
-
-
-
Method Detail
-
addColumn
public void addColumn(@NonNull java.lang.String title, @NonNull java.util.function.Function<T,java.lang.String> valueGetter, int prefixLimit, int suffixLimit)Adds a column to be printed in this table.- Parameters:
title- The title to be shown at the top of the column.valueGetter-Functionreturning the value to be shown in the column.prefixLimit- Max characters to show before "..." if the value is long.suffixLimit- Max characters to show after "..." if the value is long.
-
print
public void print(@NonNull java.util.Collection<T> values, @NonNull java.io.PrintStream out)Print out a table with the given values to the given stream. At least one column must have been added usingaddColumn(String, Function, int, int)
-
-