View Javadoc
1   package info.ejava.examples.jaxrs.todos.dto;
2   
3   import java.io.Serializable;
4   
5   import javax.xml.bind.annotation.XmlRootElement;
6   
7   @XmlRootElement(name="todoItem", namespace="urn:ejava.jaxrs.todos")
8   public class TodoItemDTO implements Serializable {
9       private static final long serialVersionUID = 1L;
10      private String name;
11      private Integer priority;
12      
13      public TodoItemDTO() {}
14      public TodoItemDTO(String name) {
15          this.name = name;
16      }
17      
18      public String getName() {
19          return name;
20      }
21      public void setName(String name) {
22          this.name = name;
23      }
24  
25      public Integer getPriority() {
26          return priority;
27      }
28      public void setPriority(Integer priority) {
29          this.priority = priority;
30      }
31      
32      @Override
33      public String toString() {
34          StringBuilder builder = new StringBuilder();
35          builder.append("Todo[name=").append(name)
36                  .append(", priority=").append(priority)
37                 .append("]");
38          return builder.toString();
39      }
40  }