Skip to content

enable interfaces for equals and toString #8

Description

@almondtools

Generic Interfaces could be helpful, that allow alternative toString() behavior, e.g.

interface Printable {
  A getA();
  B getB();
  @ToString
  default String display() {
   return getA() + ":" + getB();
  }
}

assertThat(xray(obj).to(Printable.class).toString(), equalTo("<A.toString()>:<B.toString()>"))

Similar for equals(Object) behavior.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions