diff options
author | Bilal <bilal@Bilals-MBP.localdomain> | 2018-05-23 17:24:45 -0400 |
---|---|---|
committer | Bilal <bilal@Bilals-MBP.localdomain> | 2018-05-23 17:24:45 -0400 |
commit | 92ba24d72bb68d3374535d341101e1399372fd43 (patch) | |
tree | cacb5262ea58553def3e300bdf78164b9ae6bbf3 | |
parent | 88d78965404e988792ad0596ca329431fad65d6a (diff) | |
download | sdl_android-feature/issue_154_part1.tar.gz |
Add second batch or RPC constructorsfeature/issue_154_part1
23 files changed, 334 insertions, 58 deletions
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ECallInfo.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ECallInfo.java index da6c37d9a..a25f4bf33 100644 --- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ECallInfo.java +++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ECallInfo.java @@ -1,7 +1,10 @@ package com.smartdevicelink.proxy.rpc;
+import android.support.annotation.NonNull;
+
import com.smartdevicelink.proxy.RPCStruct;
import com.smartdevicelink.proxy.rpc.enums.ECallConfirmationStatus;
+import com.smartdevicelink.proxy.rpc.enums.VehicleDataEventStatus;
import com.smartdevicelink.proxy.rpc.enums.VehicleDataNotificationStatus;
import com.smartdevicelink.proxy.rpc.enums.VehicleDataResultCode;
@@ -57,30 +60,41 @@ public class ECallInfo extends RPCStruct { public static final String KEY_E_CALL_NOTIFICATION_STATUS = "eCallNotificationStatus";
public static final String KEY_AUX_E_CALL_NOTIFICATION_STATUS = "auxECallNotificationStatus";
public static final String KEY_E_CALL_CONFIRMATION_STATUS = "eCallConfirmationStatus";
- /** Constructs a new ECallInfo object indicated by the Hashtable
- * parameter
- * @param hash
- *
- * <p>The hash table to use</p>
+ /** Constructs a new ECallInfo object
*/
public ECallInfo() { }
+ /** Constructs a new ECallInfo object indicated by the Hashtable
+ * parameter
+ * @param hash
+ *
+ * <p>The hash table to use</p>
+ */
public ECallInfo(Hashtable<String, Object> hash) {
super(hash);
}
+ /** Constructs a new ECallInfo object
+ *
+ */
+ public ECallInfo(@NonNull VehicleDataNotificationStatus eCallNotificationStatus, @NonNull VehicleDataNotificationStatus auxECallNotificationStatus, @NonNull ECallConfirmationStatus eCallConfirmationStatus) {
+ this();
+ setECallNotificationStatus(eCallNotificationStatus);
+ setAuxECallNotificationStatus(auxECallNotificationStatus);
+ setECallConfirmationStatus(eCallConfirmationStatus);
+ }
- public void setECallNotificationStatus(VehicleDataNotificationStatus eCallNotificationStatus) {
+ public void setECallNotificationStatus(@NonNull VehicleDataNotificationStatus eCallNotificationStatus) {
setValue(KEY_E_CALL_NOTIFICATION_STATUS, eCallNotificationStatus);
}
public VehicleDataNotificationStatus getECallNotificationStatus() {
return (VehicleDataNotificationStatus) getObject(VehicleDataNotificationStatus.class, KEY_E_CALL_NOTIFICATION_STATUS);
}
- public void setAuxECallNotificationStatus(VehicleDataNotificationStatus auxECallNotificationStatus) {
+ public void setAuxECallNotificationStatus(@NonNull VehicleDataNotificationStatus auxECallNotificationStatus) {
setValue(KEY_AUX_E_CALL_NOTIFICATION_STATUS, auxECallNotificationStatus);
}
public VehicleDataNotificationStatus getAuxECallNotificationStatus() {
return (VehicleDataNotificationStatus) getObject(VehicleDataNotificationStatus.class, KEY_AUX_E_CALL_NOTIFICATION_STATUS);
}
- public void setECallConfirmationStatus(ECallConfirmationStatus eCallConfirmationStatus) {
+ public void setECallConfirmationStatus(@NonNull ECallConfirmationStatus eCallConfirmationStatus) {
setValue(KEY_E_CALL_CONFIRMATION_STATUS, eCallConfirmationStatus);
}
public ECallConfirmationStatus getECallConfirmationStatus() {
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/EmergencyEvent.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/EmergencyEvent.java index 19b8f69bb..85e2b6368 100644 --- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/EmergencyEvent.java +++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/EmergencyEvent.java @@ -1,5 +1,7 @@ package com.smartdevicelink.proxy.rpc;
+import android.support.annotation.NonNull;
+
import java.util.Hashtable;
import com.smartdevicelink.proxy.RPCStruct;
@@ -79,44 +81,57 @@ public class EmergencyEvent extends RPCStruct { public static final String KEY_ROLLOVER_EVENT = "rolloverEvent";
public static final String KEY_MAXIMUM_CHANGE_VELOCITY = "maximumChangeVelocity";
public static final String KEY_MULTIPLE_EVENTS = "multipleEvents";
-
- /** Constructs a new EmergencyEvent object indicated by the Hashtable
- * parameter
- * @param hash
- *
- * <p>The hash table to use</p>
- */
+ /** Constructs a new EmergencyEvent object
+ *
+ */
public EmergencyEvent() { }
+ /** Constructs a new EmergencyEvent object indicated by the Hashtable
+ * parameter
+ * @param hash
+ *
+ * <p>The hash table to use</p>
+ */
public EmergencyEvent(Hashtable<String, Object> hash) {
super(hash);
}
+ /** Constructs a new EmergencyEvent object
+ *
+ */
+ public EmergencyEvent(@NonNull EmergencyEventType emergencyEventType, @NonNull FuelCutoffStatus fuelCutoffStatus, @NonNull VehicleDataEventStatus rolloverEvent, @NonNull Integer maximumChangeVelocity, @NonNull VehicleDataEventStatus multipleEvents) {
+ this();
+ setEmergencyEventType(emergencyEventType);
+ setFuelCutoffStatus(fuelCutoffStatus);
+ setRolloverEvent(rolloverEvent);
+ setMaximumChangeVelocity(maximumChangeVelocity);
+ setMultipleEvents(multipleEvents);
+ }
- public void setEmergencyEventType(EmergencyEventType emergencyEventType) {
+ public void setEmergencyEventType(@NonNull EmergencyEventType emergencyEventType) {
setValue(KEY_EMERGENCY_EVENT_TYPE, emergencyEventType);
}
public EmergencyEventType getEmergencyEventType() {
return (EmergencyEventType) getObject(EmergencyEventType.class, KEY_EMERGENCY_EVENT_TYPE);
}
- public void setFuelCutoffStatus(FuelCutoffStatus fuelCutoffStatus) {
+ public void setFuelCutoffStatus(@NonNull FuelCutoffStatus fuelCutoffStatus) {
setValue(KEY_FUEL_CUTOFF_STATUS, fuelCutoffStatus);
}
public FuelCutoffStatus getFuelCutoffStatus() {
return (FuelCutoffStatus) getObject(FuelCutoffStatus.class, KEY_FUEL_CUTOFF_STATUS);
}
- public void setRolloverEvent(VehicleDataEventStatus rolloverEvent) {
+ public void setRolloverEvent(@NonNull VehicleDataEventStatus rolloverEvent) {
setValue(KEY_ROLLOVER_EVENT, rolloverEvent);
}
public VehicleDataEventStatus getRolloverEvent() {
return (VehicleDataEventStatus) getObject(VehicleDataEventStatus.class, KEY_ROLLOVER_EVENT);
}
- public void setMaximumChangeVelocity(Integer maximumChangeVelocity) {
+ public void setMaximumChangeVelocity(@NonNull Integer maximumChangeVelocity) {
setValue(KEY_MAXIMUM_CHANGE_VELOCITY, maximumChangeVelocity);
}
public Integer getMaximumChangeVelocity() {
return getInteger(KEY_MAXIMUM_CHANGE_VELOCITY);
}
- public void setMultipleEvents(VehicleDataEventStatus multipleEvents) {
+ public void setMultipleEvents(@NonNull VehicleDataEventStatus multipleEvents) {
setValue(KEY_MULTIPLE_EVENTS, multipleEvents);
}
public VehicleDataEventStatus getMultipleEvents() {
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/EndAudioPassThruResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/EndAudioPassThruResponse.java index 4f7a09f7b..fddb8a30c 100644 --- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/EndAudioPassThruResponse.java +++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/EndAudioPassThruResponse.java @@ -1,9 +1,12 @@ package com.smartdevicelink.proxy.rpc;
+import android.support.annotation.NonNull;
+
import java.util.Hashtable;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
/**
* End Audio Pass Thru Response is sent, when EndAudioPassThru has been called
@@ -21,4 +24,14 @@ public class EndAudioPassThruResponse extends RPCResponse { public EndAudioPassThruResponse(Hashtable<String, Object> hash) {
super(hash);
}
+ /**
+ * Constructs a new EndAudioPassThruResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public EndAudioPassThruResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
}
\ No newline at end of file diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GenericResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GenericResponse.java index 4618fd857..a92c237e3 100644 --- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GenericResponse.java +++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GenericResponse.java @@ -1,9 +1,12 @@ package com.smartdevicelink.proxy.rpc;
+import android.support.annotation.NonNull;
+
import java.util.Hashtable;
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
/**
* Generic Response is sent, when the name of a received msg cannot be
@@ -54,4 +57,14 @@ public class GenericResponse extends RPCResponse { public GenericResponse(Hashtable<String, Object> hash) {
super(hash);
}
+ /**
+ * Constructs a new GenericResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public GenericResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
}
\ No newline at end of file diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCs.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCs.java index 83243823e..ea3910a8f 100644 --- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCs.java +++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCs.java @@ -1,5 +1,7 @@ package com.smartdevicelink.proxy.rpc;
+import android.support.annotation.NonNull;
+
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCRequest;
@@ -77,6 +79,19 @@ public class GetDTCs extends RPCRequest { }
/**
+ * Constructs a new GetDTCs object
+ * @param ecuName
+ * an Integer value representing a name of the module to receive
+ * the DTC form
+ * <p>
+ * <b>Notes:</p> </b>Minvalue:0; Maxvalue:65535
+ */
+ public GetDTCs(@NonNull Integer ecuName) {
+ this();
+ setEcuName(ecuName);
+ }
+
+ /**
* Sets a name of the module to receive the DTC form
*
* @param ecuName
@@ -85,7 +100,7 @@ public class GetDTCs extends RPCRequest { * <p>
* <b>Notes:</p> </b>Minvalue:0; Maxvalue:65535
*/
- public void setEcuName(Integer ecuName) {
+ public void setEcuName(@NonNull Integer ecuName) {
setParameters(KEY_ECU_NAME, ecuName);
}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCsResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCsResponse.java index 02d130db8..802f6b34a 100644 --- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCsResponse.java +++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCsResponse.java @@ -1,7 +1,10 @@ package com.smartdevicelink.proxy.rpc;
+import android.support.annotation.NonNull;
+
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
import java.util.Hashtable;
import java.util.List;
@@ -24,6 +27,19 @@ public class GetDTCsResponse extends RPCResponse{ super(hash);
}
+ /**
+ * Constructs a new GetDTCsResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ * @param ecuHeader
+ */
+ public GetDTCsResponse(@NonNull Boolean success, @NonNull Result resultCode, @NonNull Integer ecuHeader) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ setEcuHeader(ecuHeader);
+ }
+
@SuppressWarnings("unchecked")
public List<String> getDtc(){
return (List<String>) getObject(String.class, KEY_DTC);
@@ -37,7 +53,8 @@ public class GetDTCsResponse extends RPCResponse{ return getInteger(KEY_ECU_HEADER);
}
- public void setEcuHeader(Integer ecuHeader){
+ public void setEcuHeader(@NonNull Integer ecuHeader){
setParameters(KEY_ECU_HEADER, ecuHeader);
}
+
}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleData.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleData.java index 53108b4fb..dc6ab5444 100644 --- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleData.java +++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleData.java @@ -1,5 +1,7 @@ package com.smartdevicelink.proxy.rpc; +import android.support.annotation.NonNull; + import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCRequest; import com.smartdevicelink.proxy.rpc.enums.ModuleType; @@ -36,6 +38,14 @@ public class GetInteriorVehicleData extends RPCRequest { } /** + * Constructs a new GetInteriorVehicleData object + */ + public GetInteriorVehicleData(@NonNull ModuleType moduleType) { + this(); + setModuleType(moduleType); + } + + /** * Gets the ModuleType * * @return ModuleType - The type of a RC module to retrieve module data from the vehicle. @@ -52,7 +62,7 @@ public class GetInteriorVehicleData extends RPCRequest { * The type of a RC module to retrieve module data from the vehicle. * In the future, this should be the Identification of a module. */ - public void setModuleType(ModuleType moduleType) { + public void setModuleType(@NonNull ModuleType moduleType) { setParameters(KEY_MODULE_TYPE, moduleType); } diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataResponse.java index 0e74001f6..557d91d12 100644 --- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataResponse.java +++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataResponse.java @@ -1,7 +1,11 @@ package com.smartdevicelink.proxy.rpc; +import android.support.annotation.NonNull; + import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCResponse; +import com.smartdevicelink.proxy.rpc.enums.Result; + import java.util.Hashtable; public class GetInteriorVehicleDataResponse extends RPCResponse { @@ -28,6 +32,19 @@ public class GetInteriorVehicleDataResponse extends RPCResponse { } /** + * Constructs a new GetInteriorVehicleDataResponse object + * @param success whether the request is successfully processed + * @param resultCode whether the request is successfully processed + * @param moduleData + */ + public GetInteriorVehicleDataResponse(@NonNull Boolean success, @NonNull Result resultCode, @NonNull ModuleData moduleData) { + this(); + setSuccess(success); + setResultCode(resultCode); + setModuleData(moduleData); + } + + /** * Gets the moduleData * * @return ModuleData diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapability.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapability.java index 190403096..031adddcf 100644 --- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapability.java +++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapability.java @@ -1,5 +1,7 @@ package com.smartdevicelink.proxy.rpc; +import android.support.annotation.NonNull; + import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCRequest; import com.smartdevicelink.proxy.rpc.enums.SystemCapabilityType; @@ -31,6 +33,15 @@ public class GetSystemCapability extends RPCRequest { } /** + * Constructs a new GetSystemCapability object + * @param systemCapabilityType SystemCapabilityType being requested + */ + public GetSystemCapability(@NonNull SystemCapabilityType systemCapabilityType){ + this(); + setSystemCapabilityType(systemCapabilityType); + } + + /** * Used to get the SystemCapabilityType being requested * @return the SystemCapabilityType being requested */ @@ -42,7 +53,7 @@ public class GetSystemCapability extends RPCRequest { * Used to set the SystemCapabilityType being requested * @param value SystemCapabilityType being requested */ - public void setSystemCapabilityType(SystemCapabilityType value){ + public void setSystemCapabilityType(@NonNull SystemCapabilityType value){ setParameters(KEY_SYSTEM_CAPABILITY_TYPE, value); } } diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapabilityResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapabilityResponse.java index bccce6331..4f38e95a5 100644 --- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapabilityResponse.java +++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapabilityResponse.java @@ -1,7 +1,10 @@ package com.smartdevicelink.proxy.rpc; +import android.support.annotation.NonNull; + import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCResponse; +import com.smartdevicelink.proxy.rpc.enums.Result; import java.util.Hashtable; @@ -31,6 +34,19 @@ public class GetSystemCapabilityResponse extends RPCResponse { } /** + * Constructs a new GetSystemCapabilityResponse object + * @param success whether the request is successfully processed + * @param resultCode whether the request is successfully processed + * @param systemCapability SystemCapability object + */ + public GetSystemCapabilityResponse(@NonNull Boolean success, @NonNull Result resultCode, @NonNull SystemCapability systemCapability) { + this(); + setSuccess(success); + setResultCode(resultCode); + setSystemCapability(systemCapability); + } + + /** * Get the SystemCapability object returned after a GetSystemCapability call * @return SystemCapability object */ @@ -42,7 +58,7 @@ public class GetSystemCapabilityResponse extends RPCResponse { * Set a SystemCapability object in the response * @param value SystemCapability object */ - public void setSystemCapability(SystemCapability value){ + public void setSystemCapability(@NonNull SystemCapability value){ setParameters(KEY_SYSTEM_CAPABILITY, value); } } diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleDataResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleDataResponse.java index 39e33993b..2a1eb0a2d 100644 --- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleDataResponse.java +++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetVehicleDataResponse.java @@ -1,10 +1,13 @@ package com.smartdevicelink.proxy.rpc;
+import android.support.annotation.NonNull;
+
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
import com.smartdevicelink.proxy.rpc.enums.ComponentVolumeStatus;
import com.smartdevicelink.proxy.rpc.enums.PRNDL;
+import com.smartdevicelink.proxy.rpc.enums.Result;
import com.smartdevicelink.proxy.rpc.enums.VehicleDataEventStatus;
import com.smartdevicelink.proxy.rpc.enums.WiperStatus;
import com.smartdevicelink.util.SdlDataTypeConverter;
@@ -53,6 +56,16 @@ public class GetVehicleDataResponse extends RPCResponse { public GetVehicleDataResponse(Hashtable<String, Object> hash) {
super(hash);
}
+ /**
+ * Constructs a new GetVehicleDataResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public GetVehicleDataResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
public void setGps(GPSData gps) {
setParameters(KEY_GPS, gps);
}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetWayPoints.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetWayPoints.java index 443e66b3d..95b076e52 100644 --- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetWayPoints.java +++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetWayPoints.java @@ -1,5 +1,7 @@ package com.smartdevicelink.proxy.rpc; +import android.support.annotation.NonNull; + import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCRequest; import com.smartdevicelink.proxy.rpc.enums.WayPointType; @@ -17,11 +19,16 @@ public class GetWayPoints extends RPCRequest { super(hash); } + public GetWayPoints(@NonNull WayPointType wayPointType) { + this(); + setWayPointType(wayPointType); + } + public WayPointType getWayPointType() { return (WayPointType) getObject(WayPointType.class, KEY_WAY_POINT_TYPE); } - public void setWayPointType(WayPointType wayPointType) { + public void setWayPointType(@NonNull WayPointType wayPointType) { setParameters(KEY_WAY_POINT_TYPE, wayPointType); } } diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetWayPointsResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetWayPointsResponse.java index 13eb85642..32344ffbd 100644 --- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetWayPointsResponse.java +++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/GetWayPointsResponse.java @@ -1,7 +1,10 @@ package com.smartdevicelink.proxy.rpc; +import android.support.annotation.NonNull; + import com.smartdevicelink.protocol.enums.FunctionID; import com.smartdevicelink.proxy.RPCResponse; +import com.smartdevicelink.proxy.rpc.enums.Result; import java.util.Hashtable; import java.util.List; @@ -15,7 +18,16 @@ public class GetWayPointsResponse extends RPCResponse { public GetWayPointsResponse(Hashtable<String, Object> hash) { super(hash); } - + /** + * Constructs a new GetWayPointsResponse object + * @param success whether the request is successfully processed + * @param resultCode whether the request is successfully processed + */ + public GetWayPointsResponse(@NonNull Boolean success, @NonNull Result resultCode) { + this(); + setSuccess(success); + setResultCode(resultCode); + } public void setWayPoints(List<LocationDetails> wayPoints) { setParameters(KEY_WAY_POINTS, wayPoints); } diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/HMIPermissions.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/HMIPermissions.java index bf2184d0c..307ff8b06 100644 --- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/HMIPermissions.java +++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/HMIPermissions.java @@ -1,5 +1,7 @@ package com.smartdevicelink.proxy.rpc;
+import android.support.annotation.NonNull;
+
import com.smartdevicelink.proxy.RPCStruct;
import com.smartdevicelink.proxy.rpc.enums.HMILevel;
@@ -56,7 +58,16 @@ public class HMIPermissions extends RPCStruct { public HMIPermissions(Hashtable<String, Object> hash) {
super(hash);
}
-
+ /**
+ * Constructs a newly allocated HMIPermissions object
+ * @param allowed HMI level that is permitted for this given RPC
+ * @param userDisallowed HMI level that is prohibited for this given RPC
+ */
+ public HMIPermissions(@NonNull List<HMILevel> allowed, @NonNull List<HMILevel> userDisallowed) {
+ this();
+ setAllowed(allowed);
+ setUserDisallowed(userDisallowed);
+ }
/**
* get a set of all HMI levels that are permitted for this given RPC.
* @return a set of all HMI levels that are permitted for this given RPC
@@ -70,7 +81,7 @@ public class HMIPermissions extends RPCStruct { * set HMI level that is permitted for this given RPC.
* @param allowed HMI level that is permitted for this given RPC
*/
- public void setAllowed(List<HMILevel> allowed) {
+ public void setAllowed(@NonNull List<HMILevel> allowed) {
setValue(KEY_ALLOWED, allowed);
}
@@ -87,7 +98,7 @@ public class HMIPermissions extends RPCStruct { * set a set of all HMI levels that are prohibited for this given RPC
* @param userDisallowed HMI level that is prohibited for this given RPC
*/
- public void setUserDisallowed(List<HMILevel> userDisallowed) {
+ public void setUserDisallowed(@NonNull List<HMILevel> userDisallowed) {
setValue(KEY_USER_DISALLOWED, userDisallowed);
}
}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/HapticRect.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/HapticRect.java index 64a9f8354..a102f3eb1 100644 --- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/HapticRect.java +++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/HapticRect.java @@ -1,5 +1,7 @@ package com.smartdevicelink.proxy.rpc; +import android.support.annotation.NonNull; + import com.smartdevicelink.proxy.RPCStruct; import java.util.Hashtable; @@ -52,10 +54,15 @@ public class HapticRect extends RPCStruct { super(hash); } + public HapticRect(@NonNull Integer id, @NonNull Rectangle rect) { + this(); + setId(id); + setRect(rect); + } /** * Set a user control spatial identifier that references the supplied spatial data */ - public void setId(Integer id) { + public void setId(@NonNull Integer id) { setValue(KEY_ID, id); } @@ -69,7 +76,7 @@ public class HapticRect extends RPCStruct { /** * Set the position of the haptic rectangle to be highlighted. The center of this rectangle will be "touched" when a press occurs. */ - public void setRect(Rectangle rect) { + public void setRect(@NonNull Rectangle rect) { setValue(KEY_RECT, rect); } diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/HeadLampStatus.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/HeadLampStatus.java index 935b8357e..e69c68d75 100644 --- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/HeadLampStatus.java +++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/HeadLampStatus.java @@ -1,5 +1,7 @@ package com.smartdevicelink.proxy.rpc;
+import android.support.annotation.NonNull;
+
import java.util.Hashtable;
import com.smartdevicelink.proxy.RPCStruct;
@@ -44,29 +46,40 @@ public class HeadLampStatus extends RPCStruct { public static final String KEY_AMBIENT_LIGHT_SENSOR_STATUS = "ambientLightSensorStatus";
public static final String KEY_HIGH_BEAMS_ON = "highBeamsOn";
public static final String KEY_LOW_BEAMS_ON = "lowBeamsOn";
- /**<p> Constructs a new HeadLampStatus object indicated by the Hashtable
- * parameter</p>
- * @param hash
- * The hash table to use
- */
+ /**Constructs a new HeadLampStatus object
+ *
+ */
public HeadLampStatus() {}
+ /**<p> Constructs a new HeadLampStatus object indicated by the Hashtable
+ * parameter</p>
+ * @param hash
+ * The hash table to use
+ */
public HeadLampStatus(Hashtable<String, Object> hash) {
super(hash);
}
+ /**Constructs a new HeadLampStatus object
+ *
+ */
+ public HeadLampStatus(@NonNull Boolean lowBeamsOn, @NonNull Boolean highBeamsOn) {
+ this();
+ setLowBeamsOn(lowBeamsOn);
+ setHighBeamsOn(highBeamsOn);
+ }
public void setAmbientLightStatus(AmbientLightStatus ambientLightSensorStatus) {
setValue(KEY_AMBIENT_LIGHT_SENSOR_STATUS, ambientLightSensorStatus);
}
public AmbientLightStatus getAmbientLightStatus() {
return (AmbientLightStatus) getObject(AmbientLightStatus.class, KEY_AMBIENT_LIGHT_SENSOR_STATUS);
}
- public void setHighBeamsOn(Boolean highBeamsOn) {
+ public void setHighBeamsOn(@NonNull Boolean highBeamsOn) {
setValue(KEY_HIGH_BEAMS_ON, highBeamsOn);
}
public Boolean getHighBeamsOn() {
return getBoolean(KEY_HIGH_BEAMS_ON);
}
- public void setLowBeamsOn(Boolean lowBeamsOn) {
+ public void setLowBeamsOn(@NonNull Boolean lowBeamsOn) {
setValue(KEY_LOW_BEAMS_ON, lowBeamsOn);
}
public Boolean getLowBeamsOn() {
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Image.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Image.java index 8182fc43c..bab596543 100644 --- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Image.java +++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/Image.java @@ -1,5 +1,7 @@ package com.smartdevicelink.proxy.rpc;
+import android.support.annotation.NonNull;
+
import com.smartdevicelink.proxy.RPCStruct;
import com.smartdevicelink.proxy.rpc.enums.ImageType;
@@ -51,12 +53,23 @@ public class Image extends RPCStruct { public Image(Hashtable<String, Object> hash) {
super(hash);
}
-
+
+ /**
+ * Constructs a newly allocated Image object
+ * @param value either the static hex icon value or the binary image file name identifier (sent by PutFile)
+ * @param imageType whether it is a static or dynamic image
+ */
+ public Image(@NonNull String value, @NonNull ImageType imageType) {
+ this();
+ setValue(value);
+ setImageType(imageType);
+ }
+
/**
* set either the static hex icon value or the binary image file name identifier (sent by PutFile)
* @param value either the static hex icon value or the binary image file name identifier (sent by PutFile)
*/
- public void setValue(String value) {
+ public void setValue(@NonNull String value) {
setValue(KEY_VALUE, value);
}
@@ -72,7 +85,7 @@ public class Image extends RPCStruct { * set the image type
* @param imageType whether it is a static or dynamic image
*/
- public void setImageType(ImageType imageType) {
+ public void setImageType(@NonNull ImageType imageType) {
setValue(KEY_IMAGE_TYPE, imageType);
}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ImageField.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ImageField.java index 1d3b32967..0dccc55cc 100644 --- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ImageField.java +++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ImageField.java @@ -1,5 +1,7 @@ package com.smartdevicelink.proxy.rpc;
+import android.support.annotation.NonNull;
+
import com.smartdevicelink.proxy.RPCStruct;
import com.smartdevicelink.proxy.rpc.enums.AmbientLightStatus;
import com.smartdevicelink.proxy.rpc.enums.FileType;
@@ -71,17 +73,24 @@ public class ImageField extends RPCStruct { public ImageField(Hashtable<String, Object> hash) {
super(hash);
}
+
+ public ImageField(@NonNull ImageFieldName name, @NonNull List<FileType> imageTypeSupported) {
+ this();
+ setName(name);
+ setImageTypeSupported(imageTypeSupported);
+ }
+
public ImageFieldName getName() {
return (ImageFieldName) getObject(ImageFieldName.class, KEY_NAME);
}
- public void setName( ImageFieldName name ) {
+ public void setName(@NonNull ImageFieldName name ) {
setValue(KEY_NAME, name);
}
@SuppressWarnings("unchecked")
public List<FileType> getImageTypeSupported() {
return (List<FileType>) getObject(FileType.class, KEY_IMAGE_TYPE_SUPPORTED);
}
- public void setImageTypeSupported( List<FileType> imageTypeSupported ) {
+ public void setImageTypeSupported(@NonNull List<FileType> imageTypeSupported ) {
setValue(KEY_IMAGE_TYPE_SUPPORTED, imageTypeSupported);
}
@SuppressWarnings("unchecked")
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ImageResolution.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ImageResolution.java index 5858a45d0..2eb69f652 100644 --- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ImageResolution.java +++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ImageResolution.java @@ -1,5 +1,7 @@ package com.smartdevicelink.proxy.rpc;
+import android.support.annotation.NonNull;
+
import com.smartdevicelink.proxy.RPCStruct;
import java.util.Hashtable;
@@ -60,8 +62,14 @@ public class ImageResolution extends RPCStruct { public ImageResolution(Hashtable<String, Object> hash) {
super(hash);
}
+
+ public ImageResolution(@NonNull Integer resolutionWidth, @NonNull Integer resolutionHeight) {
+ this();
+ setResolutionWidth(resolutionWidth);
+ setResolutionHeight(resolutionHeight);
+ }
- public void setResolutionWidth(Integer resolutionWidth) {
+ public void setResolutionWidth(@NonNull Integer resolutionWidth) {
setValue(KEY_RESOLUTION_WIDTH, resolutionWidth);
}
@@ -69,7 +77,7 @@ public class ImageResolution extends RPCStruct { return getInteger(KEY_RESOLUTION_WIDTH);
}
- public void setResolutionHeight(Integer resolutionHeight) {
+ public void setResolutionHeight(@NonNull Integer resolutionHeight) {
setValue(KEY_RESOLUTION_HEIGHT, resolutionHeight);
}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ListFilesResponse.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ListFilesResponse.java index f1f77a7df..911ae968b 100644 --- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ListFilesResponse.java +++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ListFilesResponse.java @@ -1,7 +1,10 @@ package com.smartdevicelink.proxy.rpc;
+import android.support.annotation.NonNull;
+
import com.smartdevicelink.protocol.enums.FunctionID;
import com.smartdevicelink.proxy.RPCResponse;
+import com.smartdevicelink.proxy.rpc.enums.Result;
import java.util.Hashtable;
import java.util.List;
@@ -24,6 +27,16 @@ public class ListFilesResponse extends RPCResponse { public ListFilesResponse(Hashtable<String, Object> hash) {
super(hash);
}
+ /**
+ * Constructs a new ListFilesResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public ListFilesResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
public void setFilenames(List<String> filenames) {
setParameters(KEY_FILENAMES, filenames);
}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/MenuParams.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/MenuParams.java index e096cb7df..841cf6b90 100644 --- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/MenuParams.java +++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/MenuParams.java @@ -1,5 +1,7 @@ package com.smartdevicelink.proxy.rpc;
+import android.support.annotation.NonNull;
+
import com.smartdevicelink.proxy.RPCStruct;
import java.util.Hashtable;
@@ -71,6 +73,14 @@ public class MenuParams extends RPCStruct { super(hash);
}
/**
+ * Constructs a newly allocated MenuParams object
+ * @param menuName the menu name
+ */
+ public MenuParams(@NonNull String menuName) {
+ this();
+ setMenuName(menuName);
+ }
+ /**
* Get the unique ID of an existing submenu to which a command will be added.
* If this element is not provided, the command will be added to the top level of the Command Menu.
* @return parentID Min: 0 Max: 2000000000
@@ -135,7 +145,7 @@ public class MenuParams extends RPCStruct { * @param menuName the menu name
*/
- public void setMenuName( String menuName ) {
+ public void setMenuName( @NonNull String menuName ) {
setValue(KEY_MENU_NAME, menuName);
}
}
diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ModuleData.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ModuleData.java index e04ab1ad5..9ae3f7fd3 100644 --- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ModuleData.java +++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/ModuleData.java @@ -1,7 +1,11 @@ package com.smartdevicelink.proxy.rpc; +import android.support.annotation.NonNull; + import com.smartdevicelink.proxy.RPCStruct; import com.smartdevicelink.proxy.rpc.enums.ModuleType; +import com.smartdevicelink.proxy.rpc.enums.Result; + import java.util.Hashtable; public class ModuleData extends RPCStruct{ @@ -16,6 +20,11 @@ public class ModuleData extends RPCStruct{ super(hash); } + public ModuleData(@NonNull ModuleType moduleType) { + this(); + setModuleType(moduleType); + } + /** * Sets the moduleType portion of the ModuleData class * @@ -23,7 +32,7 @@ public class ModuleData extends RPCStruct{ * The moduleType indicates which type of data should be changed and identifies which data object exists in this struct. * For example, if the moduleType is CLIMATE then a "climateControlData" should exist */ - public void setModuleType(ModuleType moduleType) { + public void setModuleType(@NonNull ModuleType moduleType) { setValue(KEY_MODULE_TYPE, moduleType); } diff --git a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/MyKey.java b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/MyKey.java index f17a6b54c..daa75e41e 100644 --- a/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/MyKey.java +++ b/sdl_android/src/main/java/com/smartdevicelink/proxy/rpc/MyKey.java @@ -1,5 +1,7 @@ package com.smartdevicelink.proxy.rpc;
+import android.support.annotation.NonNull;
+
import java.util.Hashtable;
import com.smartdevicelink.proxy.RPCStruct;
@@ -33,21 +35,29 @@ import com.smartdevicelink.proxy.rpc.enums.VehicleDataStatus; public class MyKey extends RPCStruct {
public static final String KEY_E_911_OVERRIDE = "e911Override";
/**
- * <p>
- * Constructs a new MyKey object indicated by the Hashtable
- * parameter
- * </p>
- *
- * @param hash
- * The Hashtable to use
+ * Constructs a new MyKey object indicated
*/
-
public MyKey() { }
+ /**
+ * <p>
+ * Constructs a new MyKey object indicated by the Hashtable
+ * parameter
+ * </p>
+ *
+ * @param hash
+ * The Hashtable to use
+ */
public MyKey(Hashtable<String, Object> hash) {
super(hash);
}
-
- public void setE911Override(VehicleDataStatus e911Override) {
+ /**
+ * Constructs a new MyKey object indicated
+ */
+ public MyKey(@NonNull VehicleDataStatus e911Override) {
+ this();
+ setE911Override(e911Override);
+ }
+ public void setE911Override(@NonNull VehicleDataStatus e911Override) {
setValue(KEY_E_911_OVERRIDE, e911Override);
}
public VehicleDataStatus getE911Override() {
|