-
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.
Update Code structure to support new models
- Loading branch information
1 parent
2f71c26
commit c3b45ac
Showing
18 changed files
with
120 additions
and
280 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
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
16 changes: 16 additions & 0 deletions
16
src/main/java/esendex/sdk/java/model/transfer/LinkDto.java
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,16 @@ | ||
package esendex.sdk.java.model.transfer; | ||
|
||
import com.thoughtworks.xstream.annotations.XStreamAlias; | ||
import com.thoughtworks.xstream.annotations.XStreamAsAttribute; | ||
|
||
@XStreamAlias("link") | ||
public class LinkDto { | ||
|
||
@XStreamAlias("rel") | ||
@XStreamAsAttribute | ||
private String rel; | ||
|
||
@XStreamAlias("href") | ||
@XStreamAsAttribute | ||
private String href; | ||
} |
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
128 changes: 37 additions & 91 deletions
128
src/main/java/esendex/sdk/java/model/transfer/contact/ContactDto.java
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 |
---|---|---|
@@ -1,128 +1,74 @@ | ||
|
||
package esendex.sdk.java.model.transfer.contact; | ||
|
||
import com.thoughtworks.xstream.annotations.XStreamAlias; | ||
import com.thoughtworks.xstream.annotations.XStreamImplicit; | ||
import com.thoughtworks.xstream.annotations.XStreamOmitField; | ||
import esendex.sdk.java.model.transfer.Dto; | ||
import esendex.sdk.java.model.transfer.LinkDto; | ||
|
||
/** | ||
* Base class for contact requests and responses. This class directly holds the | ||
* parsed xml data. Subclasses should merely allow selective access. | ||
* @author Mike Whittaker | ||
*/ | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
@XStreamAlias("contact") | ||
public class ContactDto extends Dto { | ||
|
||
@XStreamAlias("firstname") | ||
private String firstname; | ||
|
||
@XStreamAlias("lastname") | ||
private String lastname; | ||
|
||
@XStreamAlias("quickname") | ||
private String quickname; | ||
|
||
@XStreamAlias("phonenumber") | ||
private String phonenumber; | ||
private String accountreference; | ||
|
||
@XStreamOmitField | ||
private String link; | ||
@XStreamAlias("accountreference") | ||
private String accountreference; | ||
|
||
public ContactDto() { | ||
} | ||
@XStreamImplicit(itemFieldName = "link") | ||
private List link = new ArrayList(); | ||
|
||
|
||
/** | ||
* The first name of this Contact. This may not be returned if the property | ||
* has not been set for the Contact. | ||
* @return the contacts first name | ||
*/ | ||
public String getFirstname() { | ||
return firstname; | ||
} | ||
|
||
/** | ||
* The last name of this Contact. This may not be returned if | ||
* the property has not been set for the Contact. | ||
* @return the contacts last name | ||
*/ | ||
public void setFirstname(String firstname) { | ||
this.firstname = firstname; | ||
} | ||
|
||
public String getLastname() { | ||
return lastname; | ||
} | ||
|
||
/** | ||
* This is the human-friendly shortcut for the Contact and can be used as | ||
* a Message recipient instead of a telephone number. Where firstname | ||
* and lastname have been set when the Contact was created, it may be a | ||
* concatenation of these two values. | ||
* @return the contacts quickname | ||
*/ | ||
public void setLastname(String lastname) { | ||
this.lastname = lastname; | ||
} | ||
|
||
public String getQuickname() { | ||
return quickname; | ||
} | ||
|
||
/** | ||
* The telephone number associated with this Contact. | ||
* @return the phone number | ||
*/ | ||
public String getPhoneNumber() { | ||
return phonenumber; | ||
public void setQuickname(String quickname) { | ||
this.quickname = quickname; | ||
} | ||
|
||
/** | ||
* The accountReference associated with this Contact. | ||
* @return the Account Reference | ||
*/ | ||
public String getAccountReference() {return accountreference; } | ||
|
||
/** | ||
* Sets the firstname. | ||
* @param firstname the first name to set | ||
* @see #getFirstname() | ||
*/ | ||
public void setFirstname(String firstname) { | ||
this.firstname = firstname; | ||
public String getPhoneNumber() { | ||
return phonenumber; | ||
} | ||
|
||
/** | ||
* Sets the lastname. | ||
* @param lastname the last name to set | ||
* @see #getLastname() | ||
*/ | ||
public void setLastname(String lastname) { | ||
this.lastname = lastname; | ||
public void setPhoneNumber(String phonenumber) { | ||
this.phonenumber = phonenumber; | ||
} | ||
|
||
/** | ||
* Sets the quickname. | ||
* @param quickname the quick name to set | ||
* @see #getQuickname() | ||
*/ | ||
public void setQuickname(String quickname) { | ||
this.quickname = quickname; | ||
public String getAccountReference() { | ||
return accountreference; | ||
} | ||
|
||
/** | ||
* Sets the phonenumber. | ||
* @param phonenumber the mobile number to set | ||
* @see #getPhoneNumber() | ||
*/ | ||
public void setPhoneNumber(String phonenumber) { | ||
this.phonenumber = phonenumber; | ||
public void setAccountReference(String accountreference) { | ||
this.accountreference = accountreference; | ||
} | ||
|
||
/** | ||
* Sets the type. | ||
* @param accountReference the accountReference to set | ||
* @see #getAccountReference() () | ||
*/ | ||
public void setAccountReference(String accountReference) { | ||
this.accountreference = accountReference; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public String toString() { | ||
|
||
return super.toString() + | ||
"\nfirstname:" + firstname + | ||
"\nlastname:" + lastname + | ||
"\nquickname:" + quickname + | ||
"\nmobilenumber:" + phonenumber + | ||
"\naccountreference:" + accountreference; | ||
} | ||
} | ||
} |
14 changes: 10 additions & 4 deletions
14
src/main/java/esendex/sdk/java/model/transfer/contact/ContactResponseDto.java
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 |
---|---|---|
@@ -1,12 +1,18 @@ | ||
package esendex.sdk.java.model.transfer.contact; | ||
|
||
|
||
import com.thoughtworks.xstream.annotations.XStreamAlias; | ||
import esendex.sdk.java.model.transfer.Dto; | ||
|
||
@XStreamAlias("response") | ||
public class ContactResponseDto { | ||
public class ContactResponseDto extends Dto { | ||
|
||
@XStreamAlias("contact") | ||
private NewContactDto contact;// = new ArrayList(); | ||
private ContactDto contact; | ||
|
||
public ContactDto getContact() { | ||
return contact; | ||
} | ||
|
||
public void setContact(ContactDto contact) { | ||
this.contact = contact; | ||
} | ||
} |
26 changes: 0 additions & 26 deletions
26
src/main/java/esendex/sdk/java/model/transfer/contact/NewContactDto.java
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.