Return interface instead of data class?

I created a class that has a method that returns a data class. Inside of the class, it is more convenient if I can edit the fields of the data class, but I do not want the user of the method to edit those fields of the data class. In that case, is using an interface of a data class a good way? Like so:

interface IDogFood { val name:String; val amount:Int; } data class DogFood(override var name:String, override var amount:Int):IDogFood; class DogFoodFactory { private fun buyFromOem(): DogFood { return DogFood("Econo-Save budget food", 100) } private fun addOurLabel(food: DogFood) { food.name = "Premium food"; } fun sell(bonus: Int): IDogFood { val food = buyFromOem(); addOurLabel(food); food.amount += bonus; return food; } } 

submitted by /u/evolution2015
[link] [comments]