View Javadoc
1   /*
2    * Copyright (C) 2003-2014 eXo Platform SAS.
3    *
4    * This program is free software: you can redistribute it and/or modify
5    * it under the terms of the GNU Affero General Public License as published by
6    * the Free Software Foundation, either version 3 of the License, or
7    * (at your option) any later version.
8    *
9    * This program is distributed in the hope that it will be useful,
10   * but WITHOUT ANY WARRANTY; without even the implied warranty of
11   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12   * GNU Affero General Public License for more details.
13   *
14   * You should have received a copy of the GNU Affero General Public License
15   * along with this program. If not, see <http://www.gnu.org/licenses/>.
16   */
17  
18  package org.exoplatform.calendar.ws.common;
19  
20  import java.io.Serializable;
21  
22  import org.json.JSONObject;
23  
24  public abstract class Resource implements Serializable {
25  
26    private static final long serialVersionUID = 3422763517401399776L;
27    private String id;
28    private String href;
29    
30    public Resource(String id) {
31      this.id = id;
32    }
33  
34    public String getId(){
35  		return id;
36  	}
37  
38    public void setId(String id) {
39      this.id = id;
40    }
41  
42    public String getHref() {
43      return href;
44    }
45  
46    public void setHref(String href) {
47      this.href = href;
48    }
49    
50    @Override
51    public String toString() {
52      return new JSONObject(this).toString();
53    }
54  }