Hi everyone! Total newbie here, trying out Kotlin....
# announcements
a
Hi everyone! Total newbie here, trying out Kotlin. Was trying to replace one of our simple classes with data class but got stuck: I want a data class, but if first parameter is null to set field to be an empty list, not a null
Copy code
public  ViewportInfo(@Nullable List<String> channelIds, long startTime, long duration) {
        this.channelIds = channelIds != null ? channelIds : new ArrayList<String>();
        this.startTime = startTime;
        this.duration = duration;
    }