Find the correct mapping class

Report a typo

Here is the JSON :

{
  "id" : "1112hjkh3481soa7",
  "destination" : "London",
  "seat" : 143,
  "withLunch" : true
}

Choose the correct mapping class of the following:

1

Java
public class TicketInfo {

    public String id;
    public String destination;
    public int seat;
    public boolean withLunch;

    TicketInfo() {}

    //setters and getters
}
Kotlin
class TicketInfo constructor() {
    var id: String? = null
    var destination: String? = null
    var seat: Int? = null
    var withLunch: Boolean? = null
}

2

Java
public class TicketInfo {

    public String id;
    public String destination;
    public int seat;
    public boolean lunchEnabled;

    TicketInfo() {}

    //setters
}
Kotlin
class TicketInfo constructor() {
    private var id: String? = null
    private var destination: String? = null
    private var seat: Int? = null
    private var lunchEnabled: Boolean? = null
    //setters
}

3

Java
public class TicketInfo {

    public String id;
    public String destination;
    public int seat;
    public boolean withLunch;

    TicketInfo() {}

    //getters
}
Kotlin
class TicketInfo constructor() {
    private var id: String? = null
    private var destination: String? = null
    private var seat: Int? = null
    private var withLunch: Boolean? = null
    //getters
}

4

Java
public class TicketInfo {

    public String id;
    public String destination;
    public int seat;
    public boolean withLunch;

    TicketInfo() {}

    public String getId() 
}
Kotlin
class TicketInfo constructor() {
    private var id: String? = null
    private var destination: String? = null
    private var seat: Int? = null
    private var withLunch: Boolean? = null
    fun getId(): String? { ... }
}
Select one option from the list
___

Create a free account to access the full topic