Search in sources :

Example 1 with ToStringBuilder

use of org.eclipse.xtext.xbase.lib.util.ToStringBuilder in project xtext-eclipse by eclipse.

the class EclipseWorkspaceConfig method toString.

@Override
@Pure
public String toString() {
    ToStringBuilder b = new ToStringBuilder(this);
    b.add("workspaceRoot", this.workspaceRoot);
    b.add("projectConfigProvider", this.projectConfigProvider);
    return b.toString();
}
Also used : ToStringBuilder(org.eclipse.xtext.xbase.lib.util.ToStringBuilder) Pure(org.eclipse.xtext.xbase.lib.Pure)

Example 2 with ToStringBuilder

use of org.eclipse.xtext.xbase.lib.util.ToStringBuilder in project eclipse.jdt.ls by eclipse.

the class DidChangeWatchedFilesRegistrationOptions method toString.

@Override
@Pure
public String toString() {
    ToStringBuilder b = new ToStringBuilder(this);
    b.add("watchers", this.watchers);
    return b.toString();
}
Also used : ToStringBuilder(org.eclipse.xtext.xbase.lib.util.ToStringBuilder) Pure(org.eclipse.xtext.xbase.lib.Pure)

Example 3 with ToStringBuilder

use of org.eclipse.xtext.xbase.lib.util.ToStringBuilder in project xtext-eclipse by eclipse.

the class JavaSource method toString.

@Override
public String toString() {
    ToStringBuilder b = new ToStringBuilder(this);
    b.add("fileName", this.fileName);
    b.add("code", this.code);
    return b.toString();
}
Also used : ToStringBuilder(org.eclipse.xtext.xbase.lib.util.ToStringBuilder)

Example 4 with ToStringBuilder

use of org.eclipse.xtext.xbase.lib.util.ToStringBuilder in project xtext-lib by eclipse.

the class ToStringHelperTest method testSkipNulls.

@Test
public void testSkipNulls() {
    ToStringHelperTest.MyEntity _myEntity = new ToStringHelperTest.MyEntity();
    final ToStringBuilder helper = new ToStringBuilder(_myEntity).skipNulls().addAllFields();
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("MyEntity [");
    _builder.newLine();
    _builder.append("  ");
    _builder.append("boolProp = true");
    _builder.newLine();
    _builder.append("  ");
    _builder.append("intProp = 42");
    _builder.newLine();
    _builder.append("  ");
    _builder.append("myList = ArrayList (");
    _builder.newLine();
    _builder.append("    ");
    _builder.append("\"foo\",");
    _builder.newLine();
    _builder.append("    ");
    _builder.append("\"bar\",");
    _builder.newLine();
    _builder.append("    ");
    _builder.append("\"baz\"");
    _builder.newLine();
    _builder.append("  ");
    _builder.append(")");
    _builder.newLine();
    _builder.append("  ");
    _builder.append("policy = CLASS");
    _builder.newLine();
    _builder.append("]");
    Assert.assertEquals(ToStringHelperTest.toUnix(_builder.toString()), helper.toString());
}
Also used : ToStringBuilder(org.eclipse.xtext.xbase.lib.util.ToStringBuilder) StringConcatenation(org.eclipse.xtend2.lib.StringConcatenation) Test(org.junit.Test)

Example 5 with ToStringBuilder

use of org.eclipse.xtext.xbase.lib.util.ToStringBuilder in project xtext-lib by eclipse.

the class ToStringHelperTest method testSingleLine.

@Test
public void testSingleLine() {
    ToStringHelperTest.MyEntity _myEntity = new ToStringHelperTest.MyEntity();
    final ToStringBuilder helper = new ToStringBuilder(_myEntity).singleLine().addAllFields();
    Assert.assertEquals("MyEntity [boolProp = true, intProp = 42, myList = ArrayList (\"foo\",\"bar\",\"baz\"), friend = null, policy = CLASS]", helper.toString());
}
Also used : ToStringBuilder(org.eclipse.xtext.xbase.lib.util.ToStringBuilder) Test(org.junit.Test)

Aggregations

ToStringBuilder (org.eclipse.xtext.xbase.lib.util.ToStringBuilder)51 Pure (org.eclipse.xtext.xbase.lib.Pure)15 Test (org.junit.Test)11 StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)7 ToString (org.eclipse.xtend.lib.annotations.ToString)1