1 package org.andromda.taglibs.breadcrumbs;
2
3 import java.io.Serializable;
4
5
6
7
8 public class BreadCrumb implements Serializable
9 {
10 private static final long serialVersionUID = 34L;
11 private String url = null;
12 private String value = null;
13
14
15
16
17
18 public BreadCrumb(String urlIn, String valueIn)
19 {
20 this.url = urlIn;
21 this.value = valueIn;
22 }
23
24
25
26
27 public String getUrl()
28 {
29 return url;
30 }
31
32
33
34
35 public String getValue()
36 {
37 return value;
38 }
39
40
41
42
43 public void setUrl(String url)
44 {
45 if (url == null)
46 throw new IllegalArgumentException("Error constructing breadcrumb: Breadcrumb URL cannot be null");
47 this.url = url;
48 }
49
50
51
52
53 public void setValue(String value)
54 {
55 if (value == null)
56 throw new IllegalArgumentException("Error constructing breadcrumb: Breadcrumb value cannot be null");
57 this.value = value;
58 }
59
60
61
62
63
64 public boolean hasSimilarProperties(BreadCrumb breadCrumb)
65 {
66 return (breadCrumb == null)
67 ? false
68 : url.equals(breadCrumb.getUrl()) || value.equals(breadCrumb.getValue());
69 }
70 }