java.lang.Object
ushiosan.jvm_utilities.internal.print.str.BasePrintObject
Direct Known Subclasses:
SimplePrintObject, VerbosePrintObject

public abstract class BasePrintObject extends Object
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 Details

  • Constructor Details

    • BasePrintObject

      protected BasePrintObject()
      This class cannot be instantiated.

      Singleton or utility class mode.

  • Method Details

    • getInstance

      @NotNull public static @NotNull BasePrintObject getInstance(boolean verbose)
      Get valid print object instance
      Parameters:
      verbose - verbose information state
      Returns:
      a valid print object instance
    • nullString

      @NotNull public @NotNull String nullString()
      Null reference string representation
      Returns:
      null string representation
    • toStringString

      protected String toStringString(@NotNull @NotNull Object obj)
      String representation
      Parameters:
      obj - the object to convert
      Returns:
      an object string representation
    • toEntryString

      @NotNull protected @NotNull String toEntryString(@NotNull @NotNull Object obj)
      Entry string representation
      Parameters:
      obj - the object to convert
      Returns:
      an object string representation
    • toObjectString

      @NotNull protected @NotNull String toObjectString(@NotNull @NotNull Object obj)
      Generic object string representation
      Parameters:
      obj - the object to convert
      Returns:
      an object string representation
    • toClassString

      @NotNull protected @NotNull String toClassString(@NotNull @NotNull Object obj)
      Class string representation
      Parameters:
      obj - the object to convert
      Returns:
      an object 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 action
      supported - supported elements
    • toString

      Object string representation
      Parameters:
      obj - the object to convert
      Returns:
      an object string representation
    • toCollectionString

      @NotNull protected abstract @NotNull String toCollectionString(@NotNull @NotNull Object obj)
      Collection string representation
      Parameters:
      obj - the object to convert
      Returns:
      an object string representation
    • toMapString

      @NotNull protected abstract @NotNull String toMapString(@NotNull @NotNull Object obj)
      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