79113627

Date: 2024-10-22 10:41:49
Score: 1
Natty:
Report link

Use @ConstructorProperties from Java 8 beans module:

import java.beans.ConstructorProperties;

@ConstructorProperties({"prop1","prop2"})
public CustomClass(String prop1, String prop2) {
  this.prop1 = prop1;
  this.prop2 = prop2;
}
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: arServ