In my Java project I have a class where I declare many project constants using public static final String attributes:
public class Constants {
public static final String KIND_NAME = "user";
public static final String AVATAR_IMAGE_ID = "avatarImageId";
public static final String AVATAR_IMAGE_URL = "avatarImageUrl";
public static final String NAME_COLUMN = "name";
public static final String TOTAL_SCORE_COLUMN = "totalScore";
...
}
So I can use this in many different places in my project:
...
String userName = user.getProperty(Constants.KIND_NAME);
...
So far I have found some different ways to implement this in Kotlin, like: companion objects or data class. What is the best equivalent code in Kotlin?