1 package com.dotmarketing.portlets.languagesmanager.model; 2 3 import java.io.Serializable ; 4 5 import org.apache.commons.lang.builder.EqualsBuilder; 6 import org.apache.commons.lang.builder.HashCodeBuilder; 7 8 9 13 public class Language implements Serializable { 14 private static final long serialVersionUID = 1L; 15 16 17 private long id; 18 19 20 private String languageCode; 21 22 23 private String countryCode; 24 25 26 private String language; 27 28 29 private String country; 30 31 37 public Language(long id, String languageCode, String countryCode, String language, String country) { 38 super(); 39 this.id = id; 40 this.languageCode = languageCode; 41 this.countryCode = countryCode; 42 this.language = language; 43 this.country = country; 44 } 45 46 public Language() { 47 super(); 48 this.id = 0; 49 this.languageCode = ""; 50 this.countryCode = ""; 51 this.language = ""; 52 this.country = ""; 53 } 54 55 public Language(long id) { 56 super(); 57 this.id = id; 58 this.languageCode = ""; 59 this.countryCode = ""; 60 this.language = ""; 61 this.country = ""; 62 } 63 64 67 public static long getSerialVersionUID() { 68 return serialVersionUID; 69 } 70 71 74 public String getCountry() { 75 return country; 76 } 77 78 81 public void setCountry(String country) { 82 this.country = country; 83 } 84 85 88 public String getCountryCode() { 89 return countryCode; 90 } 91 92 95 public void setCountryCode(String countryCode) { 96 if (countryCode != null) { 97 this.countryCode = countryCode.toUpperCase(); 98 } else { 99 this.countryCode = countryCode; 100 } 101 } 102 103 106 public String getLanguage() { 107 return language; 108 } 109 110 113 public void setLanguage(String language) { 114 this.language = language; 115 } 116 117 120 public String getLanguageCode() { 121 return languageCode; 122 } 123 124 127 public void setLanguageCode(String languageCode) { 128 if (languageCode != null) { 129 this.languageCode = languageCode.toLowerCase(); 130 } else { 131 this.languageCode = languageCode; 132 } 133 134 } 135 136 public int hashCode() { 137 return new HashCodeBuilder().append(id).toHashCode(); 138 } 139 140 143 public long getId() { 144 return id; 145 } 146 147 150 public void setId(long id) { 151 this.id = id; 152 } 153 154 public boolean equals(Object other) { 155 if (!(other instanceof Language)) { 156 return false; 157 } 158 159 Language castOther = (Language) other; 160 161 return new EqualsBuilder().append(this.id, castOther.id).isEquals(); 162 } 163 } 164 | Popular Tags |