public class ZendriveConfiguration
extends java.lang.Object
setup
.
It contains properties like the sdk key, driver id, driver attributes etc.Constructor and Description |
---|
ZendriveConfiguration(org.json.JSONObject jsonObject)
Creates a ZendriveConfiguration from its json representation.
|
ZendriveConfiguration(java.lang.String sdkKey,
java.lang.String driverId)
Creates a ZendriveConfiguration with the given sdk key and a driver id.
|
ZendriveConfiguration(java.lang.String sdkKey,
java.lang.String driverId,
ZendriveDriveDetectionMode driveDetectionMode)
Creates a ZendriveConfiguration with the given sdk key, driver id and drive
detection mode.
|
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.
|
ZendriveDriverAttributes |
getDriverAttributes()
Returns the additional attributes of the current driver.
|
java.lang.String |
getDriverId()
Returns the unique ID of the driver using this application.
|
boolean |
getForegroundOptimization()
Is foreground optimization enabled or disabled?
|
java.lang.String |
getSdkKey()
Returns the Zendrive sdk key used by this application.
|
ZendriveDriveDetectionMode |
getZendriveDriveDetectionMode()
Returns the drive detection mode specified for the Zendrive SDK.
|
int |
hashCode()
Returns an integer hash code for this object.
|
void |
setDriveDetectionMode(ZendriveDriveDetectionMode mode)
Set the drive detection mode of this configuration.
|
void |
setDriverAttributes(ZendriveDriverAttributes driverAttributes)
Set the additional attributes of the current driver.
|
void |
setForegroundOptimization(boolean enabled)
Deprecated.
|
org.json.JSONObject |
toJson()
Return the json representation of this object.
|
public ZendriveConfiguration(java.lang.String sdkKey, java.lang.String driverId)
Auto drive detection is on
when Zendrive is
setup
with this configuration.sdkKey
- The Zendrive sdk key for this application.
The sdk key is available from the
Zendrive developer portal . This cannot be null.driverId
- The Id of the driver currently using this application. Each driver using the
application needs a unique Id. This same Id will be used in Zendrive driver
analytics services like the dashboard and API.
The driver Id may be upto 64 characters long. Additionally, the driver Id
needs to be websafe. You can use Zendrive.isValidInputParameter(String)
to validate the driver Id. Passing an invalid id will cause the Zendrive SDK setup to fail.
This cannot be null.public ZendriveConfiguration(java.lang.String sdkKey, java.lang.String driverId, ZendriveDriveDetectionMode driveDetectionMode)
sdkKey
- The Zendrive sdk key for this application.
The sdk key is available from the
Zendrive developer portal . This cannot be null.driverId
- The Id of the driver currently using this application. Each driver using the
application needs a unique Id. This same Id will be used in Zendrive driver
analytics services like the dashboard and API.
The driver Id may be upto 64 characters long. Additionally, the driver Id
needs to be websafe. You can use Zendrive.isValidInputParameter(String)
to validate the driver Id. Passing an invalid id will cause the Zendrive SDK setup to fail.
This cannot be null.driveDetectionMode
- The drive detection mode of the Zendrive SDK. Cannot be null.public ZendriveConfiguration(org.json.JSONObject jsonObject) throws org.json.JSONException
jsonObject
- The json representation of a ZendriveConfiguration.org.json.JSONException
- if the json could not be parsed properly.public java.lang.String getSdkKey()
public java.lang.String getDriverId()
public ZendriveDriveDetectionMode getZendriveDriveDetectionMode()
public ZendriveDriverAttributes getDriverAttributes()
public void setDriverAttributes(ZendriveDriverAttributes driverAttributes)
driverAttributes
- The additional attributes of the current driver. If null,
all the driver attributes are reset.@Deprecated public void setForegroundOptimization(boolean enabled)
public boolean getForegroundOptimization()
public void setDriveDetectionMode(ZendriveDriveDetectionMode mode)
mode
- The ZendriveDriveDetectionMode.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)