groovy の注釈では、と@TupleConstructor
の違いは何ですか。プロパティにはパブリック セッター/ゲッターのみが含まれ、フィールドにはプライベートが含まれますか? これに関するドキュメントは見つかりませんでした。includeFields
includeProperties
1 に答える
4
Groovyフィールドは、ゲッターとセッターのない公共施設です。
@groovy.transform.TupleConstructor(includeFields=false)
class Invoice {
Integer serie, number // properties
BigDecimal total // property
public Integer type // this is a field
}
try {
i = new Invoice(1, 2, 10.0, 10)
assert false
} catch (e) {
assert true
}
于 2013-03-07T20:12:30.357 に答える