1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.data.osm.history;
|
---|
3 |
|
---|
4 | import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
|
---|
5 | import org.openstreetmap.josm.tools.CheckParameterUtil;
|
---|
6 |
|
---|
7 | /**
|
---|
8 | * Represents a relation member in the context of a historical view on
|
---|
9 | * OSM data.
|
---|
10 | *
|
---|
11 | */
|
---|
12 | public class RelationMember {
|
---|
13 |
|
---|
14 | private String role;
|
---|
15 | private OsmPrimitiveType primitiveType;
|
---|
16 | private long primitiveId;
|
---|
17 |
|
---|
18 | /**
|
---|
19 | *
|
---|
20 | * @param role the role
|
---|
21 | * @param primitiveType the type (must not be null)
|
---|
22 | * @param primitiveId the id
|
---|
23 | *
|
---|
24 | * @exception IllegalArgumentException thrown, if primitiveType is null
|
---|
25 | */
|
---|
26 | public RelationMember(String role, OsmPrimitiveType primitiveType, long primitiveId) {
|
---|
27 | this.role = (role == null ? "" : role);
|
---|
28 | CheckParameterUtil.ensureParameterNotNull(primitiveType, "primitiveType");
|
---|
29 | this.primitiveType = primitiveType;
|
---|
30 | this.primitiveId = primitiveId;
|
---|
31 | }
|
---|
32 |
|
---|
33 | /**
|
---|
34 | * replies the member role
|
---|
35 | * @return the member role
|
---|
36 | */
|
---|
37 | public String getRole() {
|
---|
38 | return role;
|
---|
39 | }
|
---|
40 |
|
---|
41 | /**
|
---|
42 | * replies the type of the referenced OSM primitive
|
---|
43 | *
|
---|
44 | * @return the type of the referenced OSM primitive
|
---|
45 | */
|
---|
46 | public OsmPrimitiveType getPrimitiveType() {
|
---|
47 | return primitiveType;
|
---|
48 | }
|
---|
49 |
|
---|
50 | /**
|
---|
51 | * replies the id of the referenced OSM primitive
|
---|
52 | *
|
---|
53 | * @return the id of the referenced OSM primitive
|
---|
54 | */
|
---|
55 | public long getPrimitiveId() {
|
---|
56 | return primitiveId;
|
---|
57 | }
|
---|
58 | }
|
---|