Kotlin 数据类中属性的 Javadoc 应该放在哪里?
换句话说,如何在 Kotlin 中编写以下 Java 代码:
/**
* Represents a person.
*/
public class Person {
/**
* First name. -- where to place this documentation in Kotlin?
*/
private final String firstName;
/**
* Last name. -- where to place this documentation in Kotlin?
*/
private final String lastName;
// a lot of boilerplate Java code - getters, equals, hashCode, ...
}
在 Kotlin 中,它看起来像这样:
/**
* Represents a person.
*/
data class Person(val firstName: String, val lastName: String)
但是在哪里放置属性的文档?