Search in sources :

Example 21 with ToStringBuilder

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

the class TextRange method toString.

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

Example 22 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 23 with ToStringBuilder

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

the class ProjectDescription method toString.

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

Example 24 with ToStringBuilder

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

the class EclipseSourceFolder method toString.

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

Example 25 with ToStringBuilder

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

the class ToStringHelperTest method testExplicitFieldListing.

@Test
public void testExplicitFieldListing() {
    ToStringHelperTest.MyEntity _myEntity = new ToStringHelperTest.MyEntity();
    final ToStringBuilder helper = new ToStringBuilder(_myEntity).add("boolProp", Boolean.valueOf(false)).addField("intProp");
    StringConcatenation _builder = new StringConcatenation();
    _builder.append("MyEntity [");
    _builder.newLine();
    _builder.append("  ");
    _builder.append("boolProp = false");
    _builder.newLine();
    _builder.append("  ");
    _builder.append("intProp = 42");
    _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)

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