public class ZendriveDriverAttributes
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ZendriveDriverAttributes.ServiceLevel
Enumeration for different service levels supported by Zendrive for a driver.
|
Constructor and Description |
---|
ZendriveDriverAttributes()
Default constructor
|
ZendriveDriverAttributes(org.json.JSONObject jsonObject)
Construct ZendriveDriverAttributes from JSON.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o)
Compares this instance with the specified object and indicates if they
are equal.
|
java.lang.String |
getCustomAttribute(java.lang.String key)
Returns the specified custome attribute if set or null.
|
java.util.Date |
getDriverStartDate()
Returns the start date of the driver if set or null.
|
java.lang.String |
getEmail()
Returns the email of the driver if set or null.
|
java.lang.String |
getFirstName()
Returns the first name of the driver if set or null.
|
java.lang.String |
getGroup()
Returns the group id of the driver if set or null.
|
java.lang.String |
getJsonForUpload()
Get the json format to upload attributes.
|
java.lang.String |
getLastName()
Returns the last name of the driver if set or null.
|
java.lang.String |
getPhoneNumber()
Returns the phone number of the driver if set or null.
|
ZendriveDriverAttributes.ServiceLevel |
getServiceLevel() |
int |
hashCode()
Returns an integer hash code for this object.
|
void |
setCustomAttribute(java.lang.String key,
java.lang.String value)
Set the custom attribute of the driver.
|
void |
setDriverStartDate(java.util.Date startDate)
The date which the driver signed up/started using your application.
|
void |
setEmail(java.lang.String email)
Set the email address of the driver.
|
void |
setFirstName(java.lang.String firstName)
Set the first name of the driver.
|
void |
setGroup(java.lang.String groupId)
Set the group id of the driver.
|
void |
setLastName(java.lang.String lastName)
Set the last name of the driver.
|
void |
setPhoneNumber(java.lang.String phoneNumber)
Set the phone number for the driver.
|
void |
setServiceLevel(ZendriveDriverAttributes.ServiceLevel priority)
The service level of a driver.
|
org.json.JSONObject |
toJson()
Return the json representation of this object.
|
public ZendriveDriverAttributes()
public ZendriveDriverAttributes(org.json.JSONObject jsonObject) throws org.json.JSONException
jsonObject
- The json object representing ZendriveDriverAttributes.org.json.JSONException
- if the json object could not be parsed.public void setFirstName(java.lang.String firstName)
firstName
- The first name of the driver.public void setLastName(java.lang.String lastName)
lastName
- The last name of the driver.public void setEmail(java.lang.String email)
email
- The email address of the driver.public void setGroup(java.lang.String groupId)
groupId
- The group id of the driver.public void setPhoneNumber(java.lang.String phoneNumber)
phoneNumber
- The phone number of the driver. The phone number should be of the
format <country_code><phone_number>. For example 14255526528, with 1
being the country code for US followed by the number.
For India, it would be 918877554466, with 91 being the country code.java.lang.IllegalArgumentException
- if phoneNumber is longer than 20 chars or
contains non-digit characters.public void setDriverStartDate(java.util.Date startDate)
startDate
- The start date of the driverpublic void setServiceLevel(ZendriveDriverAttributes.ServiceLevel priority)
ZendriveDriverAttributes.ServiceLevel
for more information about this attribute.public ZendriveDriverAttributes.ServiceLevel getServiceLevel()
public void setCustomAttribute(java.lang.String key, java.lang.String value)
key
- A key for the custom attribute.value
- Value of the custom attribute.java.lang.IllegalStateException
- if max custom attributes (4) are already specified.public java.lang.String getFirstName()
public java.lang.String getLastName()
public java.lang.String getEmail()
public java.lang.String getGroup()
public java.lang.String getPhoneNumber()
public java.util.Date getDriverStartDate()
public java.lang.String getCustomAttribute(java.lang.String key)
public java.lang.String getJsonForUpload()
public org.json.JSONObject toJson()
public boolean equals(java.lang.Object o)
java.lang.Object
o
must represent the same object
as this instance using a class-specific comparison. The general contract
is that this comparison should be reflexive, symmetric, and transitive.
Also, no object reference other than null is equal to null.
The default implementation returns true
only if this ==
o
. See Writing a correct
equals
method
if you intend implementing your own equals
method.
The general contract for the equals
and Object.hashCode()
methods is that if equals
returns true
for
any two objects, then hashCode()
must return the same value for
these objects. This means that subclasses of Object
usually
override either both methods or neither of them.
equals
in class java.lang.Object
o
- the object to compare this instance with.true
if the specified object is equal to this Object
; false
otherwise.Object.hashCode()
public int hashCode()
java.lang.Object
Object.equals(java.lang.Object)
returns true
must return
the same hash code value. This means that subclasses of Object
usually override both methods or neither method.
Note that hash values must not change over time unless information used in equals comparisons also changes.
See Writing a correct
hashCode
method
if you intend implementing your own hashCode
method.
hashCode
in class java.lang.Object
Object.equals(java.lang.Object)