# Custom getter/setter for properties created by type params

**URL:** <https://discuss.kotlinlang.org/t/custom-getter-setter-for-properties-created-by-type-params/46>\
**Category:** Uncategorized\
**Created:** [November 5, 2015, 3:10pm UTC](https://discuss.kotlinlang.org/t/custom-getter-setter-for-properties-created-by-type-params/46 "2015-11-05T15:10:27Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![mikrobi](https://avatars.discourse-cdn.com/v4/letter/m/f04885/32.png) [@mikrobi](https://discuss.kotlinlang.org/u/mikrobi)\
**Post date:** [April 20, 2016, 2:22pm UTC](https://discuss.kotlinlang.org/t/custom-getter-setter-for-properties-created-by-type-params/46/4 "2016-04-20T14:22:34Z")

</div>

How can we deal with this when working with data classes?

For data classes all primary constructor parameters need to be marked as `val` or `var`. So when I want to have a special setter for one of my (required/non-optional) data class properties, I have to implement `equals()`, `hashCode()` `toString()` etc. on my own or is there another cool way?

---

_[View the full topic](https://discuss.kotlinlang.org/t/custom-getter-setter-for-properties-created-by-type-params/46)._
