1 24 package org.riotfamily.pages; 25 26 import java.io.Serializable ; 27 import java.util.Locale ; 28 29 30 38 public class PageLocation implements Serializable { 39 40 private String siteName; 41 42 private String path; 43 44 private Locale locale; 45 46 public PageLocation() { 47 } 48 49 public PageLocation(String siteName, String path, Locale locale) { 50 this.siteName = siteName; 51 this.path = path; 52 this.locale = locale; 53 } 54 55 public PageLocation(Page page) { 56 this.siteName = page.getNode().getSite().getName(); 57 this.path = page.getPath(); 58 this.locale = page.getLocale(); 59 } 60 61 public String getSiteName() { 62 return this.siteName; 63 } 64 65 public void setSiteName(String siteName) { 66 this.siteName = siteName; 67 } 68 69 public Locale getLocale() { 70 return this.locale; 71 } 72 73 public void setLocale(Locale locale) { 74 this.locale = locale; 75 } 76 77 public String getPath() { 78 return this.path; 79 } 80 81 public void setPath(String path) { 82 this.path = path; 83 } 84 85 public String toString() { 86 return siteName + ":" + locale + ":" + path; 87 } 88 89 public boolean equals(Object obj) { 90 if (obj instanceof PageLocation) { 91 return toString().equals(obj.toString()); 92 } 93 return false; 94 } 95 96 public int hashCode() { 97 return toString().hashCode(); 98 } 99 100 } 101 | Popular Tags |