Skip to content

Commit ae223dd

Browse files
committed
Model of application
1 parent 4f392c5 commit ae223dd

File tree

10 files changed

+466
-0
lines changed

10 files changed

+466
-0
lines changed

.idea/ant.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

my-maps-model/pom.xml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<parent>
6+
<artifactId>my-maps</artifactId>
7+
<groupId>my-maps</groupId>
8+
<version>1.0-SNAPSHOT</version>
9+
</parent>
10+
<modelVersion>4.0.0</modelVersion>
11+
12+
<artifactId>my-maps-model</artifactId>
13+
<dependencies>
14+
<dependency>
15+
<groupId>javax.validation</groupId>
16+
<artifactId>validation-api</artifactId>
17+
<version>1.0.0.GA</version>
18+
</dependency>
19+
</dependencies>
20+
21+
22+
</project>
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
package cz.muni.fi.pv243.mymaps.model;
2+
3+
import javax.validation.Valid;
4+
import javax.validation.constraints.NotNull;
5+
6+
/**
7+
* Created with IntelliJ IDEA.
8+
* User: andrej
9+
* Date: 4/24/13
10+
* Time: 6:04 PM
11+
* To change this template use File | Settings | File Templates.
12+
*/
13+
public class MapPermission {
14+
15+
@NotNull
16+
@Valid
17+
private User user;
18+
19+
@NotNull
20+
@Valid
21+
private MyMap map;
22+
23+
@NotNull
24+
private Permission permission;
25+
26+
27+
public User getUser() {
28+
return user;
29+
}
30+
31+
public void setUser(User user) {
32+
this.user = user;
33+
}
34+
35+
public MyMap getMap() {
36+
return map;
37+
}
38+
39+
public void setMap(MyMap map) {
40+
this.map = map;
41+
}
42+
43+
public Permission getPermission() {
44+
return permission;
45+
}
46+
47+
public void setPermission(Permission permission) {
48+
this.permission = permission;
49+
}
50+
}
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
package cz.muni.fi.pv243.mymaps.model;
2+
3+
import javax.validation.Valid;
4+
import javax.validation.constraints.NotNull;
5+
import javax.validation.constraints.Size;
6+
7+
import java.util.Collection;
8+
import java.util.Date;
9+
10+
11+
public class MyMap {
12+
13+
private Long id;
14+
15+
@NotNull
16+
@Size(min = 1)
17+
private String name;
18+
19+
private Collection<PointOfInterest> pointsOfInterest;
20+
21+
@NotNull
22+
@Valid
23+
private View view;
24+
25+
@NotNull
26+
private Date creationDate;
27+
28+
@NotNull
29+
@Valid
30+
private User creator;
31+
32+
public Long getId() {
33+
return id;
34+
}
35+
36+
public void setId(Long id) {
37+
this.id = id;
38+
}
39+
40+
public String getName() {
41+
return name;
42+
}
43+
44+
public void setName(String name) {
45+
this.name = name;
46+
}
47+
48+
public Collection<PointOfInterest> getPointsOfInterest() {
49+
return pointsOfInterest;
50+
}
51+
52+
public void setPointsOfInterest(Collection<PointOfInterest> pointsOfInterest) {
53+
this.pointsOfInterest = pointsOfInterest;
54+
}
55+
56+
public View getView() {
57+
return view;
58+
}
59+
60+
public void setView(View view) {
61+
this.view = view;
62+
}
63+
64+
public Date getCreationDate() {
65+
return creationDate;
66+
}
67+
68+
public void setCreationDate(Date creationDate) {
69+
this.creationDate = creationDate;
70+
}
71+
72+
public User getCreator() {
73+
return creator;
74+
}
75+
76+
public void setCreator(User creator) {
77+
this.creator = creator;
78+
}
79+
80+
@Override
81+
public boolean equals(Object o) {
82+
if (this == o) return true;
83+
if (o == null || getClass() != o.getClass()) return false;
84+
85+
MyMap myMap = (MyMap) o;
86+
87+
if (id != null ? !id.equals(myMap.id) : myMap.id != null) return false;
88+
89+
return true;
90+
}
91+
92+
@Override
93+
public int hashCode() {
94+
return id != null ? id.hashCode() : 0;
95+
}
96+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package cz.muni.fi.pv243.mymaps.model;
2+
3+
public enum Permission {
4+
READ, WRITE
5+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package cz.muni.fi.pv243.mymaps.model;
2+
3+
4+
import javax.validation.constraints.DecimalMax;
5+
import javax.validation.constraints.DecimalMin;
6+
import java.math.BigDecimal;
7+
8+
public class Point {
9+
10+
@DecimalMin("-90.0")
11+
@DecimalMax("90.0")
12+
private BigDecimal latitude;
13+
14+
@DecimalMin("-180.0")
15+
@DecimalMax("180.0")
16+
private BigDecimal longitude;
17+
18+
public BigDecimal getLatitude() {
19+
return latitude;
20+
}
21+
22+
public void setLatitude(BigDecimal latitude) {
23+
this.latitude = latitude;
24+
}
25+
26+
public BigDecimal getLongitude() {
27+
return longitude;
28+
}
29+
30+
public void setLongitude(BigDecimal longitude) {
31+
this.longitude = longitude;
32+
}
33+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
package cz.muni.fi.pv243.mymaps.model;
2+
3+
4+
public class PointOfInterest {
5+
6+
private Long id;
7+
8+
private Point point;
9+
10+
private String description;
11+
12+
private String iconPath;
13+
14+
public Long getId() {
15+
return id;
16+
}
17+
18+
public Point getPoint() {
19+
return point;
20+
}
21+
22+
public void setPoint(Point point) {
23+
this.point = point;
24+
}
25+
26+
public void setId(Long id) {
27+
this.id = id;
28+
}
29+
30+
31+
public String getDescription() {
32+
return description;
33+
}
34+
35+
public void setDescription(String description) {
36+
this.description = description;
37+
}
38+
39+
public String getIconPath() {
40+
return iconPath;
41+
}
42+
43+
public void setIconPath(String iconPath) {
44+
this.iconPath = iconPath;
45+
}
46+
47+
@Override
48+
public boolean equals(Object o) {
49+
if (this == o) return true;
50+
if (o == null || getClass() != o.getClass()) return false;
51+
52+
PointOfInterest that = (PointOfInterest) o;
53+
54+
if (id != null ? !id.equals(that.id) : that.id != null) return false;
55+
56+
return true;
57+
}
58+
59+
@Override
60+
public int hashCode() {
61+
return id != null ? id.hashCode() : 0;
62+
}
63+
}
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
package cz.muni.fi.pv243.mymaps.model;
2+
3+
import javax.validation.constraints.NotNull;
4+
import javax.validation.constraints.Size;
5+
import java.util.Collection;
6+
7+
public class User {
8+
9+
private Long id;
10+
11+
Collection<View> views;
12+
13+
@NotNull
14+
@Size(min = 1)
15+
private String name;
16+
17+
@NotNull
18+
@Size (min = 1)
19+
private String nick;
20+
21+
@NotNull
22+
@Size (min = 1)
23+
private String password;
24+
25+
private String role;
26+
27+
public Collection<View> getViews() {
28+
return views;
29+
}
30+
31+
public void setViews(Collection<View> views) {
32+
this.views = views;
33+
}
34+
35+
public Long getId() {
36+
return id;
37+
}
38+
39+
public void setId(Long id) {
40+
this.id = id;
41+
}
42+
43+
public String getName() {
44+
return name;
45+
}
46+
47+
public void setName(String name) {
48+
this.name = name;
49+
}
50+
51+
public String getNick() {
52+
return nick;
53+
}
54+
55+
public void setNick(String nick) {
56+
this.nick = nick;
57+
}
58+
59+
public String getPassword() {
60+
return password;
61+
}
62+
63+
public void setPassword(String password) {
64+
this.password = password;
65+
}
66+
67+
public String getRole() {
68+
return role;
69+
}
70+
71+
public void setRole(String role) {
72+
this.role = role;
73+
}
74+
75+
@Override
76+
public boolean equals(Object o) {
77+
if (this == o) return true;
78+
if (o == null || getClass() != o.getClass()) return false;
79+
80+
User user = (User) o;
81+
82+
if (id != null ? !id.equals(user.id) : user.id != null) return false;
83+
84+
return true;
85+
}
86+
87+
@Override
88+
public int hashCode() {
89+
return id != null ? id.hashCode() : 0;
90+
}
91+
}

0 commit comments

Comments
 (0)