author | František Kučera <franta-hg@frantovo.cz> |
Mon Nov 07 20:31:08 2011 +0100 (2011-11-07) | |
changeset 196 | 27b751390163 |
parent 173 | 2b458ac09044 |
permissions | -rw-r--r-- |
franta-hg@10 | 1 |
package cz.frantovo.nekurak.dto; |
franta-hg@10 | 2 |
|
franta-hg@12 | 3 |
import java.io.Serializable; |
franta-hg@156 | 4 |
import java.net.URL; |
franta-hg@72 | 5 |
import java.util.ArrayList; |
franta-hg@39 | 6 |
import java.util.Date; |
franta-hg@127 | 7 |
import java.util.HashSet; |
franta-hg@72 | 8 |
import java.util.List; |
franta-hg@127 | 9 |
import java.util.Set; |
franta-hg@12 | 10 |
|
franta-hg@10 | 11 |
/** |
franta-hg@50 | 12 |
* Podnik – hospoda, bar, kavárna… |
franta-hg@10 | 13 |
* @author fiki |
franta-hg@10 | 14 |
*/ |
franta-hg@12 | 15 |
public class Podnik implements Serializable { |
franta-hg@10 | 16 |
|
franta-hg@145 | 17 |
private int id; |
franta-hg@145 | 18 |
private String nazev; |
franta-hg@145 | 19 |
private String popis; |
franta-hg@145 | 20 |
private String url; |
franta-hg@145 | 21 |
private String ulice; |
franta-hg@145 | 22 |
private Date datum; |
franta-hg@145 | 23 |
private Integer cisloPopisne; |
franta-hg@145 | 24 |
private String mesto; |
franta-hg@145 | 25 |
private String spravce; |
franta-hg@145 | 26 |
private List<Fotka> fotky = new ArrayList<Fotka>(); |
franta-hg@145 | 27 |
private Set<Komentar> komentare = new HashSet<Komentar>(); |
franta-hg@154 | 28 |
private Set<Kategorie> kategorie = new HashSet<Kategorie>(); |
franta-hg@145 | 29 |
private Double sirka; |
franta-hg@145 | 30 |
private Double delka; |
franta-hg@165 | 31 |
private Kurackost kurackost = new Kurackost(); |
franta-hg@173 | 32 |
private boolean schvaleny = false; |
franta-hg@10 | 33 |
|
franta-hg@145 | 34 |
public Podnik() { |
franta-hg@145 | 35 |
} |
franta-hg@10 | 36 |
|
franta-hg@145 | 37 |
public Podnik(int id, String nazev) { |
franta-hg@145 | 38 |
this.id = id; |
franta-hg@145 | 39 |
this.nazev = nazev; |
franta-hg@145 | 40 |
} |
franta-hg@10 | 41 |
|
franta-hg@145 | 42 |
public int getId() { |
franta-hg@145 | 43 |
return id; |
franta-hg@145 | 44 |
} |
franta-hg@10 | 45 |
|
franta-hg@145 | 46 |
public void setId(int id) { |
franta-hg@145 | 47 |
this.id = id; |
franta-hg@145 | 48 |
} |
franta-hg@10 | 49 |
|
franta-hg@145 | 50 |
public String getNazev() { |
franta-hg@145 | 51 |
return nazev; |
franta-hg@145 | 52 |
} |
franta-hg@10 | 53 |
|
franta-hg@145 | 54 |
public void setNazev(String nazev) { |
franta-hg@145 | 55 |
this.nazev = nazev; |
franta-hg@145 | 56 |
} |
franta-hg@10 | 57 |
|
franta-hg@145 | 58 |
public String getPopis() { |
franta-hg@145 | 59 |
return popis; |
franta-hg@145 | 60 |
} |
franta-hg@39 | 61 |
|
franta-hg@145 | 62 |
public void setPopis(String popis) { |
franta-hg@145 | 63 |
this.popis = popis; |
franta-hg@145 | 64 |
} |
franta-hg@39 | 65 |
|
franta-hg@145 | 66 |
public String getUrl() { |
franta-hg@145 | 67 |
return url; |
franta-hg@145 | 68 |
} |
franta-hg@39 | 69 |
|
franta-hg@145 | 70 |
public void setUrl(String url) { |
franta-hg@145 | 71 |
this.url = url; |
franta-hg@145 | 72 |
} |
franta-hg@39 | 73 |
|
franta-hg@156 | 74 |
/** |
franta-hg@156 | 75 |
* Získá z URL webové stránky podniku doménové jméno převedené na malá písmena. |
franta-hg@186 | 76 |
* Např. z „http://www.Example.COM/index.html“ získá „www.example.com“. |
franta-hg@156 | 77 |
* @return doménové jméno nebo null v případě chyby. |
franta-hg@156 | 78 |
*/ |
franta-hg@156 | 79 |
public String getUrlDomena() { |
franta-hg@156 | 80 |
if (url == null) { |
franta-hg@156 | 81 |
return null; |
franta-hg@156 | 82 |
} else { |
franta-hg@156 | 83 |
try { |
franta-hg@156 | 84 |
URL u = new URL(url); |
franta-hg@156 | 85 |
String domena = u.getHost().toLowerCase(); |
franta-hg@156 | 86 |
if (domena.length() > 0) { |
franta-hg@156 | 87 |
return domena; |
franta-hg@156 | 88 |
} else { |
franta-hg@156 | 89 |
return null; |
franta-hg@156 | 90 |
} |
franta-hg@156 | 91 |
} catch (Exception e) { |
franta-hg@156 | 92 |
return null; |
franta-hg@156 | 93 |
} |
franta-hg@156 | 94 |
} |
franta-hg@156 | 95 |
} |
franta-hg@156 | 96 |
|
franta-hg@145 | 97 |
public String getUlice() { |
franta-hg@145 | 98 |
return ulice; |
franta-hg@145 | 99 |
} |
franta-hg@39 | 100 |
|
franta-hg@145 | 101 |
public void setUlice(String ulice) { |
franta-hg@145 | 102 |
this.ulice = ulice; |
franta-hg@145 | 103 |
} |
franta-hg@39 | 104 |
|
franta-hg@145 | 105 |
public Date getDatum() { |
franta-hg@145 | 106 |
return datum; |
franta-hg@145 | 107 |
} |
franta-hg@39 | 108 |
|
franta-hg@145 | 109 |
public void setDatum(Date datum) { |
franta-hg@145 | 110 |
this.datum = datum; |
franta-hg@145 | 111 |
} |
franta-hg@39 | 112 |
|
franta-hg@145 | 113 |
public int getCisloPopisne() { |
franta-hg@145 | 114 |
return cisloPopisne; |
franta-hg@145 | 115 |
} |
franta-hg@39 | 116 |
|
franta-hg@145 | 117 |
public void setCisloPopisne(int cisloPopisne) { |
franta-hg@145 | 118 |
this.cisloPopisne = cisloPopisne; |
franta-hg@145 | 119 |
} |
franta-hg@39 | 120 |
|
franta-hg@145 | 121 |
public String getMesto() { |
franta-hg@145 | 122 |
return mesto; |
franta-hg@145 | 123 |
} |
franta-hg@39 | 124 |
|
franta-hg@145 | 125 |
public void setMesto(String mesto) { |
franta-hg@145 | 126 |
this.mesto = mesto; |
franta-hg@145 | 127 |
} |
franta-hg@63 | 128 |
|
franta-hg@145 | 129 |
public String getSpravce() { |
franta-hg@145 | 130 |
return spravce; |
franta-hg@145 | 131 |
} |
franta-hg@63 | 132 |
|
franta-hg@145 | 133 |
public void setSpravce(String spravce) { |
franta-hg@145 | 134 |
this.spravce = spravce; |
franta-hg@145 | 135 |
} |
franta-hg@67 | 136 |
|
franta-hg@145 | 137 |
public List<Fotka> getFotky() { |
franta-hg@145 | 138 |
return fotky; |
franta-hg@145 | 139 |
} |
franta-hg@67 | 140 |
|
franta-hg@145 | 141 |
public void setFotky(List<Fotka> fotky) { |
franta-hg@145 | 142 |
this.fotky = fotky; |
franta-hg@145 | 143 |
} |
franta-hg@100 | 144 |
|
franta-hg@145 | 145 |
public Double getSirka() { |
franta-hg@145 | 146 |
return sirka; |
franta-hg@145 | 147 |
} |
franta-hg@100 | 148 |
|
franta-hg@145 | 149 |
public void setSirka(Double sirka) { |
franta-hg@145 | 150 |
this.sirka = sirka; |
franta-hg@145 | 151 |
} |
franta-hg@100 | 152 |
|
franta-hg@145 | 153 |
public Double getDelka() { |
franta-hg@145 | 154 |
return delka; |
franta-hg@145 | 155 |
} |
franta-hg@100 | 156 |
|
franta-hg@145 | 157 |
public void setDelka(Double delka) { |
franta-hg@145 | 158 |
this.delka = delka; |
franta-hg@145 | 159 |
} |
franta-hg@127 | 160 |
|
franta-hg@145 | 161 |
public Set<Komentar> getKomentare() { |
franta-hg@145 | 162 |
return komentare; |
franta-hg@145 | 163 |
} |
franta-hg@127 | 164 |
|
franta-hg@145 | 165 |
public void setKomentare(Set<Komentar> komentare) { |
franta-hg@145 | 166 |
this.komentare = komentare; |
franta-hg@145 | 167 |
} |
franta-hg@154 | 168 |
|
franta-hg@154 | 169 |
public Set<Kategorie> getKategorie() { |
franta-hg@154 | 170 |
return kategorie; |
franta-hg@154 | 171 |
} |
franta-hg@154 | 172 |
|
franta-hg@154 | 173 |
public void setKategorie(Set<Kategorie> kategorie) { |
franta-hg@154 | 174 |
this.kategorie = kategorie; |
franta-hg@154 | 175 |
} |
franta-hg@164 | 176 |
|
franta-hg@164 | 177 |
public Kurackost getKurackost() { |
franta-hg@164 | 178 |
return kurackost; |
franta-hg@164 | 179 |
} |
franta-hg@164 | 180 |
|
franta-hg@164 | 181 |
public void setKurackost(Kurackost kurackost) { |
franta-hg@164 | 182 |
this.kurackost = kurackost; |
franta-hg@164 | 183 |
} |
franta-hg@173 | 184 |
|
franta-hg@173 | 185 |
public boolean isSchvaleny() { |
franta-hg@173 | 186 |
return schvaleny; |
franta-hg@173 | 187 |
} |
franta-hg@173 | 188 |
|
franta-hg@173 | 189 |
public void setSchvaleny(boolean schvaleny) { |
franta-hg@173 | 190 |
this.schvaleny = schvaleny; |
franta-hg@173 | 191 |
} |
franta-hg@158 | 192 |
/** Půdou a sklepem projedete bez nebezpečí. */ |
franta-hg@10 | 193 |
} |