tipsy / j2html

Java to HTML generator. Enjoy typesafe HTML generation.

Home Page:https://j2html.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

change Method signature

chmuche opened this issue · comments

In the class Tag
change
public T attr(String attribute, String value)
to
public T attr(String attribute, Object value)
And the body of the method

setAttribute(attribute, value);
        return (T) this;

to

setAttribute(attribute,value == null ? null : value.toString());
        return (T) this;

The impact is minor but in that way we can write
myTag.attr("attribute", 6)

#58

commented

1.2.0 (which includes this change) is available now

<dependency>
    <groupId>com.j2html</groupId>
    <artifactId>j2html</artifactId>
    <version>1.2.0</version>
</dependency>