Class ToString.Style

java.lang.Object
fc.util.ToString.Style
Enclosing class:
ToString

public static class ToString.Style extends Object
Drives the formatting behavior. Behavior different than the defaults can be achieved by instantiating a new object and setting it's properties appropriately.
  • Field Details

    • startString

      The start of the entire string. default to empty: ""
    • endString

      public String endString
      The end of the entire string. default to empty: ""
    • startContent

      The start of the string after the object classname and identity reference. default: [
    • endContent

      The end of the string after the object classname and identity reference. default: ]
    • fieldAndValSep

      default: =
    • fieldSep

      public String fieldSep
      default: ,
    • startArray

      default: {
    • endArray

      public String endArray
      default: }
    • arrayValSep

      default: ,
    • expandArrays

      public boolean expandArrays
      Expand array values, default: false. invalid input: '<'bNote: expansion only works when arrays are manually added using one of the append(..) methods, not when using reflection.
    • fieldName

      public boolean fieldName
      Print the field name ? default: true. If field names are not printed, then neither is the
      invalid reference
      #FieldAndValSep
      - only the value of a field is printed.
    • className

      public boolean className
      Print the class name at all ? default: true
    • fullClassName

      public boolean fullClassName
      print full class name ? default: false
    • idHashCode

      public boolean idHashCode
      print indentity hash code for the object ? default: true
    • reflectFieldName

      public boolean reflectFieldName
      print field names when using reflection ? default: true
    • reflectSuperClass

      public boolean reflectSuperClass
      Prints the superclass's variables when using reflection ? default: false
    • reflectStatics

      public boolean reflectStatics
      Reflects static variables. By default this is false since statics are not part of the object's instance-state.
    • reflectVisibleLevel

      Default access level when using reflection (fields with this or looser access will be printed). default: PRIVATE (EVERYTHING IS PRINTED)
  • Constructor Details

  • Method Details

    • ignoreFieldName

      public void ignoreFieldName(String name)
      Case insensitive field names that will be ignored (for example a public field "foo" may be printed otherwise, but if added to this list, it would be ignored). Use this method to add as many field names as needed.
    • toString

      public String toString()
      Overrides:
      toString in class Object