diff options
author | kboskin <kboskin> | 2020-12-20 10:51:25 +0200 |
---|---|---|
committer | kboskin <kboskin> | 2020-12-20 10:51:25 +0200 |
commit | f75c83dd14d7de4788af636b54817a57aa21a495 (patch) | |
tree | 9a3e21e5e209b569d5ec143729391eda7cb2cb20 | |
parent | 2bb43495859bace60abdfcb071f70854224af556 (diff) | |
download | sdl_android-f75c83dd14d7de4788af636b54817a57aa21a495.tar.gz |
[0255]
- Fix tests
-rwxr-xr-x | android/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/MainActivity.java | 2 | ||||
-rw-r--r-- | android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DoorStatusTests.java | 4 | ||||
-rw-r--r-- | android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/GateStatusTests.java (renamed from android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/GateStatusTest.java) | 5 | ||||
-rw-r--r-- | android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RoofStatusTests.java | 4 | ||||
-rw-r--r-- | android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnVehicleDataTests.java | 3 | ||||
-rw-r--r-- | android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetVehicleDataResponseTests.java | 3 | ||||
-rw-r--r-- | base/src/main/java/com/smartdevicelink/proxy/rpc/BodyInformation.java | 846 |
7 files changed, 430 insertions, 437 deletions
diff --git a/android/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/MainActivity.java b/android/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/MainActivity.java index c6ed33123..43ad79ac7 100755 --- a/android/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/MainActivity.java +++ b/android/hello_sdl_android/src/main/java/com/sdl/hellosdlandroid/MainActivity.java @@ -31,7 +31,7 @@ public class MainActivity extends AppCompatActivity { @Override public boolean onOptionsItemSelected(MenuItem item) { - // Handle action bar item clicksere. The action bar will + // Handle action bar item clicks here. The action bar will // automatically handle clicks on the Home/Up button, so long // as you specify a parent activity in AndroidManifest.xml. int id = item.getItemId(); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DoorStatusTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DoorStatusTests.java index 80bc41c62..a657529d5 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DoorStatusTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/DoorStatusTests.java @@ -2,7 +2,6 @@ package com.smartdevicelink.test.rpc.datatypes; import com.smartdevicelink.marshal.JsonRPCMarshaller; import com.smartdevicelink.proxy.rpc.DoorStatus; -import com.smartdevicelink.proxy.rpc.GateStatus; import com.smartdevicelink.proxy.rpc.Grid; import com.smartdevicelink.proxy.rpc.RoofStatus; import com.smartdevicelink.proxy.rpc.enums.DoorStatusType; @@ -24,7 +23,6 @@ public class DoorStatusTests extends TestCase { @Override public void setUp() { msg = new DoorStatus(TestValues.GENERAL_GRID, TestValues.GENERAL_DOOR_STATUS_TYPE); - msg.setStatus(TestValues.GENERAL_DOOR_STATUS_TYPE); } public void testRpcValues() { @@ -34,7 +32,7 @@ public class DoorStatusTests extends TestCase { // Valid Tests assertTrue(Validator.validateGrid(msg.getLocation(), location)); - assertEquals(TestValues.MATCH, TestValues.GENERAL_DOOR_STATUS_TYPE, status); + assertEquals(TestValues.MATCH, TestValues.GENERAL_GRID, location); } public void testJson() { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/GateStatusTest.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/GateStatusTests.java index 22f984bb3..7bb8da021 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/GateStatusTest.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/GateStatusTests.java @@ -17,13 +17,12 @@ import org.json.JSONObject; import java.util.Hashtable; import java.util.Iterator; -public class GateStatusTest extends TestCase { +public class GateStatusTests extends TestCase { private GateStatus msg; @Override public void setUp() { msg = new GateStatus(TestValues.GENERAL_GRID, TestValues.GENERAL_DOOR_STATUS_TYPE); - msg.setStatus(TestValues.GENERAL_DOOR_STATUS_TYPE); } public void testRpcValues() { @@ -32,7 +31,7 @@ public class GateStatusTest extends TestCase { DoorStatusType status = msg.getStatus(); // Valid Tests - assertTrue(Validator.validateGrid(msg.getLocation(), location)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_GRID, location); assertEquals(TestValues.MATCH, TestValues.GENERAL_DOOR_STATUS_TYPE, status); } diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RoofStatusTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RoofStatusTests.java index 7b93a9b2f..5d30cdb15 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RoofStatusTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/datatypes/RoofStatusTests.java @@ -31,10 +31,12 @@ public class RoofStatusTests extends TestCase { // Test Values Grid location = msg.getLocation(); DoorStatusType status = msg.getStatus(); + WindowState windowState = msg.getState(); // Valid Tests - assertTrue(Validator.validateGrid(msg.getLocation(), location)); + assertEquals(TestValues.MATCH, TestValues.GENERAL_GRID, location); assertEquals(TestValues.MATCH, TestValues.GENERAL_DOOR_STATUS_TYPE, status); + assertEquals(TestValues.MATCH, TestValues.GENERAL_WINDOW_STATE, windowState); } public void testJson() { diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnVehicleDataTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnVehicleDataTests.java index 7cfa73e3c..cb60f7572 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnVehicleDataTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/notifications/OnVehicleDataTests.java @@ -320,9 +320,6 @@ public class OnVehicleDataTests extends BaseRpcTests { bodyInformationObj.put(BodyInformation.KEY_PARK_BRAKE_ACTIVE, VehicleDataHelper.BODY_INFORMATION_PARK_BRAKE); bodyInformationObj.put(BodyInformation.KEY_IGNITION_STABLE_STATUS, VehicleDataHelper.BODY_INFORMATION_IGNITION_STATUS); bodyInformationObj.put(BodyInformation.KEY_IGNITION_STATUS, VehicleDataHelper.BODY_INFORMATION_IGNITION_STABLE_STATUS); - bodyInformationObj.put(BodyInformation.KEY_ROOF_STATUSES, VehicleDataHelper.ROOF_STATUES); - bodyInformationObj.put(BodyInformation.KEY_GATE_STATUSES, VehicleDataHelper.GATE_STATUES); - bodyInformationObj.put(BodyInformation.KEY_DOOR_STATUSES, VehicleDataHelper.DOOR_STATUES); bodyInformationObj.put(BodyInformation.KEY_DRIVER_DOOR_AJAR, VehicleDataHelper.BODY_INFORMATION_DRIVER_AJAR); bodyInformationObj.put(BodyInformation.KEY_PASSENGER_DOOR_AJAR, VehicleDataHelper.BODY_INFORMATION_PASSENGER_AJAR); bodyInformationObj.put(BodyInformation.KEY_REAR_LEFT_DOOR_AJAR, VehicleDataHelper.BODY_INFORMATION_REAR_LEFT_AJAR); diff --git a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetVehicleDataResponseTests.java b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetVehicleDataResponseTests.java index 5a679af4a..606283cc7 100644 --- a/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetVehicleDataResponseTests.java +++ b/android/sdl_android/src/androidTest/java/com/smartdevicelink/test/rpc/responses/GetVehicleDataResponseTests.java @@ -202,9 +202,6 @@ public class GetVehicleDataResponseTests extends BaseRpcTests { bodyInformationObj.put(BodyInformation.KEY_IGNITION_STABLE_STATUS, VehicleDataHelper.BODY_INFORMATION_IGNITION_STATUS); bodyInformationObj.put(BodyInformation.KEY_IGNITION_STATUS, VehicleDataHelper.BODY_INFORMATION_IGNITION_STABLE_STATUS); bodyInformationObj.put(BodyInformation.KEY_DRIVER_DOOR_AJAR, VehicleDataHelper.BODY_INFORMATION_DRIVER_AJAR); - bodyInformationObj.put(BodyInformation.KEY_ROOF_STATUSES, VehicleDataHelper.ROOF_STATUES); - bodyInformationObj.put(BodyInformation.KEY_GATE_STATUSES, VehicleDataHelper.GATE_STATUES); - bodyInformationObj.put(BodyInformation.KEY_DOOR_STATUSES, VehicleDataHelper.DOOR_STATUES); bodyInformationObj.put(BodyInformation.KEY_PASSENGER_DOOR_AJAR, VehicleDataHelper.BODY_INFORMATION_PASSENGER_AJAR); bodyInformationObj.put(BodyInformation.KEY_REAR_LEFT_DOOR_AJAR, VehicleDataHelper.BODY_INFORMATION_REAR_LEFT_AJAR); bodyInformationObj.put(BodyInformation.KEY_REAR_RIGHT_DOOR_AJAR, VehicleDataHelper.BODY_INFORMATION_REAR_RIGHT_AJAR); diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/BodyInformation.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/BodyInformation.java index c6ab55e4b..a88dbcf79 100644 --- a/base/src/main/java/com/smartdevicelink/proxy/rpc/BodyInformation.java +++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/BodyInformation.java @@ -1,423 +1,423 @@ -/* - * 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 androidx.annotation.NonNull; - -import com.smartdevicelink.proxy.RPCStruct; -import com.smartdevicelink.proxy.rpc.enums.IgnitionStableStatus; -import com.smartdevicelink.proxy.rpc.enums.IgnitionStatus; - -import java.util.Hashtable; -import java.util.List; - -/** - * - * <p><b>Parameter List</b></p> - * <table border="1" rules="all"> - * <tr> - * <th>Param Name</th> - * <th>Type</th> - * <th>Description</th> - * <th>Required</th> - * <th>Notes</th> - * <th>Version Available</th> - * </tr> - * <tr> - * <td>parkBrakeActive</td> - * <td>Boolean</td> - * <td>References signal "PrkBrkActv_B_Actl".</td> - * <td>Y</td> - * <td></td> - * <td></td> - * </tr> - * <tr> - * <td>ignitionStableStatus</td> - * <td>IgnitionStableStatus</td> - * <td>References signal "Ignition_Switch_Stable". See IgnitionStableStatus.</td> - * <td>Y</td> - * <td></td> - * <td></td> - * </tr> - * <tr> - * <td>ignitionStatus</td> - * <td>IgnitionStatus</td> - * <td>References signal "Ignition_status". See IgnitionStatus.</td> - * <td>Y</td> - * <td></td> - * <td></td> - * </tr> - * <tr> - * <td>driverDoorAjar</td> - * <td>Boolean</td> - * <td>References signal "DrStatDrv_B_Actl". Deprecated starting with RPC Spec 7.1.0.</td> - * <td>N</td> - * <td></td> - * <td> - * @since SmartDeviceLink 2.0.0 - * @deprecated in SmartDeviceLink 7.1.0 - * </td> - * </tr> - * <tr> - * <td>passengerDoorAjar</td> - * <td>Boolean</td> - * <td>References signal "DrStatPsngr_B_Actl". Deprecated starting with RPC Spec 7.1.0.</td> - * <td>N</td> - * <td></td> - * <td> - * @since SmartDeviceLink 2.0.0 - * @deprecated in SmartDeviceLink 7.1.0 - * </td> - * </tr> - * <tr> - * <td>rearLeftDoorAjar</td> - * <td>Boolean</td> - * <td>References signal "DrStatRl_B_Actl". Deprecated starting with RPC Spec 7.1.0.</td> - * <td>N</td> - * <td></td> - * <td> - * @since SmartDeviceLink 2.0.0 - * @deprecated in SmartDeviceLink 7.1.0 - * </td> - * </tr> - * <tr> - * <td>rearRightDoorAjar</td> - * <td>Boolean</td> - * <td>References signal "DrStatRr_B_Actl". Deprecated starting with RPC Spec 7.1.0.</td> - * <td>N</td> - * <td></td> - * <td> - * @since SmartDeviceLink 2.0.0 - * @deprecated in SmartDeviceLink 7.1.0 - * </td> - * </tr> - * <tr> - * <td>doorStatuses</td> - * <td>List<DoorStatus></td> - * <td>Provides status for doors if Ajar/Closed/Locked</td> - * <td>N</td> - * <td>{"array_min_size": 0, "array_max_size": 100}</td> - * <td> - * @since SmartDeviceLink 7.1.0 - * </td> - * </tr> - * <tr> - * <td>gateStatuses</td> - * <td>List<GateStatus></td> - * <td>Provides status for trunk/hood/etc. if Ajar/Closed/Locked</td> - * <td>N</td> - * <td>{"array_min_size": 0, "array_max_size": 100}</td> - * <td> - * @since SmartDeviceLink 7.1.0 - * </td> - * </tr> - * <tr> - * <td>roofStatuses</td> - * <td>List<RoofStatus></td> - * <td>Provides status for roof/convertible roof/sunroof/moonroof etc., if Closed/Ajar/Removedetc.</td> - * <td>N</td> - * <td>{"array_min_size": 0, "array_max_size": 100}</td> - * <td> - * @since SmartDeviceLink 7.1.0 - * </td> - * </tr> - * </table> - * - * @see SubscribeVehicleData - * @see GetVehicleData - * @see OnVehicleData - * @since SmartDeviceLink 2.0 - */ - -public class BodyInformation extends RPCStruct { - public static final String KEY_PARK_BRAKE_ACTIVE = "parkBrakeActive"; - public static final String KEY_IGNITION_STABLE_STATUS = "ignitionStableStatus"; - public static final String KEY_IGNITION_STATUS = "ignitionStatus"; - /** - * @since SmartDeviceLink 2.0.0 - * @deprecated in SmartDeviceLink 7.1.0 - */ - @Deprecated - public static final String KEY_DRIVER_DOOR_AJAR = "driverDoorAjar"; - /** - * @since SmartDeviceLink 2.0.0 - * @deprecated in SmartDeviceLink 7.1.0 - */ - @Deprecated - public static final String KEY_PASSENGER_DOOR_AJAR = "passengerDoorAjar"; - /** - * @since SmartDeviceLink 2.0.0 - * @deprecated in SmartDeviceLink 7.1.0 - */ - @Deprecated - public static final String KEY_REAR_LEFT_DOOR_AJAR = "rearLeftDoorAjar"; - /** - * @since SmartDeviceLink 2.0.0 - * @deprecated in SmartDeviceLink 7.1.0 - */ - @Deprecated - public static final String KEY_REAR_RIGHT_DOOR_AJAR = "rearRightDoorAjar"; - /** - * @since SmartDeviceLink 7.1.0 - */ - public static final String KEY_DOOR_STATUSES = "doorStatuses"; - /** - * @since SmartDeviceLink 7.1.0 - */ - public static final String KEY_GATE_STATUSES = "gateStatuses"; - /** - * @since SmartDeviceLink 7.1.0 - */ - public static final String KEY_ROOF_STATUSES = "roofStatuses"; - - public BodyInformation() { - } - - /** - * Constructs a new BodyInformation object indicated by the Hashtable - * parameter - * - * @param hash hashtable filled with params to create an instance of this RPC - * The hash table to use - */ - public BodyInformation(Hashtable<String, Object> hash) { - super(hash); - } - - public BodyInformation(@NonNull Boolean parkBrakeActive, @NonNull IgnitionStableStatus ignitionStableStatus, @NonNull IgnitionStatus ignitionStatus) { - this(); - setParkBrakeActive(parkBrakeActive); - setIgnitionStableStatus(ignitionStableStatus); - setIgnitionStatus(ignitionStatus); - } - - public BodyInformation setParkBrakeActive(@NonNull Boolean parkBrakeActive) { - setValue(KEY_PARK_BRAKE_ACTIVE, parkBrakeActive); - return this; - } - - public Boolean getParkBrakeActive() { - return getBoolean(KEY_PARK_BRAKE_ACTIVE); - } - - public BodyInformation setIgnitionStableStatus(@NonNull IgnitionStableStatus ignitionStableStatus) { - setValue(KEY_IGNITION_STABLE_STATUS, ignitionStableStatus); - return this; - } - - public IgnitionStableStatus getIgnitionStableStatus() { - return (IgnitionStableStatus) getObject(IgnitionStableStatus.class, KEY_IGNITION_STABLE_STATUS); - } - - public BodyInformation setIgnitionStatus(@NonNull IgnitionStatus ignitionStatus) { - setValue(KEY_IGNITION_STATUS, ignitionStatus); - return this; - } - - public IgnitionStatus getIgnitionStatus() { - return (IgnitionStatus) getObject(IgnitionStatus.class, KEY_IGNITION_STATUS); - } - - /** - * Sets the driverDoorAjar. - * - * @param driverDoorAjar References signal "DrStatDrv_B_Actl". Deprecated starting with RPC Spec 7.1.0. - * @since SmartDeviceLink 2.0.0 - * @deprecated in SmartDeviceLink 7.1.0 - */ - @Deprecated - public BodyInformation setDriverDoorAjar(Boolean driverDoorAjar) { - setValue(KEY_DRIVER_DOOR_AJAR, driverDoorAjar); - return this; - } - - /** - * Gets the driverDoorAjar. - * - * @return Boolean References signal "DrStatDrv_B_Actl". Deprecated starting with RPC Spec 7.1.0. - * @since SmartDeviceLink 2.0.0 - * @deprecated in SmartDeviceLink 7.1.0 - */ - @Deprecated - public Boolean getDriverDoorAjar() { - return getBoolean(KEY_DRIVER_DOOR_AJAR); - } - - /** - * Sets the passengerDoorAjar. - * - * @param passengerDoorAjar References signal "DrStatPsngr_B_Actl". Deprecated starting with RPC Spec 7.1.0. - * @since SmartDeviceLink 2.0.0 - * @deprecated in SmartDeviceLink 7.1.0 - */ - @Deprecated - public BodyInformation setPassengerDoorAjar(Boolean passengerDoorAjar) { - setValue(KEY_PASSENGER_DOOR_AJAR, passengerDoorAjar); - return this; - } - - /** - * Gets the passengerDoorAjar. - * - * @return Boolean References signal "DrStatPsngr_B_Actl". Deprecated starting with RPC Spec 7.1.0. - * @since SmartDeviceLink 2.0.0 - * @deprecated in SmartDeviceLink 7.1.0 - */ - @Deprecated - public Boolean getPassengerDoorAjar() { - return getBoolean(KEY_PASSENGER_DOOR_AJAR); - } - - /** - * Sets the rearLeftDoorAjar. - * - * @param rearLeftDoorAjar References signal "DrStatRl_B_Actl". Deprecated starting with RPC Spec 7.1.0. - * @since SmartDeviceLink 2.0.0 - * @deprecated in SmartDeviceLink 7.1.0 - */ - @Deprecated - public BodyInformation setRearLeftDoorAjar(Boolean rearLeftDoorAjar) { - setValue(KEY_REAR_LEFT_DOOR_AJAR, rearLeftDoorAjar); - return this; - } - - /** - * Gets the rearLeftDoorAjar. - * - * @return Boolean References signal "DrStatRl_B_Actl". Deprecated starting with RPC Spec 7.1.0. - * @since SmartDeviceLink 2.0.0 - * @deprecated in SmartDeviceLink 7.1.0 - */ - @Deprecated - public Boolean getRearLeftDoorAjar() { - return getBoolean(KEY_REAR_LEFT_DOOR_AJAR); - } - - /** - * Sets the rearRightDoorAjar. - * - * @param rearRightDoorAjar References signal "DrStatRr_B_Actl". Deprecated starting with RPC Spec 7.1.0. - * @since SmartDeviceLink 2.0.0 - * @deprecated in SmartDeviceLink 7.1.0 - */ - @Deprecated - public BodyInformation setRearRightDoorAjar(Boolean rearRightDoorAjar) { - setValue(KEY_REAR_RIGHT_DOOR_AJAR, rearRightDoorAjar); - return this; - } - - /** - * Gets the rearRightDoorAjar. - * - * @return Boolean References signal "DrStatRr_B_Actl". Deprecated starting with RPC Spec 7.1.0. - * @since SmartDeviceLink 2.0.0 - * @deprecated in SmartDeviceLink 7.1.0 - */ - @Deprecated - public Boolean getRearRightDoorAjar() { - return getBoolean(KEY_REAR_RIGHT_DOOR_AJAR); - } - - /** - * Sets the doorStatuses. - * - * @param doorStatuses Provides status for doors if Ajar/Closed/Locked - * {"array_min_size": 0, "array_max_size": 100} - * @since SmartDeviceLink 7.1.0 - */ - public BodyInformation setDoorStatuses(List<DoorStatus> doorStatuses) { - setValue(KEY_DOOR_STATUSES, doorStatuses); - return this; - } - - /** - * Gets the doorStatuses. - * - * @return List<DoorStatus> Provides status for doors if Ajar/Closed/Locked - * {"array_min_size": 0, "array_max_size": 100} - * @since SmartDeviceLink 7.1.0 - */ - @SuppressWarnings("unchecked") - public List<DoorStatus> getDoorStatuses() { - return (List<DoorStatus>) getObject(DoorStatus.class, KEY_DOOR_STATUSES); - } - - /** - * Sets the gateStatuses. - * - * @param gateStatuses Provides status for trunk/hood/etc. if Ajar/Closed/Locked - * {"array_min_size": 0, "array_max_size": 100} - * @since SmartDeviceLink 7.1.0 - */ - public BodyInformation setGateStatuses(List<GateStatus> gateStatuses) { - setValue(KEY_GATE_STATUSES, gateStatuses); - return this; - } - - /** - * Gets the gateStatuses. - * - * @return List<GateStatus> Provides status for trunk/hood/etc. if Ajar/Closed/Locked - * {"array_min_size": 0, "array_max_size": 100} - * @since SmartDeviceLink 7.1.0 - */ - @SuppressWarnings("unchecked") - public List<GateStatus> getGateStatuses() { - return (List<GateStatus>) getObject(GateStatus.class, KEY_GATE_STATUSES); - } - - /** - * Sets the roofStatuses. - * - * @param roofStatuses Provides status for roof/convertible roof/sunroof/moonroof etc., if Closed/Ajar/Removed - * etc. - * {"array_min_size": 0, "array_max_size": 100} - * @since SmartDeviceLink 7.1.0 - */ - public BodyInformation setRoofStatuses(List<RoofStatus> roofStatuses) { - setValue(KEY_ROOF_STATUSES, roofStatuses); - return this; - } - - /** - * Gets the roofStatuses. - * - * @return List<RoofStatus> Provides status for roof/convertible roof/sunroof/moonroof etc., if Closed/Ajar/Removed - * etc. - * {"array_min_size": 0, "array_max_size": 100} - * @since SmartDeviceLink 7.1.0 - */ - @SuppressWarnings("unchecked") - public List<RoofStatus> getRoofStatuses() { - return (List<RoofStatus>) getObject(RoofStatus.class, KEY_ROOF_STATUSES); - } -} +/*
+ * 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 androidx.annotation.NonNull;
+
+import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.IgnitionStableStatus;
+import com.smartdevicelink.proxy.rpc.enums.IgnitionStatus;
+
+import java.util.Hashtable;
+import java.util.List;
+
+/**
+ *
+ * <p><b>Parameter List</b></p>
+ * <table border="1" rules="all">
+ * <tr>
+ * <th>Param Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>Required</th>
+ * <th>Notes</th>
+ * <th>Version Available</th>
+ * </tr>
+ * <tr>
+ * <td>parkBrakeActive</td>
+ * <td>Boolean</td>
+ * <td>References signal "PrkBrkActv_B_Actl".</td>
+ * <td>Y</td>
+ * <td></td>
+ * <td></td>
+ * </tr>
+ * <tr>
+ * <td>ignitionStableStatus</td>
+ * <td>IgnitionStableStatus</td>
+ * <td>References signal "Ignition_Switch_Stable". See IgnitionStableStatus.</td>
+ * <td>Y</td>
+ * <td></td>
+ * <td></td>
+ * </tr>
+ * <tr>
+ * <td>ignitionStatus</td>
+ * <td>IgnitionStatus</td>
+ * <td>References signal "Ignition_status". See IgnitionStatus.</td>
+ * <td>Y</td>
+ * <td></td>
+ * <td></td>
+ * </tr>
+ * <tr>
+ * <td>driverDoorAjar</td>
+ * <td>Boolean</td>
+ * <td>References signal "DrStatDrv_B_Actl". Deprecated starting with RPC Spec 7.1.0.</td>
+ * <td>N</td>
+ * <td></td>
+ * <td>
+ * @since SmartDeviceLink 2.0.0
+ * @deprecated in SmartDeviceLink 7.1.0
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>passengerDoorAjar</td>
+ * <td>Boolean</td>
+ * <td>References signal "DrStatPsngr_B_Actl". Deprecated starting with RPC Spec 7.1.0.</td>
+ * <td>N</td>
+ * <td></td>
+ * <td>
+ * @since SmartDeviceLink 2.0.0
+ * @deprecated in SmartDeviceLink 7.1.0
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>rearLeftDoorAjar</td>
+ * <td>Boolean</td>
+ * <td>References signal "DrStatRl_B_Actl". Deprecated starting with RPC Spec 7.1.0.</td>
+ * <td>N</td>
+ * <td></td>
+ * <td>
+ * @since SmartDeviceLink 2.0.0
+ * @deprecated in SmartDeviceLink 7.1.0
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>rearRightDoorAjar</td>
+ * <td>Boolean</td>
+ * <td>References signal "DrStatRr_B_Actl". Deprecated starting with RPC Spec 7.1.0.</td>
+ * <td>N</td>
+ * <td></td>
+ * <td>
+ * @since SmartDeviceLink 2.0.0
+ * @deprecated in SmartDeviceLink 7.1.0
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>doorStatuses</td>
+ * <td>List<DoorStatus></td>
+ * <td>Provides status for doors if Ajar/Closed/Locked</td>
+ * <td>N</td>
+ * <td>{"array_min_size": 0, "array_max_size": 100}</td>
+ * <td>
+ * @since SmartDeviceLink 7.1.0
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>gateStatuses</td>
+ * <td>List<GateStatus></td>
+ * <td>Provides status for trunk/hood/etc. if Ajar/Closed/Locked</td>
+ * <td>N</td>
+ * <td>{"array_min_size": 0, "array_max_size": 100}</td>
+ * <td>
+ * @since SmartDeviceLink 7.1.0
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>roofStatuses</td>
+ * <td>List<RoofStatus></td>
+ * <td>Provides status for roof/convertible roof/sunroof/moonroof etc., if Closed/Ajar/Removedetc.</td>
+ * <td>N</td>
+ * <td>{"array_min_size": 0, "array_max_size": 100}</td>
+ * <td>
+ * @since SmartDeviceLink 7.1.0
+ * </td>
+ * </tr>
+ * </table>
+ *
+ * @see SubscribeVehicleData
+ * @see GetVehicleData
+ * @see OnVehicleData
+ * @since SmartDeviceLink 2.0
+ */
+
+public class BodyInformation extends RPCStruct {
+ public static final String KEY_PARK_BRAKE_ACTIVE = "parkBrakeActive";
+ public static final String KEY_IGNITION_STABLE_STATUS = "ignitionStableStatus";
+ public static final String KEY_IGNITION_STATUS = "ignitionStatus";
+ /**
+ * @since SmartDeviceLink 2.0.0
+ * @deprecated in SmartDeviceLink 7.1.0
+ */
+ @Deprecated
+ public static final String KEY_DRIVER_DOOR_AJAR = "driverDoorAjar";
+ /**
+ * @since SmartDeviceLink 2.0.0
+ * @deprecated in SmartDeviceLink 7.1.0
+ */
+ @Deprecated
+ public static final String KEY_PASSENGER_DOOR_AJAR = "passengerDoorAjar";
+ /**
+ * @since SmartDeviceLink 2.0.0
+ * @deprecated in SmartDeviceLink 7.1.0
+ */
+ @Deprecated
+ public static final String KEY_REAR_LEFT_DOOR_AJAR = "rearLeftDoorAjar";
+ /**
+ * @since SmartDeviceLink 2.0.0
+ * @deprecated in SmartDeviceLink 7.1.0
+ */
+ @Deprecated
+ public static final String KEY_REAR_RIGHT_DOOR_AJAR = "rearRightDoorAjar";
+ /**
+ * @since SmartDeviceLink 7.1.0
+ */
+ public static final String KEY_DOOR_STATUSES = "doorStatuses";
+ /**
+ * @since SmartDeviceLink 7.1.0
+ */
+ public static final String KEY_GATE_STATUSES = "gateStatuses";
+ /**
+ * @since SmartDeviceLink 7.1.0
+ */
+ public static final String KEY_ROOF_STATUSES = "roofStatuses";
+
+ public BodyInformation() {
+ }
+
+ /**
+ * Constructs a new BodyInformation object indicated by the Hashtable
+ * parameter
+ *
+ * @param hash hashtable filled with params to create an instance of this RPC
+ * The hash table to use
+ */
+ public BodyInformation(Hashtable<String, Object> hash) {
+ super(hash);
+ }
+
+ public BodyInformation(@NonNull Boolean parkBrakeActive, @NonNull IgnitionStableStatus ignitionStableStatus, @NonNull IgnitionStatus ignitionStatus) {
+ this();
+ setParkBrakeActive(parkBrakeActive);
+ setIgnitionStableStatus(ignitionStableStatus);
+ setIgnitionStatus(ignitionStatus);
+ }
+
+ public BodyInformation setParkBrakeActive(@NonNull Boolean parkBrakeActive) {
+ setValue(KEY_PARK_BRAKE_ACTIVE, parkBrakeActive);
+ return this;
+ }
+
+ public Boolean getParkBrakeActive() {
+ return getBoolean(KEY_PARK_BRAKE_ACTIVE);
+ }
+
+ public BodyInformation setIgnitionStableStatus(@NonNull IgnitionStableStatus ignitionStableStatus) {
+ setValue(KEY_IGNITION_STABLE_STATUS, ignitionStableStatus);
+ return this;
+ }
+
+ public IgnitionStableStatus getIgnitionStableStatus() {
+ return (IgnitionStableStatus) getObject(IgnitionStableStatus.class, KEY_IGNITION_STABLE_STATUS);
+ }
+
+ public BodyInformation setIgnitionStatus(@NonNull IgnitionStatus ignitionStatus) {
+ setValue(KEY_IGNITION_STATUS, ignitionStatus);
+ return this;
+ }
+
+ public IgnitionStatus getIgnitionStatus() {
+ return (IgnitionStatus) getObject(IgnitionStatus.class, KEY_IGNITION_STATUS);
+ }
+
+ /**
+ * Sets the driverDoorAjar.
+ *
+ * @param driverDoorAjar References signal "DrStatDrv_B_Actl". Deprecated starting with RPC Spec 7.1.0.
+ * @since SmartDeviceLink 2.0.0
+ * @deprecated in SmartDeviceLink 7.1.0
+ */
+ @Deprecated
+ public BodyInformation setDriverDoorAjar(Boolean driverDoorAjar) {
+ setValue(KEY_DRIVER_DOOR_AJAR, driverDoorAjar);
+ return this;
+ }
+
+ /**
+ * Gets the driverDoorAjar.
+ *
+ * @return Boolean References signal "DrStatDrv_B_Actl". Deprecated starting with RPC Spec 7.1.0.
+ * @since SmartDeviceLink 2.0.0
+ * @deprecated in SmartDeviceLink 7.1.0
+ */
+ @Deprecated
+ public Boolean getDriverDoorAjar() {
+ return getBoolean(KEY_DRIVER_DOOR_AJAR);
+ }
+
+ /**
+ * Sets the passengerDoorAjar.
+ *
+ * @param passengerDoorAjar References signal "DrStatPsngr_B_Actl". Deprecated starting with RPC Spec 7.1.0.
+ * @since SmartDeviceLink 2.0.0
+ * @deprecated in SmartDeviceLink 7.1.0
+ */
+ @Deprecated
+ public BodyInformation setPassengerDoorAjar(Boolean passengerDoorAjar) {
+ setValue(KEY_PASSENGER_DOOR_AJAR, passengerDoorAjar);
+ return this;
+ }
+
+ /**
+ * Gets the passengerDoorAjar.
+ *
+ * @return Boolean References signal "DrStatPsngr_B_Actl". Deprecated starting with RPC Spec 7.1.0.
+ * @since SmartDeviceLink 2.0.0
+ * @deprecated in SmartDeviceLink 7.1.0
+ */
+ @Deprecated
+ public Boolean getPassengerDoorAjar() {
+ return getBoolean(KEY_PASSENGER_DOOR_AJAR);
+ }
+
+ /**
+ * Sets the rearLeftDoorAjar.
+ *
+ * @param rearLeftDoorAjar References signal "DrStatRl_B_Actl". Deprecated starting with RPC Spec 7.1.0.
+ * @since SmartDeviceLink 2.0.0
+ * @deprecated in SmartDeviceLink 7.1.0
+ */
+ @Deprecated
+ public BodyInformation setRearLeftDoorAjar(Boolean rearLeftDoorAjar) {
+ setValue(KEY_REAR_LEFT_DOOR_AJAR, rearLeftDoorAjar);
+ return this;
+ }
+
+ /**
+ * Gets the rearLeftDoorAjar.
+ *
+ * @return Boolean References signal "DrStatRl_B_Actl". Deprecated starting with RPC Spec 7.1.0.
+ * @since SmartDeviceLink 2.0.0
+ * @deprecated in SmartDeviceLink 7.1.0
+ */
+ @Deprecated
+ public Boolean getRearLeftDoorAjar() {
+ return getBoolean(KEY_REAR_LEFT_DOOR_AJAR);
+ }
+
+ /**
+ * Sets the rearRightDoorAjar.
+ *
+ * @param rearRightDoorAjar References signal "DrStatRr_B_Actl". Deprecated starting with RPC Spec 7.1.0.
+ * @since SmartDeviceLink 2.0.0
+ * @deprecated in SmartDeviceLink 7.1.0
+ */
+ @Deprecated
+ public BodyInformation setRearRightDoorAjar(Boolean rearRightDoorAjar) {
+ setValue(KEY_REAR_RIGHT_DOOR_AJAR, rearRightDoorAjar);
+ return this;
+ }
+
+ /**
+ * Gets the rearRightDoorAjar.
+ *
+ * @return Boolean References signal "DrStatRr_B_Actl". Deprecated starting with RPC Spec 7.1.0.
+ * @since SmartDeviceLink 2.0.0
+ * @deprecated in SmartDeviceLink 7.1.0
+ */
+ @Deprecated
+ public Boolean getRearRightDoorAjar() {
+ return getBoolean(KEY_REAR_RIGHT_DOOR_AJAR);
+ }
+
+ /**
+ * Sets the doorStatuses.
+ *
+ * @param doorStatuses Provides status for doors if Ajar/Closed/Locked
+ * {"array_min_size": 0, "array_max_size": 100}
+ * @since SmartDeviceLink 7.1.0
+ */
+ public BodyInformation setDoorStatuses(List<DoorStatus> doorStatuses) {
+ setValue(KEY_DOOR_STATUSES, doorStatuses);
+ return this;
+ }
+
+ /**
+ * Gets the doorStatuses.
+ *
+ * @return List<DoorStatus> Provides status for doors if Ajar/Closed/Locked
+ * {"array_min_size": 0, "array_max_size": 100}
+ * @since SmartDeviceLink 7.1.0
+ */
+ @SuppressWarnings("unchecked")
+ public List<DoorStatus> getDoorStatuses() {
+ return (List<DoorStatus>) getObject(DoorStatus.class, KEY_DOOR_STATUSES);
+ }
+
+ /**
+ * Sets the gateStatuses.
+ *
+ * @param gateStatuses Provides status for trunk/hood/etc. if Ajar/Closed/Locked
+ * {"array_min_size": 0, "array_max_size": 100}
+ * @since SmartDeviceLink 7.1.0
+ */
+ public BodyInformation setGateStatuses(List<GateStatus> gateStatuses) {
+ setValue(KEY_GATE_STATUSES, gateStatuses);
+ return this;
+ }
+
+ /**
+ * Gets the gateStatuses.
+ *
+ * @return List<GateStatus> Provides status for trunk/hood/etc. if Ajar/Closed/Locked
+ * {"array_min_size": 0, "array_max_size": 100}
+ * @since SmartDeviceLink 7.1.0
+ */
+ @SuppressWarnings("unchecked")
+ public List<GateStatus> getGateStatuses() {
+ return (List<GateStatus>) getObject(GateStatus.class, KEY_GATE_STATUSES);
+ }
+
+ /**
+ * Sets the roofStatuses.
+ *
+ * @param roofStatuses Provides status for roof/convertible roof/sunroof/moonroof etc., if Closed/Ajar/Removed
+ * etc.
+ * {"array_min_size": 0, "array_max_size": 100}
+ * @since SmartDeviceLink 7.1.0
+ */
+ public BodyInformation setRoofStatuses(List<RoofStatus> roofStatuses) {
+ setValue(KEY_ROOF_STATUSES, roofStatuses);
+ return this;
+ }
+
+ /**
+ * Gets the roofStatuses.
+ *
+ * @return List<RoofStatus> Provides status for roof/convertible roof/sunroof/moonroof etc., if Closed/Ajar/Removed
+ * etc.
+ * {"array_min_size": 0, "array_max_size": 100}
+ * @since SmartDeviceLink 7.1.0
+ */
+ @SuppressWarnings("unchecked")
+ public List<RoofStatus> getRoofStatuses() {
+ return (List<RoofStatus>) getObject(RoofStatus.class, KEY_ROOF_STATUSES);
+ }
+}
|