PageRenderTime 24ms CodeModel.GetById 17ms app.highlight 4ms RepoModel.GetById 0ms app.codeStats 1ms

/jo4neoblog/src/main/java/example/model/Tag.java

http://jo4neo.googlecode.com/
Java | 38 lines | 25 code | 13 blank | 0 comment | 3 complexity | 490c70bdcd1a083a4c4d5746643264cc MD5 | raw file
 1package example.model;
 2
 3import java.util.Collection;
 4
 5import jo4neo.neo;
 6
 7public class Tag extends NeoBean<Tag> {
 8	
 9	@neo(inverse="hasTag") public Collection<Post> posts;
10	@neo(index=true) public String name;
11
12	public Tag() {}
13	
14	public Tag(String name) {
15		this.name = name;
16	}
17
18	public String getName() {
19		return name;
20	}
21	
22	public void setName(String s) {
23		name = s;
24	}
25	
26	public Collection<Post> getPosts() {
27		return posts;
28	}
29	
30
31	
32	public boolean equals(Object o) {
33		if (! (o instanceof Tag)) return false;
34		if (this == o) return true;
35		return (name.equals(((Tag)o).name));
36	}
37
38}