@Test @SuppressWarnings("PMD.AvoidDuplicateLiterals") public void secondaryConstructorTest() { MatcherAssert.assertThat( new ObjectBody( new StickyList<>(), new StickyList<>( new Ctor( new StickyList<>( new Parameter("title", "Text") ), new StickyList<>( new Argument.Fake("0"), new Argument.Fake("title") ) ) ), new StickyList<>() ).java("book"), Matchers.stringContainsInOrder( new StickyList<>( "public book(final Text title)", "{", "this(0, title);", "}" ) ) ); }
@SuppressWarnings("PMD.AvoidDuplicateLiterals") public String java(final String name) { return new UncheckedText( new JoinedText( "\n", new UncheckedText( new JoinedText( "\n", new Mapped<>( attr -> attr.java(ObjectBody.FIELD_FORMAT), this.attrs ) ) ).asString(), new UncheckedText( new JoinedText( "\n", new Mapped<>(ctor -> ctor.java(name), this.ctors) ) ).asString(), new PrimaryConstructor(name, this.attrs).code(), new UncheckedText( new JoinedText( "\n", new Mapped<>(MethodImpl::java, this.methods) ) ).asString() ) ).asString(); }
ObjectBody { @SuppressWarnings("PMD.AvoidDuplicateLiterals") public String java(final String name) { return new UncheckedText( new JoinedText( "\n", new UncheckedText( new JoinedText( "\n", new Mapped<>( attr -> attr.java(ObjectBody.FIELD_FORMAT), this.attrs ) ) ).asString(), new UncheckedText( new JoinedText( "\n", new Mapped<>(ctor -> ctor.java(name), this.ctors) ) ).asString(), new PrimaryConstructor(name, this.attrs).code(), new UncheckedText( new JoinedText( "\n", new Mapped<>(MethodImpl::java, this.methods) ) ).asString() ) ).asString(); } }
ObjectBody { @SuppressWarnings("PMD.AvoidDuplicateLiterals") public String java(final String name) { return new UncheckedText( new JoinedText( "\n", new UncheckedText( new JoinedText( "\n", new Mapped<>( attr -> attr.java(ObjectBody.FIELD_FORMAT), this.attrs ) ) ).asString(), new UncheckedText( new JoinedText( "\n", new Mapped<>(ctor -> ctor.java(name), this.ctors) ) ).asString(), new PrimaryConstructor(name, this.attrs).code(), new UncheckedText( new JoinedText( "\n", new Mapped<>(MethodImpl::java, this.methods) ) ).asString() ) ).asString(); } ObjectBody(
        final Collection<Attribute> attrs,
        final Collection<Ctor> ctors,
        final Collection<MethodImpl> methods
    ); }
ObjectBody { @SuppressWarnings("PMD.AvoidDuplicateLiterals") public String java(final String name) { return new UncheckedText( new JoinedText( "\n", new UncheckedText( new JoinedText( "\n", new Mapped<>( attr -> attr.java(ObjectBody.FIELD_FORMAT), this.attrs ) ) ).asString(), new UncheckedText( new JoinedText( "\n", new Mapped<>(ctor -> ctor.java(name), this.ctors) ) ).asString(), new PrimaryConstructor(name, this.attrs).code(), new UncheckedText( new JoinedText( "\n", new Mapped<>(MethodImpl::java, this.methods) ) ).asString() ) ).asString(); } ObjectBody(
        final Collection<Attribute> attrs,
        final Collection<Ctor> ctors,
        final Collection<MethodImpl> methods
    ); @SuppressWarnings("PMD.AvoidDuplicateLiterals") String java(final String name); Iterable<Directive> xml(); }
ObjectBody { @SuppressWarnings("PMD.AvoidDuplicateLiterals") public String java(final String name) { return new UncheckedText( new JoinedText( "\n", new UncheckedText( new JoinedText( "\n", new Mapped<>( attr -> attr.java(ObjectBody.FIELD_FORMAT), this.attrs ) ) ).asString(), new UncheckedText( new JoinedText( "\n", new Mapped<>(ctor -> ctor.java(name), this.ctors) ) ).asString(), new PrimaryConstructor(name, this.attrs).code(), new UncheckedText( new JoinedText( "\n", new Mapped<>(MethodImpl::java, this.methods) ) ).asString() ) ).asString(); } ObjectBody(
        final Collection<Attribute> attrs,
        final Collection<Ctor> ctors,
        final Collection<MethodImpl> methods
    ); @SuppressWarnings("PMD.AvoidDuplicateLiterals") String java(final String name); Iterable<Directive> xml();  }