Class Objects.ToStringHelper

    • Method Detail

      • add

        @CanIgnoreReturnValue
        public Objects.ToStringHelper add​(java.lang.String name,
                                          @Nullable java.lang.Object value)
        Deprecated.
        Adds a name/value pair to the formatted output in name=value format. If value is null, the string "null" is used, unless omitNullValues() is called, in which case this name/value pair will not be added.
      • add

        @CanIgnoreReturnValue
        public Objects.ToStringHelper add​(java.lang.String name,
                                          boolean value)
        Deprecated.
        Adds a name/value pair to the formatted output in name=value format.
        Since:
        11.0 (source-compatible since 2.0)
      • add

        @CanIgnoreReturnValue
        public Objects.ToStringHelper add​(java.lang.String name,
                                          char value)
        Deprecated.
        Adds a name/value pair to the formatted output in name=value format.
        Since:
        11.0 (source-compatible since 2.0)
      • add

        @CanIgnoreReturnValue
        public Objects.ToStringHelper add​(java.lang.String name,
                                          double value)
        Deprecated.
        Adds a name/value pair to the formatted output in name=value format.
        Since:
        11.0 (source-compatible since 2.0)
      • add

        @CanIgnoreReturnValue
        public Objects.ToStringHelper add​(java.lang.String name,
                                          float value)
        Deprecated.
        Adds a name/value pair to the formatted output in name=value format.
        Since:
        11.0 (source-compatible since 2.0)
      • add

        @CanIgnoreReturnValue
        public Objects.ToStringHelper add​(java.lang.String name,
                                          int value)
        Deprecated.
        Adds a name/value pair to the formatted output in name=value format.
        Since:
        11.0 (source-compatible since 2.0)
      • add

        @CanIgnoreReturnValue
        public Objects.ToStringHelper add​(java.lang.String name,
                                          long value)
        Deprecated.
        Adds a name/value pair to the formatted output in name=value format.
        Since:
        11.0 (source-compatible since 2.0)
      • toString

        public java.lang.String toString()
        Deprecated.
        Returns a string in the format specified by Objects.toStringHelper(Object).

        After calling this method, you can keep adding more properties to later call toString() again and get a more complete representation of the same object; but properties cannot be removed, so this only allows limited reuse of the helper instance. The helper allows duplication of properties (multiple name/value pairs with the same name can be added).

        Overrides:
        toString in class java.lang.Object