nameof icon indicating copy to clipboard operation
nameof copied to clipboard

Java alternative to nameOf operator

Java nameOfProperty implementation

Java alternative to nameOf operator.

license Download

Based on Byte Buddy library.

Inspired by: http://in.relation.to/2016/04/14/emulating-property-literals-with-java-8-method-references/

Examples:

public class NameOfTest {
    @Test
    public void direct() {
        assertEquals("name", $$(Person.class, Person::getName));
    }

    @Test
    public void properties() {
        assertEquals("summary", Person.$(Person::getSummary));
    }
}

If you want to support the project

Buy Me A Coffee