[ 
https://issues.apache.org/jira/browse/LANG-1366?focusedWorklogId=323447&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-323447
 ]

ASF GitHub Bot logged work on LANG-1366:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 04/Oct/19 14:51
            Start Date: 04/Oct/19 14:51
    Worklog Time Spent: 10m 
      Work Description: pckeyan commented on pull request #308: LANG-1366 : Add 
Feature for No ClassName and MultiLine StringStyle
URL: https://github.com/apache/commons-lang/pull/308#discussion_r331542885
 
 

 ##########
 File path: src/main/java/org/apache/commons/lang3/builder/ToStringStyle.java
 ##########
 @@ -2633,4 +2647,48 @@ private Object readResolve() {
         }
 
     }
+
+    // 
----------------------------------------------------------------------------
+
+    /**
+     * <p>
+     * <code>ToStringStyle</code> that outputs with No Class Name in a Multi 
Line format.
+     * </p>
+     *
+     * <p>
+     * This is an inner class rather than using
+     * <code>StandardToStringStyle</code> to ensure its immutability.
+     * </p>
+     *
+     * @since 3.7
+     * @see <a href="http://json.org";>json.org</a>
+     */
+    private static final class NoClassNameMultiLineToStringStyle extends 
ToStringStyle {
+
+        private static final long serialVersionUID = 1L;
+
+        /**
+         * <p>Constructor.</p>
+         * <p>
+         * <p>Use the static constant rather than instantiating.</p>
+         */
+        NoClassNameMultiLineToStringStyle() {
+            super();
+            this.setUseClassName(false);
+            this.setUseIdentityHashCode(false);
+            this.setContentStart(StringUtils.EMPTY);
+            this.setFieldSeparator(System.lineSeparator());
+            this.setFieldSeparatorAtStart(false);
+            this.setContentEnd(System.lineSeparator());
+        }
+
+        /**
+         * <p>Ensure <code>Singleton</code> after serialization.</p>
+         *
+         * @return the singleton
+         */
+        private Object readResolve() {
+            return ToStringStyle.NO_CLASS_NAME_MULTI_LINE_STYLE;
 
 Review comment:
   Updated the return type.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 323447)
    Time Spent: 50m  (was: 40m)

> Add Feature for No ClassName and MultiLine StringStyle
> ------------------------------------------------------
>
>                 Key: LANG-1366
>                 URL: https://issues.apache.org/jira/browse/LANG-1366
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.*
>            Reporter: Karthikeyan Palanivelu
>            Priority: Major
>              Labels: features
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> Add feature to print String with No Class Name and MultiLine. This would be 
> of helpful for more like metrics related use cases which needs to print like 
> properties with No Class Name and each property in new line.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to