In java having a class which defines a few constants, some are in the inner class.
They could be referred as:
Data.HTTP_SCHEME;
Data.Constants.ResponseType.XML;
Data.PayloadType.JSON
How to do the same in Kotlin?
public class Data {
public static final String HTTP_SCHEME = "http";
public static final String HTTPS_SCHEME = "https";
public static class Constants {
public static class ResponseType {
public static final String XML = "xml";
public static final String JSON = "json";
}
public static class PayloadType {
public static final String JSON = "json";
}
public static class ItemDataType {
public static final String ID = "id";
public static final String IS_GLOBAL = "isGlobal";
public static final String IS_TRANSLATED = "isTranslated”;
}
}
}