Skip to content

Object contract methods implementation

Choose a tag to compare

@bivashy bivashy released this 19 Nov 14:01
· 15 commits to main since this release
1ec021a

Added:

  • toString(), equals(Object), hashCode() method implementation
  • @Style annotation for defining names fofr custom toString(), equals(Object), hashCode() methods
    Changes:
  • From ProxyMethodInvoker#invoke(Object, Method, Object[], Object) to ProxyMethodInvoker#invoke(Object, Method, Object[], Map<String, Object>)
  • All printStackTrace() occurrence replaced by throw new RuntimeException()
    Code example:
    Before:
@ConfigInterface
public interface Human {
    String name();
}
public class Main {
   public void print(Human human) {
     if (human != null)
       System.out.println(human); // null
   }
}

After:

@ConfigInterface
public interface Human {
    String name();
}
public class Main {
   public void print(Human human) {
     if (human != null)
       System.out.println(human); // [interface com.some.package.Human]{name="Alex"}
   }
}