-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIAtom.java
More file actions
159 lines (132 loc) · 4.42 KB
/
IAtom.java
File metadata and controls
159 lines (132 loc) · 4.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
/* Copyright (c) 2008 Google Inc.
*
* 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.google.gdata.data;
import com.google.gdata.client.Service;
import java.util.List;
import java.util.Set;
import javax.annotation.Nullable;
/**
* Base interface for Atom resource types. Contains a common set of methods
* across both entries and feeds and a can also be used as a parameter type in
* contexts where either a feed or an entry is acceptable.
*
* @see IEntry
* @see IFeed
*/
public interface IAtom {
/**
* Returns the list of all authors on this resource.
*/
public List<? extends IPerson> getAuthors();
/**
* Returns a set of categories on this resource.
*/
public Set<? extends ICategory> getCategories();
/**
* Get the unique id for this resource. Represents the atom:id element.
*/
public String getId();
/**
* Sets the unique id for this resource.
*/
public void setId(String id);
/**
* Get a {@link DateTime} instance representing the last time this resource
* was updated. Represents the atom:updated element.
*/
public DateTime getUpdated();
/**
* Sets the last time this resource was updated.
*/
public void setUpdated(DateTime updated);
/**
* Returns a list of atom:link elements on this resource. If there are no
* links, an empty list will be returned.
*/
public List<? extends ILink> getLinks();
/**
* Returns a particular atom:link element with the given rel and type, or null
* if one was not found.
*/
public ILink getLink(String rel, String type);
/**
* Adds a link with the given rel, type, and href.
*/
public ILink addLink(String rel, String type, String href);
/**
* Remove all links that match the given {@code rel} and {@code type} values.
*
* @param relToMatch {@code rel} value to match or {@code null} to match any
* {@code rel} value.
* @param typeToMatch {@code type} value to match or {@code null} to match any
* {@code type} value.
*/
public void removeLinks(String relToMatch, String typeToMatch);
/**
* Removes all links from the this resource.
*/
public void removeLinks();
/**
* Returns the self link for the resource.
*/
public ILink getSelfLink();
/**
* Returns the atom:title element of this resource.
*/
public ITextConstruct getTitle();
/**
* Gets the value of the gd:etag attribute for this resource.
*
* See RFC 2616, Section 3.11.
*/
public String getEtag();
/**
* Sets the value of the gd:etag attribute for this resource.
*/
public void setEtag(String etag);
/**
* Returns the value of the gd:kind attribute for this resource. Returns
* {@code null} if the kind attribute is missing.
*/
public String getKind();
/**
* Sets the value of the gd:kind attribute for this resource. A value of
* {@code null} will remove the kind attribute.
*/
public void setKind(String kind);
/**
* Version ID. This is a unique number representing this particular
* resource. Every update changes the version ID (unless the update
* doesn't modify anything, in which case it's permissible for
* version ID to stay the same). Services are free to interpret this
* string in the most convenient way. Some services may choose to use
* a monotonically increasing sequence of version IDs. Other services
* may compute a hash of entry properties or feed content and use that.
* <p>
* This property is only used for services to communicate the current
* version ID back to the servlet. It is NOT set when resources are
* parsed (either from requests or from arbitrary XML).
*/
public String getVersionId();
/**
* Sets the versionId. See {@link #getVersionId()} for a description of what
* the versionId is used for.
*/
public void setVersionId(String versionId);
/**
* Sets the service that this resource is being used with.
*/
public void setService(Service s);
}