Top Description Methods
org.eclipse.xtend.lib.annotations

public @Interface ToString

extends Annotation
Annotations
@Beta
@Target:TYPE
@Active:ToStringProcessor
@GwtCompatible
@SuppressWarnings:all
Imports
com.google.common.annotations.Beta, .GwtCompatible, java.lang.annotation.ElementType, .Target, org.eclipse.xtend.lib.macro.Active, org.eclipse.xtext.xbase.lib.util.ToStringBuilder

Creates a default toString implementation.

All non-static fields of this class and all of its superclasses are used. Reflection is used to access all fields if this class has a superclass. This may not work in restrictive environments. For such cases use ToStringBuilder to write a non-reflective implementation.

The default format is:
 ClassName [
   field1 = "Foo"
   field2 = 2
   field3 = null
 ]
The class name is hardcoded. Subclasses which inherit this class without overriding toString will show the same name.

For brevity there are options to hide field names, skip fields with null values and print everything on one line.

Since
2.7

Method Summary

Modifier and TypeMethod and Description
public boolean
hideFieldNames()

Only list the values of the fields, not their names

public boolean
singleLine()

Seperate fields with a comma and a single space

public boolean
skipNulls()

Fields with null values are not shown in the output.

public boolean
verbatimValues()

By default, Iterables, Arrays and multiline Strings are pretty-printed.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

hideFieldNamesback to summary
public boolean hideFieldNames()

Only list the values of the fields, not their names

singleLineback to summary
public boolean singleLine()

Seperate fields with a comma and a single space

skipNullsback to summary
public boolean skipNulls()

Fields with null values are not shown in the output.

verbatimValuesback to summary
public boolean verbatimValues()

By default, Iterables, Arrays and multiline Strings are pretty-printed. Switching to their normal representation makes the toString method significantly faster.

Since
2.9