Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package park;
- import java.util.GregorianCalendar;
- import park.izuzeci.ParkException;
- public class SpravaZaZabavu {
- private TipSpraveZaZabavu tip;
- private int uzrast;
- private GregorianCalendar datumPostavljanja = new GregorianCalendar();
- public TipSpraveZaZabavu getTip() {
- return tip;
- }
- public void setTip(TipSpraveZaZabavu tip) {
- if(tip == null)
- throw new ParkException("Greska");
- this.tip = tip;
- }
- public int getUzrast() {
- return uzrast;
- }
- public void setUzrast(int uzrast) {
- if(uzrast<=0 || uzrast>=12)
- throw new ParkException("Greska");
- this.uzrast = uzrast;
- }
- public GregorianCalendar getDatumPostavljanja() {
- return datumPostavljanja;
- }
- public void setDatumPostavljanja(GregorianCalendar datumPostavljanja) {
- if(datumPostavljanja==null || datumPostavljanja.after(new GregorianCalendar()))
- throw new ParkException("Greska");
- this.datumPostavljanja = datumPostavljanja;
- }
- @Override
- public String toString() {
- return "SpravaZaZabavu [tip=" + tip + ", uzrast=" + uzrast + ", datumPostavljanja=" + datumPostavljanja + "]";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement