Reputation: 2100
When I right click and select Generate, I only see Delegate methods and Test. Am I missing something in my installation?
class Person(val firstName : String){}
val person = new Person("Srinivas")
In the same project, I created a java class and everything works fine. Definitely IntelliJ is missing something for Scala. Any help in troubleshooting will be appreciated.
Edit: I figured it works fine in a Scala class (can see all options for creating a hashcode and equals method), but does not work in a worksheet.
Upvotes: 2
Views: 786
Reputation: 2397
However, in your case, it's preferred to convert this class to case class, so you don't need to generate equals or hashcode - it's all built-in.
case class Person(firstName: String)
val person = Person("Srinivas")
Upvotes: 4