Skip to content

Commit

Permalink
Merge branch 'hotelmodels'
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphael Sampaio committed Nov 23, 2016
2 parents 2b7b861 + e7d207e commit c4e890a
Show file tree
Hide file tree
Showing 15 changed files with 734 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ To get started add our SDK as a dependency in your **pom.xml**:
<dependency>
<groupId>com.konduto.sdk</groupId>
<artifactId>java-sdk</artifactId>
<version>2.8.0</version>
<version>2.9.0</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion konduto.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = 2.8.0
version = 2.9.0
90 changes: 90 additions & 0 deletions src/main/java/com/konduto/sdk/models/KondutoGuest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
package com.konduto.sdk.models;

import java.util.Date;

/**
*
* Konduto Guest.
*
* @see <a href="http://docs.konduto.com">Konduto API Spec</a>
*
*/
public class KondutoGuest extends KondutoModel {
private String name;
private String document;

private KondutoGuestDocumentType documentType;

public boolean equals(Object object) {
if (this == object) return true;
if (object == null || getClass() != object.getClass()) return false;

KondutoGuest that = (KondutoGuest) object;

if (name != null ? !name.equals(that.name) : that.name != null) return false;
if (document != null ? !document.equals(that.document) : that.document != null) return false;
if (documentType != null ? !documentType.equals(that.documentType) : that.documentType != null) return false;
if (dob != null ? !dob.equals(that.dob) : that.dob != null) return false;
if (nationality != null ? !nationality.equals(that.nationality) : that.nationality != null) return false;

return true;
}

public int hashCode() {
int result = super.hashCode();
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (document != null ? document.hashCode() : 0);
result = 31 * result + (documentType != null ? documentType.hashCode() : 0);
result = 31 * result + (dob != null ? dob.hashCode() : 0);
result = 31 * result + (nationality != null ? nationality.hashCode() : 0);
return result;
}

private Date dob;
private String nationality;

public KondutoGuest(){}

/* Equals */

/* Getters and Setters */
public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public String getDocument() {
return document;
}

public void setDocument(String document) {
this.document = document;
}

public KondutoGuestDocumentType getDocumentType() {
return documentType;
}

public void setDocumentType(KondutoGuestDocumentType documentType) {
this.documentType = documentType;
}

public Date getDob() {
return dob;
}

public void setDob(Date dob) {
this.dob = dob;
}

public String getNationality() {
return nationality;
}

public void setNationality(String nationality) {
this.nationality = nationality;
}
}
19 changes: 19 additions & 0 deletions src/main/java/com/konduto/sdk/models/KondutoGuestDocumentType.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.konduto.sdk.models;

import com.google.gson.annotations.SerializedName;

/**
* Created by andrealves on 11/22/16.
*/
public enum KondutoGuestDocumentType {
@SerializedName("id")
ID,
@SerializedName("passport")
PASSPORT,
@SerializedName("rg")
RG,
@SerializedName("cpf")
CPF,
@SerializedName("other")
other
}
134 changes: 134 additions & 0 deletions src/main/java/com/konduto/sdk/models/KondutoHotel.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
package com.konduto.sdk.models;

import com.google.gson.annotations.SerializedName;
import java.util.Collection;

/**
*
* Device model.
*
* @see <a href="http://docs.konduto.com">Konduto API Spec</a>
*
*/
public class KondutoHotel extends KondutoModel {

private String name;
private String address1;
private String address2;
private String city;
private String state;
private String zip;
private String country;
private String category;

private Collection<KondutoHotelRoom> rooms;

public KondutoHotel(){}

/* Equals */
public boolean equals(Object object) {
if (this == object) return true;
if (object == null || getClass() != object.getClass()) return false;

KondutoHotel that = (KondutoHotel) object;

if (name != null ? !name.equals(that.name) : that.name != null) return false;
if (address1 != null ? !address1.equals(that.address1) : that.address1 != null) return false;
if (address2 != null ? !address2.equals(that.address2) : that.address2 != null) return false;
if (city != null ? !city.equals(that.city) : that.city != null) return false;
if (state != null ? !state.equals(that.state) : that.state != null) return false;
if (zip != null ? !zip.equals(that.zip) : that.zip != null) return false;
if (country != null ? !country.equals(that.country) : that.country != null) return false;
if (category != null ? !category.equals(that.category) : that.category != null) return false;
if (rooms != null ? !rooms.equals(that.rooms) : that.rooms != null) return false;

return true;
}

public int hashCode() {
int result = super.hashCode();
result = 31 * result + (name != null ? name.hashCode() : 0);
result = 31 * result + (address1 != null ? address1.hashCode() : 0);
result = 31 * result + (address2 != null ? address2.hashCode() : 0);
result = 31 * result + (city != null ? city.hashCode() : 0);
result = 31 * result + (state != null ? state.hashCode() : 0);
result = 31 * result + (zip != null ? zip.hashCode() : 0);
result = 31 * result + (country != null ? country.hashCode() : 0);
result = 31 * result + (category != null ? category.hashCode() : 0);
result = 31 * result + (rooms != null ? rooms.hashCode() : 0);
return result;
}

/* Getters and Setters */
public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public String getAddress1() {
return address1;
}

public void setAddress1(String address1) {
this.address1 = address1;
}

public String getAddress2() {
return address2;
}

public void setAddress2(String address2) {
this.address2 = address2;
}

public String getCity() {
return city;
}

public void setCity(String city) {
this.city = city;
}

public String getState() {
return state;
}

public void setState(String state) {
this.state = state;
}

public String getZip() {
return zip;
}

public void setZip(String zip) {
this.zip = zip;
}

public String getCountry() {
return country;
}

public void setCountry(String country) {
this.country = country;
}

public String getCategory() {
return category;
}

public void setCategory(String category) {
this.category = category;
}

public Collection<KondutoHotelRoom> getRooms() {
return rooms;
}

public void setRooms(Collection<KondutoHotelRoom> rooms) {
this.rooms = rooms;
}
}
Loading

0 comments on commit c4e890a

Please sign in to comment.