summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrettyWhite <geekman3454@protonmail.com>2019-10-01 11:12:01 -0400
committerBrettyWhite <geekman3454@protonmail.com>2019-10-01 11:12:01 -0400
commit45d74c5810784942d6834e21ad26c94ca0385180 (patch)
tree829f8fea1436d128677e0431e999fdac0818de3c
parent91524a90b93177995a1fc1080f3958c926188688 (diff)
downloadsdl_android-45d74c5810784942d6834e21ad26c94ca0385180.tar.gz
deprecate old constructors and remove non required paramsfeature/update_rpc_params
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/DiagnosticMessageResponse.java78
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCsResponse.java77
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataResponse.java16
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapabilityResponse.java15
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/SetInteriorVehicleDataResponse.java15
5 files changed, 133 insertions, 68 deletions
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/DiagnosticMessageResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/DiagnosticMessageResponse.java
index bd8c5599c..53b7a32e0 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/DiagnosticMessageResponse.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/DiagnosticMessageResponse.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
package com.smartdevicelink.proxy.rpc;
import android.support.annotation.NonNull;
@@ -61,19 +61,33 @@ public class DiagnosticMessageResponse extends RPCResponse {
* Constructs a new DiagnosticMessageResponse object
* @param success whether the request is successfully processed
* @param resultCode whether the request is successfully processed
+ * @deprecated use {@link DiagnosticMessageResponse#DiagnosticMessageResponse(Boolean, Result)}
*/
+ @Deprecated
public DiagnosticMessageResponse(@NonNull Boolean success, @NonNull Result resultCode, @NonNull List<Integer> messageDataResult) {
this();
setSuccess(success);
setResultCode(resultCode);
setMessageDataResult(messageDataResult);
}
+
+ /**
+ * Constructs a new DiagnosticMessageResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public DiagnosticMessageResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+
@SuppressWarnings("unchecked")
public List<Integer> getMessageDataResult() {
return (List<Integer>) getObject(Integer.class, KEY_MESSAGE_DATA_RESULT);
}
- public void setMessageDataResult(@NonNull List<Integer> messageDataResult) {
+ public void setMessageDataResult(List<Integer> messageDataResult) {
setParameters(KEY_MESSAGE_DATA_RESULT, messageDataResult);
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCsResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCsResponse.java
index be970cc39..a0de6de5c 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCsResponse.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetDTCsResponse.java
@@ -1,34 +1,34 @@
-/*
- * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice, this
- * list of conditions and the following disclaimer.
- *
- * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following
- * disclaimer in the documentation and/or other materials provided with the
- * distribution.
- *
- * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from this
- * software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
+/*
+ * Copyright (c) 2017 - 2019, SmartDeviceLink Consortium, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * Neither the name of the SmartDeviceLink Consortium, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
package com.smartdevicelink.proxy.rpc;
import android.support.annotation.NonNull;
@@ -63,7 +63,9 @@ public class GetDTCsResponse extends RPCResponse{
* @param success whether the request is successfully processed
* @param resultCode whether the request is successfully processed
* @param ecuHeader representation of the ecu header that was returned from the GetDTC request
+ * @deprecated use {@link GetDTCsResponse#GetDTCsResponse(Boolean, Result)}
*/
+ @Deprecated
public GetDTCsResponse(@NonNull Boolean success, @NonNull Result resultCode, @NonNull Integer ecuHeader) {
this();
setSuccess(success);
@@ -71,6 +73,17 @@ public class GetDTCsResponse extends RPCResponse{
setEcuHeader(ecuHeader);
}
+ /**
+ * Constructs a new GetDTCsResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public GetDTCsResponse(@NonNull Boolean success, @NonNull Result resultCode) {
+ this();
+ setSuccess(success);
+ setResultCode(resultCode);
+ }
+
@SuppressWarnings("unchecked")
public List<String> getDtc(){
return (List<String>) getObject(String.class, KEY_DTC);
@@ -84,7 +97,7 @@ public class GetDTCsResponse extends RPCResponse{
return getInteger(KEY_ECU_HEADER);
}
- public void setEcuHeader(@NonNull Integer ecuHeader){
+ public void setEcuHeader(Integer ecuHeader){
setParameters(KEY_ECU_HEADER, ecuHeader);
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataResponse.java
index 6c27b8b37..7a85ac129 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataResponse.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetInteriorVehicleDataResponse.java
@@ -67,9 +67,10 @@ public class GetInteriorVehicleDataResponse extends RPCResponse {
* @param moduleData specific data for the module that was requested
* @param resultCode whether the request is successfully processed
* @param success whether the request is successfully processed
-
+ * @deprecated use {@link GetInteriorVehicleDataResponse#GetInteriorVehicleDataResponse(Result, Boolean)}
*/
- public GetInteriorVehicleDataResponse( @NonNull ModuleData moduleData, @NonNull Result resultCode, @NonNull Boolean success) {
+ @Deprecated
+ public GetInteriorVehicleDataResponse(@NonNull ModuleData moduleData, @NonNull Result resultCode, @NonNull Boolean success) {
this();
setModuleData(moduleData);
setResultCode(resultCode);
@@ -77,6 +78,17 @@ public class GetInteriorVehicleDataResponse extends RPCResponse {
}
/**
+ * Constructs a new GetInteriorVehicleDataResponse object
+ * @param resultCode whether the request is successfully processed
+ * @param success whether the request is successfully processed
+ */
+ public GetInteriorVehicleDataResponse(@NonNull Result resultCode, @NonNull Boolean success) {
+ this();
+ setResultCode(resultCode);
+ setSuccess(success);
+ }
+
+ /**
* Gets the moduleData
*
* @return ModuleData
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapabilityResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapabilityResponse.java
index 8029e77e2..f324de95f 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapabilityResponse.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/GetSystemCapabilityResponse.java
@@ -69,7 +69,9 @@ public class GetSystemCapabilityResponse extends RPCResponse {
* @param systemCapability SystemCapability object
* @param resultCode whether the request is successfully processed
* @param success whether the request is successfully processed
+ * @deprecated use {@link GetSystemCapabilityResponse#GetSystemCapabilityResponse(Result, Boolean)}
*/
+ @Deprecated
public GetSystemCapabilityResponse(@NonNull SystemCapability systemCapability, @NonNull Result resultCode, @NonNull Boolean success) {
this();
setSystemCapability(systemCapability);
@@ -78,6 +80,17 @@ public class GetSystemCapabilityResponse extends RPCResponse {
}
/**
+ * Constructs a new GetSystemCapabilityResponse object
+ * @param resultCode whether the request is successfully processed
+ * @param success whether the request is successfully processed
+ */
+ public GetSystemCapabilityResponse(@NonNull Result resultCode, @NonNull Boolean success) {
+ this();
+ setResultCode(resultCode);
+ setSuccess(success);
+ }
+
+ /**
* Get the SystemCapability object returned after a GetSystemCapability call
* @return SystemCapability object
*/
@@ -89,7 +102,7 @@ public class GetSystemCapabilityResponse extends RPCResponse {
* Set a SystemCapability object in the response
* @param value SystemCapability object
*/
- public void setSystemCapability(@NonNull SystemCapability value){
+ public void setSystemCapability(SystemCapability value){
setParameters(KEY_SYSTEM_CAPABILITY, value);
}
}
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetInteriorVehicleDataResponse.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetInteriorVehicleDataResponse.java
index 072aac498..1e756ade9 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/SetInteriorVehicleDataResponse.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/SetInteriorVehicleDataResponse.java
@@ -66,7 +66,9 @@ public class SetInteriorVehicleDataResponse extends RPCResponse {
* @param moduleData
* @param success whether the request is successfully processed
* @param resultCode whether the request is successfully processed
+ * @deprecated use {@link SetInteriorVehicleDataResponse#SetInteriorVehicleDataResponse(Result, Boolean)}
*/
+ @Deprecated
public SetInteriorVehicleDataResponse(@NonNull ModuleData moduleData, @NonNull Result resultCode, @NonNull Boolean success) {
this();
setModuleData(moduleData);
@@ -75,6 +77,17 @@ public class SetInteriorVehicleDataResponse extends RPCResponse {
}
/**
+ * Constructs a new SetInteriorVehicleDataResponse object
+ * @param success whether the request is successfully processed
+ * @param resultCode whether the request is successfully processed
+ */
+ public SetInteriorVehicleDataResponse(@NonNull Result resultCode, @NonNull Boolean success) {
+ this();
+ setResultCode(resultCode);
+ setSuccess(success);
+ }
+
+ /**
* Gets the moduleData
*
* @return ModuleData
@@ -88,7 +101,7 @@ public class SetInteriorVehicleDataResponse extends RPCResponse {
*
* @param moduleData
*/
- public void setModuleData(@NonNull ModuleData moduleData) {
+ public void setModuleData(ModuleData moduleData) {
setParameters(KEY_MODULE_DATA, moduleData);
}
}