【发布时间】:2018-09-15 10:17:38
【问题描述】:
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)
但是将属性的文档放在哪里?
【问题讨论】: