/*
 *   Copyright (C) 2016 Karumi.
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 */

package com.karumi.todoapiclient.dto;


public class TaskDto {

  private final String id;
  private final String userId;
  private final String title;
  private final boolean finished;

  public TaskDto(String id, String userId, String title, boolean finished) {
    this.id = id;
    this.userId = userId;
    this.title = title;
    this.finished = finished;
  }

  public String getId() {
    return id;
  }

  public String getUserId() {
    return userId;
  }

  public String getTitle() {
    return title;
  }

  public boolean isFinished() {
    return finished;
  }
}

/*
 *   Copyright (C) 2016 Karumi.
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 */

package com.karumi.todoapiclient.dto;

import com.google.gson.annotations.SerializedName;

public class TaskDto {

  @SerializedName("id") private final String id;
  @SerializedName("userId") private final String userId;
  @SerializedName("title") private final String title;
  @SerializedName("finished") private final boolean finished;

  public TaskDto(String id, String userId, String title, boolean finished) {
    this.id = id;
    this.userId = userId;
    this.title = title;
    this.finished = finished;
  }

  public String getId() {
    return id;
  }

  public String getUserId() {
    return userId;
  }

  public String getTitle() {
    return title;
  }

  public boolean isFinished() {
    return finished;
  }
}

Add json parsing to the TaskDto class using gson