Permalink
Browse files

Refactor code to have the simplest model classes

  • Loading branch information...
1 parent a8ffa63 commit ed6f68eb1da0ac4feaae484baa55aee442d0b301 @jblemee jblemee committed Jun 3, 2012
@@ -1,8 +1,12 @@
package com.lateralthoughts.banner.model;
+import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
+import static javax.xml.bind.annotation.XmlAccessType.*;
+
@XmlRootElement(name = "links")
+@XmlAccessorType(FIELD)
public class BannerLink {
private String label;
private String url;
@@ -20,14 +24,5 @@ public String getUrl() {
return url;
}
- /** protected methods are for Jaxb and Jersey purpose **/
- public void setLabel(String label) {
- this.label = label;
- }
-
- public void setUrl(String url) {
- this.url = url;
- }
-
protected BannerLink(){}
}
@@ -1,36 +1,31 @@
package com.lateralthoughts.banner.model;
+import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
+import static javax.xml.bind.annotation.XmlAccessType.*;
+
/**
* @author Jean-Baptiste Lemée
*/
@XmlRootElement
+@XmlAccessorType(FIELD)
public class Brand {
-
- private BannerLink link;
+ private String label;
+ private String url;
public Brand(String label, String url) {
- this.link = new BannerLink(label, url);
+ this.label = label;
+ this.url = url;
}
public String getLabel() {
- return link.getLabel();
+ return label;
}
public String getUrl() {
- return link.getUrl();
- }
-
- /** protected methods are for Jaxb and Jersey purpose **/
- public void setLabel(String label) {
- this.link.setLabel(label);
- }
-
- public void setUrl(String url) {
- this.link.setUrl(url);
+ return url;
}
protected Brand(){}
-
}

0 comments on commit ed6f68e

Please sign in to comment.