public class Itinerary extends BusinessEntity
| Modifier and Type | Class and Description |
|---|---|
static class |
Itinerary.Builder
A factory for a Itinerary's object.
|
static class |
Itinerary.Columns
A utility class that contains various strings to be used as keys to communicate with the
remote server.
|
| Constructor and Description |
|---|
Itinerary()
Default empty constructor.
|
Itinerary(org.json.JSONObject jsonObject)
Create a new Itinerary object based on a JSON Object.
|
Itinerary(java.lang.String json)
Itinerary's constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addLanguage(Language language)
Add a language to the itinerary's languages' list if it doesn't exists, otherwise do
nothing.
|
boolean |
equals(java.lang.Object o) |
java.util.Date |
getBeginningDate()
Get the itinerary's beginning date.
|
User |
getCicerone()
Get the itinerary's author.
|
int |
getCode()
Get the itinerary's code.
|
java.lang.String |
getDescription()
Get the itinerary's description.
|
java.lang.String |
getDuration()
Get the itinerary's duration.
|
java.util.Date |
getEndingDate()
Get the itinerary's ending date.
|
float |
getFullPrice()
Get the itinerary's full price.
|
java.lang.String |
getImageUrl()
Get the itinerary's image url.
|
java.util.Set<Language> |
getLanguages()
Get all the itinerary's languages.
|
java.lang.String |
getLocation()
Get the itinerary's location.
|
int |
getMaxParticipants()
Get the itinerary's maximum participants number.
|
int |
getMinParticipants()
Get the itinerary's minimum participants number.
|
float |
getReducedPrice()
Get the itinerary's reduced price.
|
int |
getRepetitions()
Get the itinerary's repetitions per day.
|
java.util.Date |
getReservationDate()
Get the itinerary's askForReservation date.
|
java.lang.String |
getTitle()
Get the itinerary's title.
|
int |
hashCode() |
boolean |
isInLanguages(java.util.Collection<Language> languages)
Check if the itinerary is available in at least one of the given languages.
|
boolean |
isInLanguages(Language languages)
Check if the itinerary is available in the specified language.
|
protected void |
loadFromJSONObject(org.json.JSONObject itinerary)
Set the BusinessEntity's properties loading them from a JSONObject.
|
void |
removeLanguage(Language language)
Remove a language from the itinerary's languages' list if it exists, otherwise do nothing.
|
void |
setBeginningDate(java.util.Date beginningDate)
Set the itinerary's beginning date.
|
void |
setCicerone(User cicerone)
Set the itinerary's author.
|
void |
setCode(int code)
Set the itinerary's code.
|
void |
setDescription(java.lang.String description)
Set the itinerary's description.
|
void |
setDuration(java.lang.String duration)
Set the itinerary's duration.
|
void |
setEndingDate(java.util.Date endingDate)
Set the itinerary's endingDate.
|
void |
setFullPrice(float fullPrice)
Set the itinerary's full price.
|
void |
setImageUrl(java.lang.String imageUrl)
Set the itinerary's image url.
|
void |
setLocation(java.lang.String location)
Set the itinerary's location.
|
void |
setMaxParticipants(int maxParticipants)
Set the itinerary's maximum participants number.
|
void |
setMinParticipants(int minParticipants)
Set the itinerary's minimum participants number.
|
void |
setReducedPrice(float reducedPrice)
Set the itinerary's reduced price.
|
void |
setRepetitions(int repetitions)
Set the itinerary's repetitions per day.
|
void |
setReservationDate(java.util.Date reservationDate)
Set the itinerary's askForReservation Date.
|
void |
setTitle(java.lang.String title)
Set the itinerary's title.
|
org.json.JSONObject |
toJSONObject()
Convert the itinerary to a JSON Object.
|
getJSONObject, toStringpublic Itinerary()
public Itinerary(java.lang.String json)
json - public Itinerary(org.json.JSONObject jsonObject)
{
"itinerary_code": "-1",
"itineraryname": "test",
"title": "Titolo",
"description": "Descrizione",
"beginningDate": "01-01-2000",
"endingDate": "01-01-2000",
"reservationDate": "01-01-2000",
"location": "Location",
"duration": "00:00:00",
"repetitions": "1",
"minParticipants": "0",
"maxParticipants": "0",
"fullPrice": "0",
"reducedPrice": "0"
}
jsonObject - The JSON object from which data will be fetched.public boolean equals(java.lang.Object o)
equals in class java.lang.ObjectObject.equals(Object)public int hashCode()
hashCode in class java.lang.ObjectObject.hashCode()protected void loadFromJSONObject(org.json.JSONObject itinerary)
BusinessEntityloadFromJSONObject in class BusinessEntityitinerary - The JSONObject.BusinessEntity.loadFromJSONObject(JSONObject)public int getCode()
public User getCicerone()
public void setCicerone(User cicerone)
cicerone - The new itinerary's author.public void setCode(int code)
code - The new itinerary's code.public java.lang.String getTitle()
public void setTitle(java.lang.String title)
title - The new itinerary's title.public java.lang.String getDescription()
public void setDescription(java.lang.String description)
description - The new itinerary's description.public java.util.Date getBeginningDate()
public void setBeginningDate(java.util.Date beginningDate)
beginningDate - The new itinerary's beginning date .public java.util.Date getEndingDate()
public void setEndingDate(java.util.Date endingDate)
endingDate - The new itinerary's ending date.public java.util.Date getReservationDate()
public void setReservationDate(java.util.Date reservationDate)
reservationDate - The new itinerary's askForReservation date.public java.lang.String getLocation()
public void setLocation(java.lang.String location)
location - The new itinerary's location.public int getMinParticipants()
public void setMinParticipants(int minParticipants)
minParticipants - The new itinerary's mininum participants number.public int getMaxParticipants()
public void setMaxParticipants(int maxParticipants)
maxParticipants - The new itinerary's maximum participants number.public int getRepetitions()
public void setRepetitions(int repetitions)
repetitions - The new itinerary's repetitions per day.public java.lang.String getDuration()
public void setDuration(java.lang.String duration)
duration - The new itinerary's duration.public float getFullPrice()
public void setFullPrice(float fullPrice)
fullPrice - price The new itinerary's full price.public float getReducedPrice()
public void setReducedPrice(float reducedPrice)
reducedPrice - price The new itinerary's reduced price.public java.lang.String getImageUrl()
public void setImageUrl(java.lang.String imageUrl)
imageUrl - price The new itinerary's image url.public java.util.Set<Language> getLanguages()
public void addLanguage(Language language)
language - The language to be added.public void removeLanguage(Language language)
language - The language to be removed.public boolean isInLanguages(java.util.Collection<Language> languages)
languages - A collection of languages to be searched.public boolean isInLanguages(Language languages)
languages - The language to be searched.public org.json.JSONObject toJSONObject()
toJSONObject in class BusinessEntity