-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
609 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
133 changes: 133 additions & 0 deletions
133
src/main/groovy/life/qbic/datamodel/services/Address.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
package life.qbic.datamodel.services | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty | ||
|
||
class Address { | ||
|
||
private String affiliation | ||
private String street | ||
private Integer zipCode | ||
private String country | ||
|
||
/** | ||
* Get affiliation | ||
* @return affiliation | ||
**/ | ||
@JsonProperty("affiliation") | ||
public String getAffiliation() { | ||
return affiliation; | ||
} | ||
|
||
public void setAffiliation(String affiliation) { | ||
this.affiliation = affiliation; | ||
} | ||
|
||
public Address affiliation(String affiliation) { | ||
this.affiliation = affiliation; | ||
return this; | ||
} | ||
|
||
/** | ||
* Get street | ||
* @return street | ||
**/ | ||
@JsonProperty("street") | ||
public String getStreet() { | ||
return street; | ||
} | ||
|
||
public void setStreet(String street) { | ||
this.street = street; | ||
} | ||
|
||
public Address street(String street) { | ||
this.street = street; | ||
return this; | ||
} | ||
// | ||
// /** | ||
// * Get number | ||
// * @return number | ||
// **/ | ||
// @JsonProperty("number") | ||
// public Integer getNumber() { | ||
// return number; | ||
// } | ||
// | ||
// public void setNumber(Integer number) { | ||
// this.number = number; | ||
// } | ||
// | ||
// public Address number(Integer number) { | ||
// this.number = number; | ||
// return this; | ||
// } | ||
|
||
/** | ||
* Get zipCode | ||
* @return zipCode | ||
**/ | ||
@JsonProperty("zip_code") | ||
public Integer getZipCode() { | ||
return zipCode; | ||
} | ||
|
||
public void setZipCode(Integer zipCode) { | ||
this.zipCode = zipCode; | ||
} | ||
|
||
public Address zipCode(Integer zipCode) { | ||
this.zipCode = zipCode; | ||
return this; | ||
} | ||
|
||
/** | ||
* Get country | ||
* @return country | ||
**/ | ||
@JsonProperty("country") | ||
public String getCountry() { | ||
return country; | ||
} | ||
|
||
public void setCountry(String country) { | ||
this.country = country; | ||
} | ||
|
||
public Address country(String country) { | ||
this.country = country; | ||
return this; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object a) { | ||
Address ad = (Address) a | ||
return ad.affiliation.equals(this.affiliation) && ad.country.equals(this.country) && ad.street.equals(this.street) && ad.zipCode == this.zipCode | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
StringBuilder sb = new StringBuilder(); | ||
sb.append("class Address {\n"); | ||
|
||
sb.append(" affiliation: ").append(toIndentedString(affiliation)).append("\n"); | ||
sb.append(" street: ").append(toIndentedString(street)).append("\n"); | ||
// sb.append(" number: ").append(toIndentedString(number)).append("\n"); | ||
sb.append(" zipCode: ").append(toIndentedString(zipCode)).append("\n"); | ||
sb.append(" country: ").append(toIndentedString(country)).append("\n"); | ||
sb.append("}"); | ||
return sb.toString(); | ||
} | ||
|
||
/** | ||
* Convert the given object to string with each line indented by 4 spaces | ||
* (except the first line). | ||
*/ | ||
private static String toIndentedString(java.lang.Object o) { | ||
if (o == null) { | ||
return "null"; | ||
} | ||
return o.toString().replace("\n", "\n "); | ||
} | ||
} | ||
|
91 changes: 91 additions & 0 deletions
91
src/main/groovy/life/qbic/datamodel/services/Contact.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
package life.qbic.datamodel.services; | ||
|
||
import javax.validation.Valid; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
public class Contact { | ||
|
||
private String fullName = null; | ||
|
||
@Valid | ||
private Address address = null; | ||
|
||
private String email = null; | ||
/** | ||
* Get fullName | ||
* @return fullName | ||
**/ | ||
@JsonProperty("full_name") | ||
public String getFullName() { | ||
return fullName; | ||
} | ||
|
||
public void setFullName(String fullName) { | ||
this.fullName = fullName; | ||
} | ||
|
||
public Contact fullName(String fullName) { | ||
this.fullName = fullName; | ||
return this; | ||
} | ||
|
||
/** | ||
* Get address | ||
* @return address | ||
**/ | ||
@JsonProperty("address") | ||
public Address getAddress() { | ||
return address; | ||
} | ||
|
||
public void setAddress(Address address) { | ||
this.address = address; | ||
} | ||
|
||
public Contact address(Address address) { | ||
this.address = address; | ||
return this; | ||
} | ||
|
||
/** | ||
* Get email | ||
* @return email | ||
**/ | ||
@JsonProperty("email") | ||
public String getEmail() { | ||
return email; | ||
} | ||
|
||
public void setEmail(String email) { | ||
this.email = email; | ||
} | ||
|
||
public Contact email(String email) { | ||
this.email = email; | ||
return this; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
StringBuilder sb = new StringBuilder(); | ||
sb.append("class Contact {\n"); | ||
sb.append(" full_name: ").append(toIndentedString(fullName)).append("\n"); | ||
sb.append(" address: ").append(toIndentedString(address)).append("\n"); | ||
sb.append(" email: ").append(toIndentedString(email)).append("\n"); | ||
sb.append("}"); | ||
return sb.toString(); | ||
} | ||
|
||
/** | ||
* Convert the given object to string with each line indented by 4 spaces | ||
* (except the first line). | ||
*/ | ||
private static String toIndentedString(java.lang.Object o) { | ||
if (o == null) { | ||
return "null"; | ||
} | ||
return o.toString().replace("\n", "\n "); | ||
} | ||
} | ||
|
Oops, something went wrong.