Class BasePrintObject
java.lang.Object
ushiosan.jvm_utilities.internal.print.str.BasePrintObject
- Direct Known Subclasses:
SimplePrintObject,VerbosePrintObject
Class containing all the base functionality for printing objects.
This object can add extra functionality thanks to a plugin system without having to edit the class
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidattachExtension(@NotNull Pair<Apply.Result<Object, String>, Class<?>[]> extension) Insert new printable extension to the instancevoidattachExtension(Apply.Result<Object, String> action, Class<?> @NotNull ... supported) Insert new printable extension to the instancestatic @NotNull BasePrintObjectgetInstance(boolean verbose) Get valid print object instanceprotected abstract booleancheck if an object is verbose or notNull reference string representationtoClassString(@NotNull Object obj) Class string representationCollection string representationtoEntryString(@NotNull Object obj) Entry string representationtoMapString(@NotNull Object obj) Map string representationtoObjectString(@NotNull Object obj) Generic object string representationtoPathString(@NotNull Object obj) Path string representationObject string representationprotected StringtoStringString(@NotNull Object obj) String representation
-
Field Details
-
printMap
Print map
-
-
Constructor Details
-
BasePrintObject
protected BasePrintObject()This class cannot be instantiated.Singleton or utility class mode.
-
-
Method Details
-
getInstance
Get valid print object instance- Parameters:
verbose- verbose information state- Returns:
- a valid print object instance
-
nullString
Null reference string representation- Returns:
- null string representation
-
attachExtension
public void attachExtension(@NotNull @NotNull Pair<Apply.Result<Object, String>, Class<?>[]> extension) Insert new printable extension to the instance- Parameters:
extension- the extension to insert
-
attachExtension
public void attachExtension(@NotNull Apply.Result<Object, String> action, Class<?> @NotNull ... supported) Insert new printable extension to the instance- Parameters:
action- the extension actionsupported- supported elements
-
toString
Object string representation- Parameters:
obj- the object to convert- Returns:
- an object string representation
-
toStringString
String representation- Parameters:
obj- the object to convert- Returns:
- an object string representation
-
toEntryString
Entry string representation- Parameters:
obj- the object to convert- Returns:
- an object string representation
-
toObjectString
Generic object string representation- Parameters:
obj- the object to convert- Returns:
- an object string representation
-
toClassString
Class string representation- Parameters:
obj- the object to convert- Returns:
- an object string representation
-
toPathString
Path string representation- Parameters:
obj- the object to convert- Returns:
- an object string representation
-
toCollectionString
Collection string representation- Parameters:
obj- the object to convert- Returns:
- an object string representation
-
toMapString
Map string representation- Parameters:
obj- the object to convert- Returns:
- an object string representation
-
isVerbose
protected abstract boolean isVerbose()check if an object is verbose or not- Returns:
- verbose status
-