franta-hg@10: package cz.frantovo.nekurak.dto; franta-hg@10: franta-hg@12: import java.io.Serializable; franta-hg@156: import java.net.URL; franta-hg@72: import java.util.ArrayList; franta-hg@39: import java.util.Date; franta-hg@127: import java.util.HashSet; franta-hg@72: import java.util.List; franta-hg@127: import java.util.Set; franta-hg@12: franta-hg@10: /** franta-hg@50: * Podnik – hospoda, bar, kavárna… franta-hg@10: * @author fiki franta-hg@10: */ franta-hg@12: public class Podnik implements Serializable { franta-hg@10: franta-hg@145: private int id; franta-hg@145: private String nazev; franta-hg@145: private String popis; franta-hg@145: private String url; franta-hg@145: private String ulice; franta-hg@145: private Date datum; franta-hg@145: private Integer cisloPopisne; franta-hg@145: private String mesto; franta-hg@145: private String spravce; franta-hg@145: private List fotky = new ArrayList(); franta-hg@145: private Set komentare = new HashSet(); franta-hg@154: private Set kategorie = new HashSet(); franta-hg@145: private Double sirka; franta-hg@145: private Double delka; franta-hg@165: private Kurackost kurackost = new Kurackost(); franta-hg@10: franta-hg@145: public Podnik() { franta-hg@145: } franta-hg@10: franta-hg@145: public Podnik(int id, String nazev) { franta-hg@145: this.id = id; franta-hg@145: this.nazev = nazev; franta-hg@145: } franta-hg@10: franta-hg@145: public int getId() { franta-hg@145: return id; franta-hg@145: } franta-hg@10: franta-hg@145: public void setId(int id) { franta-hg@145: this.id = id; franta-hg@145: } franta-hg@10: franta-hg@145: public String getNazev() { franta-hg@145: return nazev; franta-hg@145: } franta-hg@10: franta-hg@145: public void setNazev(String nazev) { franta-hg@145: this.nazev = nazev; franta-hg@145: } franta-hg@10: franta-hg@145: public String getPopis() { franta-hg@145: return popis; franta-hg@145: } franta-hg@39: franta-hg@145: public void setPopis(String popis) { franta-hg@145: this.popis = popis; franta-hg@145: } franta-hg@39: franta-hg@145: public String getUrl() { franta-hg@145: return url; franta-hg@145: } franta-hg@39: franta-hg@145: public void setUrl(String url) { franta-hg@145: this.url = url; franta-hg@145: } franta-hg@39: franta-hg@156: /** franta-hg@156: * Získá z URL webové stránky podniku doménové jméno převedené na malá písmena. franta-hg@156: * Např. z „http://www.example.com/index.html“ získá „www.example.com“. franta-hg@156: * @return doménové jméno nebo null v případě chyby. franta-hg@156: */ franta-hg@156: public String getUrlDomena() { franta-hg@156: if (url == null) { franta-hg@156: return null; franta-hg@156: } else { franta-hg@156: try { franta-hg@156: URL u = new URL(url); franta-hg@156: String domena = u.getHost().toLowerCase(); franta-hg@156: if (domena.length() > 0) { franta-hg@156: return domena; franta-hg@156: } else { franta-hg@156: return null; franta-hg@156: } franta-hg@156: } catch (Exception e) { franta-hg@156: return null; franta-hg@156: } franta-hg@156: } franta-hg@156: } franta-hg@156: franta-hg@145: public String getUlice() { franta-hg@145: return ulice; franta-hg@145: } franta-hg@39: franta-hg@145: public void setUlice(String ulice) { franta-hg@145: this.ulice = ulice; franta-hg@145: } franta-hg@39: franta-hg@145: public Date getDatum() { franta-hg@145: return datum; franta-hg@145: } franta-hg@39: franta-hg@145: public void setDatum(Date datum) { franta-hg@145: this.datum = datum; franta-hg@145: } franta-hg@39: franta-hg@145: public int getCisloPopisne() { franta-hg@145: return cisloPopisne; franta-hg@145: } franta-hg@39: franta-hg@145: public void setCisloPopisne(int cisloPopisne) { franta-hg@145: this.cisloPopisne = cisloPopisne; franta-hg@145: } franta-hg@39: franta-hg@145: public String getMesto() { franta-hg@145: return mesto; franta-hg@145: } franta-hg@39: franta-hg@145: public void setMesto(String mesto) { franta-hg@145: this.mesto = mesto; franta-hg@145: } franta-hg@63: franta-hg@145: public String getSpravce() { franta-hg@145: return spravce; franta-hg@145: } franta-hg@63: franta-hg@145: public void setSpravce(String spravce) { franta-hg@145: this.spravce = spravce; franta-hg@145: } franta-hg@67: franta-hg@145: public List getFotky() { franta-hg@145: return fotky; franta-hg@145: } franta-hg@67: franta-hg@145: public void setFotky(List fotky) { franta-hg@145: this.fotky = fotky; franta-hg@145: } franta-hg@100: franta-hg@145: public Double getSirka() { franta-hg@145: return sirka; franta-hg@145: } franta-hg@100: franta-hg@145: public void setSirka(Double sirka) { franta-hg@145: this.sirka = sirka; franta-hg@145: } franta-hg@100: franta-hg@145: public Double getDelka() { franta-hg@145: return delka; franta-hg@145: } franta-hg@100: franta-hg@145: public void setDelka(Double delka) { franta-hg@145: this.delka = delka; franta-hg@145: } franta-hg@127: franta-hg@145: public Set getKomentare() { franta-hg@145: return komentare; franta-hg@145: } franta-hg@127: franta-hg@145: public void setKomentare(Set komentare) { franta-hg@145: this.komentare = komentare; franta-hg@145: } franta-hg@154: franta-hg@154: public Set getKategorie() { franta-hg@154: return kategorie; franta-hg@154: } franta-hg@154: franta-hg@154: public void setKategorie(Set kategorie) { franta-hg@154: this.kategorie = kategorie; franta-hg@154: } franta-hg@164: franta-hg@164: public Kurackost getKurackost() { franta-hg@164: return kurackost; franta-hg@164: } franta-hg@164: franta-hg@164: public void setKurackost(Kurackost kurackost) { franta-hg@164: this.kurackost = kurackost; franta-hg@164: } franta-hg@158: /** Půdou a sklepem projedete bez nebezpečí. */ franta-hg@10: }