content: /*
   * Copyright (c) 2015. Rick Hightower, Geoff Chandler
   *
   * 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.
   *
   * QBit - The Microservice lib for Java : JSON, WebSocket, REST. Be The Web!
   */
  
  package io.advantageous.qbit.service.bundle.example.todo;
  
  import java.util.Date;
  
  /**
   * created by rhightower on 10/24/14.
   */
  public class Todo {
  
      private final String name;
      private final String description;
      private final Date dueDate;
  
      public Todo(String name, String description, Date dueDate) {
          this.name = name;
          this.description = description;
          this.dueDate = dueDate;
      }
  
  
      public String getName() {
          return name;
      }
  
      public String getDescription() {
          return description;
      }
  
      public Date getDueDate() {
          return dueDate;
      }
  
      @Override
      public boolean equals(Object o) {
          if (this == o) return true;
          if (o == null || getClass() != o.getClass()) return false;
  
          Todo todoItem = (Todo) o;
  
          if (description != null ? !description.equals(todoItem.description) : todoItem.description != null)
              return false;
          if (dueDate != null ? !dueDate.equals(todoItem.dueDate) : todoItem.dueDate != null) return false;
          return !(name != null ? !name.equals(todoItem.name) : todoItem.name != null);
  
      }
  
      @Override
      public int hashCode() {
          int result = name != null ? name.hashCode() : 0;
          result = 31 * result + (description != null ? description.hashCode() : 0);
          result = 31 * result + (dueDate != null ? dueDate.hashCode() : 0);
          return result;
      }
  
      @Override
      public String toString() {
          return "TodoItem{" +
                  "name='" + name + '\'' +
                  ", description='" + description + '\'' +
                  ", dueDate=" + dueDate +
                  '}';
      }
  }
  