From a2d928146c83faf5a5e15bf4cef95c5ad3331b09 Mon Sep 17 00:00:00 2001 From: Oliver Heger Date: Sat, 19 Mar 2011 16:43:58 +0000 Subject: [PATCH] Checkstyle and trailing spaces. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1083220 13f79535-47bb-0310-9956-ffa450edef68 --- .../lang3/builder/ToStringBuilder.java | 81 ++++++++++--------- 1 file changed, 41 insertions(+), 40 deletions(-) diff --git a/src/main/java/org/apache/commons/lang3/builder/ToStringBuilder.java b/src/main/java/org/apache/commons/lang3/builder/ToStringBuilder.java index cc360c670..ff2285a99 100644 --- a/src/main/java/org/apache/commons/lang3/builder/ToStringBuilder.java +++ b/src/main/java/org/apache/commons/lang3/builder/ToStringBuilder.java @@ -5,9 +5,9 @@ * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -39,9 +39,9 @@ import org.apache.commons.lang3.ObjectUtils; * String name; * int age; * boolean smoker; - * + * * ... - * + * * public String toString() { * return new ToStringBuilder(this). * append("name", name). @@ -54,13 +54,13 @@ import org.apache.commons.lang3.ObjectUtils; * *

This will produce a toString of the format: * Person@7f54[name=Stephen,age=29,smoker=false]

- * + * *

To add the superclass toString, use {@link #appendSuper}. * To append the toString from an object that is delegated * to (or any other object), use {@link #appendToString}.

* *

Alternatively, there is a method that uses reflection to determine - * the fields to test. Because these fields are usually private, the method, + * the fields to test. Because these fields are usually private, the method, * reflectionToString, uses AccessibleObject.setAccessible to * change the visibility of the fields. This will fail under a security manager, * unless the appropriate permissions are set up correctly. It is also @@ -79,7 +79,7 @@ import org.apache.commons.lang3.ObjectUtils; *

  * System.out.println("An object: " + ToStringBuilder.reflectionToString(anObject));
  * 
- * + * *

The exact format of the toString is determined by * the {@link ToStringStyle} passed into the constructor.

* @@ -100,20 +100,20 @@ public class ToStringBuilder implements Builder { /** *

Gets the default ToStringStyle to use.

- * + * *

This method gets a singleton default value, typically for the whole JVM. * Changing this default should generally only be done during application startup. * It is recommended to pass a ToStringStyle to the constructor instead * of using this global default.

- * + * *

This method can be used from multiple threads. * Internally, a volatile variable is used to provide the guarantee * that the latest value set using {@link #setDefaultStyle} is the value returned. * It is strongly recommended that the default style is only changed during application startup.

- * + * *

One reason for changing the default could be to have a verbose style during * development and a compact style in production.

- * + * * @return the default ToStringStyle, never null */ public static ToStringStyle getDefaultStyle() { @@ -122,16 +122,16 @@ public class ToStringBuilder implements Builder { /** *

Sets the default ToStringStyle to use.

- * + * *

This method sets a singleton default value, typically for the whole JVM. * Changing this default should generally only be done during application startup. * It is recommended to pass a ToStringStyle to the constructor instead * of changing this global default.

- * + * *

This method is not intended for use from multiple threads. * Internally, a volatile variable is used to provide the guarantee * that the latest value set is the value returned from {@link #getDefaultStyle}.

- * + * * @param style the default ToStringStyle * @throws IllegalArgumentException if the style is null */ @@ -146,7 +146,7 @@ public class ToStringBuilder implements Builder { /** *

Uses ReflectionToStringBuilder to generate a * toString for the specified object.

- * + * * @param object the Object to be output * @return the String result * @see ReflectionToStringBuilder#toString(Object) @@ -158,7 +158,7 @@ public class ToStringBuilder implements Builder { /** *

Uses ReflectionToStringBuilder to generate a * toString for the specified object.

- * + * * @param object the Object to be output * @param style the style of the toString to create, may be null * @return the String result @@ -171,7 +171,7 @@ public class ToStringBuilder implements Builder { /** *

Uses ReflectionToStringBuilder to generate a * toString for the specified object.

- * + * * @param object the Object to be output * @param style the style of the toString to create, may be null * @param outputTransients whether to include transient fields @@ -185,7 +185,8 @@ public class ToStringBuilder implements Builder { /** *

Uses ReflectionToStringBuilder to generate a * toString for the specified object.

- * + * + * @param the type of the object * @param object the Object to be output * @param style the style of the toString to create, may be null * @param outputTransients whether to include transient fields @@ -221,7 +222,7 @@ public class ToStringBuilder implements Builder { *

Constructs a builder for the specified object using the default output style.

* *

This default style is obtained from {@link #getDefaultStyle()}.

- * + * * @param object the Object to build a toString for, not recommended to be null */ public ToStringBuilder(Object object) { @@ -232,7 +233,7 @@ public class ToStringBuilder implements Builder { *

Constructs a builder for the specified object using the a defined output style.

* *

If the style is null, the default style is used.

- * + * * @param object the Object to build a toString for, not recommended to be null * @param style the style of the toString to create, null uses the default style */ @@ -246,7 +247,7 @@ public class ToStringBuilder implements Builder { *

If the style is null, the default style is used.

* *

If the buffer is null, a new one is created.

- * + * * @param object the Object to build a toString for, not recommended to be null * @param style the style of the toString to create, null uses the default style * @param buffer the StringBuffer to populate, may be null @@ -947,9 +948,9 @@ public class ToStringBuilder implements Builder { /** *

Appends with the same format as the default Object toString() - * method. Appends the class name followed by + * method. Appends the class name followed by * {@link System#identityHashCode(java.lang.Object)}.

- * + * * @param object the Object whose class name and id to output * @return this * @since 2.0 @@ -963,10 +964,10 @@ public class ToStringBuilder implements Builder { /** *

Append the toString from the superclass.

- * + * *

This method assumes that the superclass uses the same ToStringStyle * as this one.

- * + * *

If superToString is null, no change is made.

* * @param superToString the result of super.toString() @@ -982,25 +983,25 @@ public class ToStringBuilder implements Builder { /** *

Append the toString from another object.

- * + * *

This method is useful where a class delegates most of the implementation of * its properties to another class. You can then call toString() on * the other class and pass the result into this method.

- * + * *
      *   private AnotherObject delegate;
      *   private String fieldInThisClass;
-     * 
+     *
      *   public String toString() {
      *     return new ToStringBuilder(this).
      *       appendToString(delegate.toString()).
      *       append(fieldInThisClass).
      *       toString();
      *   }
- * + * *

This method assumes that the other object uses the same ToStringStyle * as this one.

- * + * *

If the toString is null, no change is made.

* * @param toString the result of toString() on another object @@ -1016,7 +1017,7 @@ public class ToStringBuilder implements Builder { /** *

Returns the Object being output.

- * + * * @return The object being output. * @since 2.0 */ @@ -1026,7 +1027,7 @@ public class ToStringBuilder implements Builder { /** *

Gets the StringBuffer being populated.

- * + * * @return the StringBuffer being populated */ public StringBuffer getStringBuffer() { @@ -1037,7 +1038,7 @@ public class ToStringBuilder implements Builder { /** *

Gets the ToStringStyle being used.

- * + * * @return the ToStringStyle being used * @since 2.0 */ @@ -1047,12 +1048,12 @@ public class ToStringBuilder implements Builder { /** *

Returns the built toString.

- * + * *

This method appends the end of data indicator, and can only be called once. * Use {@link #getStringBuffer} to get the current string state.

- * + * *

If the object is null, return the style's nullText

- * + * * @return the String toString */ @Override @@ -1066,13 +1067,13 @@ public class ToStringBuilder implements Builder { } /** - * Returns the String that was build as an object representation. The + * Returns the String that was build as an object representation. The * default implementation utilizes the {@link #toString()} implementation. - * + * * @return the String toString - * + * * @see #toString() - * + * * @since 3.0 */ public String build() {