summaryrefslogtreecommitdiff
path: root/base/src/main/java/com/smartdevicelink/proxy/rpc/TireStatus.java
diff options
context:
space:
mode:
Diffstat (limited to 'base/src/main/java/com/smartdevicelink/proxy/rpc/TireStatus.java')
-rw-r--r--base/src/main/java/com/smartdevicelink/proxy/rpc/TireStatus.java320
1 files changed, 245 insertions, 75 deletions
diff --git a/base/src/main/java/com/smartdevicelink/proxy/rpc/TireStatus.java b/base/src/main/java/com/smartdevicelink/proxy/rpc/TireStatus.java
index 5db768cb5..68c47cf50 100644
--- a/base/src/main/java/com/smartdevicelink/proxy/rpc/TireStatus.java
+++ b/base/src/main/java/com/smartdevicelink/proxy/rpc/TireStatus.java
@@ -34,82 +34,131 @@ package com.smartdevicelink.proxy.rpc;
import androidx.annotation.NonNull;
import com.smartdevicelink.proxy.RPCStruct;
+import com.smartdevicelink.proxy.rpc.enums.ComponentVolumeStatus;
import com.smartdevicelink.proxy.rpc.enums.WarningLightStatus;
+import com.smartdevicelink.util.DebugTool;
import java.util.Hashtable;
/**
- * <p>The status and pressure of the tires.</p>
- * <p><b> Parameter List:</b></p>
+ * The status and pressure of the tires.
+ *
+ * <p><b>Parameter List</b></p>
*
* <table border="1" rules="all">
- * <tr>
- * <th>Param Name</th>
- * <th>Type</th>
- * <th>Description</th>
- * <th>Version</th>
- * </tr>
- * <tr>
- * <td>PressureTellTale</td>
- * <td>WarningLightStatus</td>
- * <td>Status of the Tire Pressure TellTale</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>LeftFront</td>
- * <td>SingleTireStatus</td>
- * <td>The status of the left front tire.</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>RightFront</td>
- * <td>SingleTireStatus</td>
- * <td>The status of the right front tire.</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>LeftRear</td>
- * <td>SingleTireStatus</td>
- * <td>The status of the left rear tire.</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>RightRear</td>
- * <td>SingleTireStatus</td>
- * <td>The status of the right rear tire</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>InnerLeftRear</td>
- * <td>SingleTireStatus</td>
- * <td>The status of the inner left rear tire.</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * <tr>
- * <td>InnerRightRear</td>
- * <td>SingleTireStatus</td>
- * <td>The status of the inner right rear tire.</td>
- * <td>SmartDeviceLink 2.0</td>
- * </tr>
- * </table>
- * <p>
- * @since SmartDeviceLink 2.0
+ * <tr>
+ * <th>Param Name</th>
+ * <th>Type</th>
+ * <th>Description</th>
+ * <th>Required</th>
+ * <th>Notes</th>
+ * <th>Version Available</th>
+ * </tr>
+ * <tr>
+ * <td>pressureTelltale</td>
+ * <td>WarningLightStatus</td>
+ * <td>Status of the Tire Pressure Telltale. See WarningLightStatus.</td>
+ * <td>N</td>
+ * <td></td>
+ * <td>
+ * @since SmartDeviceLink 2.0.0
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>leftFront</td>
+ * <td>SingleTireStatus</td>
+ * <td>The status of the left front tire.</td>
+ * <td>N</td>
+ * <td></td>
+ * <td>
+ * @since SmartDeviceLink 2.0.0
+ * </td>
+ *
+ * </tr>
+ * <tr>
+ * <td>rightFront</td>
+ * <td>SingleTireStatus</td>
+ * <td>The status of the right front tire.</td>
+ * <td>N</td>
+ * <td></td>
+ * <td>
+ * @since SmartDeviceLink 2.0.0
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>leftRear</td>
+ * <td>SingleTireStatus</td>
+ * <td>The status of the left rear tire.</td>
+ * <td>N</td>
+ * <td></td>
+ * <td>
+ * @since SmartDeviceLink 2.0.0
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>rightRear</td>
+ * <td>SingleTireStatus</td>
+ * <td>The status of the right rear tire.</td>
+ * <td>N</td>
+ * <td></td>
+ * <td>
+ * @since SmartDeviceLink 2.0.0
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>innerLeftRear</td>
+ * <td>SingleTireStatus</td>
+ * <td>The status of the inner left rear.</td>
+ * <td>N</td>
+ * <td></td>
+ * <td>
+ * @since SmartDeviceLink 2.0.0
+ * </td>
+ * </tr>
+ * <tr>
+ * <td>innerRightRear</td>
+ * <td>SingleTireStatus</td>
+ * <td>The status of the inner right rear.</td>
+ * <td>N</td>
+ * <td></td>
+ * <td>
+ * @since SmartDeviceLink 2.0.0
+ * </td>
+ * </tr>
+ * </table>
*
- * @see WarningLightStatus
- * @see SingleTireStatus
- * @see GetVehicleData
- * @see OnVehicleData
+ * @since SmartDeviceLink 2.0.0
*/
-
public class TireStatus extends RPCStruct {
+ private static final String TAG = "TireStatus";
+ /**
+ * @since SmartDeviceLink 2.0.0
+ */
public static final String KEY_PRESSURE_TELL_TALE = "pressureTelltale";
+ /**
+ * @since SmartDeviceLink 2.0.0
+ */
public static final String KEY_LEFT_FRONT = "leftFront";
+ /**
+ * @since SmartDeviceLink 2.0.0
+ */
public static final String KEY_RIGHT_FRONT = "rightFront";
+ /**
+ * @since SmartDeviceLink 2.0.0
+ */
public static final String KEY_LEFT_REAR = "leftRear";
+ /**
+ * @since SmartDeviceLink 2.0.0
+ */
public static final String KEY_INNER_LEFT_REAR = "innerLeftRear";
+ /**
+ * @since SmartDeviceLink 2.0.0
+ */
public static final String KEY_INNER_RIGHT_REAR = "innerRightRear";
+ /**
+ * @since SmartDeviceLink 2.0.0
+ */
public static final String KEY_RIGHT_REAR = "rightRear";
-
public TireStatus() {
}
@@ -125,7 +174,7 @@ public class TireStatus extends RPCStruct {
/**
* Constructs a new TireStatus object
*
- * @param pressureTellTale Status of the Tire Pressure TellTale
+ * @param pressureTelltale Status of the Tire Pressure TellTale
* @param leftFront The status of the left front tire.
* @param rightFront The status of the right front tire.
* @param leftRear The status of the left rear tire.
@@ -133,9 +182,9 @@ public class TireStatus extends RPCStruct {
* @param innerLeftRear The status of the inner left rear tire.
* @param innerRightRear The status of the inner right rear tire.
*/
- public TireStatus(@NonNull WarningLightStatus pressureTellTale, @NonNull SingleTireStatus leftFront, @NonNull SingleTireStatus rightFront, @NonNull SingleTireStatus leftRear, @NonNull SingleTireStatus rightRear, @NonNull SingleTireStatus innerLeftRear, @NonNull SingleTireStatus innerRightRear) {
+ public TireStatus(WarningLightStatus pressureTelltale, SingleTireStatus leftFront, SingleTireStatus rightFront, SingleTireStatus leftRear, SingleTireStatus rightRear, SingleTireStatus innerLeftRear, SingleTireStatus innerRightRear) {
this();
- setPressureTelltale(pressureTellTale);
+ setPressureTelltale(pressureTelltale);
setLeftFront(leftFront);
setRightFront(rightFront);
setLeftRear(leftRear);
@@ -176,60 +225,181 @@ public class TireStatus extends RPCStruct {
* @return the status of the tire pressure Telltale.
*/
public WarningLightStatus getPressureTelltale() {
- return (WarningLightStatus) getObject(WarningLightStatus.class, KEY_PRESSURE_TELL_TALE);
+ WarningLightStatus warningLightStatus = (WarningLightStatus) getObject(WarningLightStatus.class, KEY_PRESSURE_TELL_TALE);
+ if (warningLightStatus == null) {
+ WarningLightStatus newWarningLightStatus = WarningLightStatus.NOT_USED;
+ setValue(KEY_PRESSURE_TELL_TALE, newWarningLightStatus);
+ warningLightStatus = newWarningLightStatus;
+ DebugTool.logWarning(TAG, "TireStatus.pressureTelltale was null and will be set to .notUsed. In the future, this will change to be nullable.");
+ }
+ return warningLightStatus;
}
- public TireStatus setLeftFront(@NonNull SingleTireStatus leftFront) {
+ /**
+ * Sets the leftFront.
+ *
+ * @param leftFront The status of the left front tire.
+ * @since SmartDeviceLink 2.0.0
+ */
+ public TireStatus setLeftFront(SingleTireStatus leftFront) {
setValue(KEY_LEFT_FRONT, leftFront);
return this;
}
+ /**
+ * Gets the leftFront.
+ *
+ * @return SingleTireStatus The status of the left front tire.
+ * @since SmartDeviceLink 2.0.0
+ */
public SingleTireStatus getLeftFront() {
- return (SingleTireStatus) getObject(SingleTireStatus.class, KEY_LEFT_FRONT);
+ SingleTireStatus tireStatus = (SingleTireStatus) getObject(SingleTireStatus.class, KEY_LEFT_FRONT);
+ if (tireStatus == null) {
+ SingleTireStatus newTireStatus = new SingleTireStatus().setStatus(ComponentVolumeStatus.UNKNOWN);
+ setValue(KEY_LEFT_FRONT, newTireStatus);
+ tireStatus = newTireStatus;
+ DebugTool.logWarning(TAG, "TireStatus.leftFront was null and will be set to .unknown. In the future, this will change to be nullable.");
+ }
+ return tireStatus;
}
- public TireStatus setRightFront(@NonNull SingleTireStatus rightFront) {
+ /**
+ * Sets the rightFront.
+ *
+ * @param rightFront The status of the right front tire.
+ * @since SmartDeviceLink 2.0.0
+ */
+ public TireStatus setRightFront(SingleTireStatus rightFront) {
setValue(KEY_RIGHT_FRONT, rightFront);
return this;
}
+ /**
+ * Gets the rightFront.
+ *
+ * @return SingleTireStatus The status of the right front tire.
+ * @since SmartDeviceLink 2.0.0
+ */
public SingleTireStatus getRightFront() {
- return (SingleTireStatus) getObject(SingleTireStatus.class, KEY_RIGHT_FRONT);
+ SingleTireStatus tireStatus = (SingleTireStatus) getObject(SingleTireStatus.class, KEY_RIGHT_FRONT);
+ if (tireStatus == null) {
+ SingleTireStatus newTireStatus = new SingleTireStatus().setStatus(ComponentVolumeStatus.UNKNOWN);
+ setValue(KEY_RIGHT_FRONT, newTireStatus);
+ tireStatus = newTireStatus;
+ DebugTool.logWarning(TAG, "TireStatus.rightFront was null and will be set to .unknown. In the future, this will change to be nullable.");
+ }
+ return tireStatus;
}
- public TireStatus setLeftRear(@NonNull SingleTireStatus leftRear) {
+ /**
+ * Sets the leftRear.
+ *
+ * @param leftRear The status of the left rear tire.
+ * @since SmartDeviceLink 2.0.0
+ */
+ public TireStatus setLeftRear(SingleTireStatus leftRear) {
setValue(KEY_LEFT_REAR, leftRear);
return this;
}
+ /**
+ * Gets the leftRear.
+ *
+ * @return SingleTireStatus The status of the left rear tire.
+ * @since SmartDeviceLink 2.0.0
+ */
public SingleTireStatus getLeftRear() {
- return (SingleTireStatus) getObject(SingleTireStatus.class, KEY_LEFT_REAR);
+ SingleTireStatus tireStatus = (SingleTireStatus) getObject(SingleTireStatus.class, KEY_LEFT_REAR);
+ if (tireStatus == null) {
+ SingleTireStatus newTireStatus = new SingleTireStatus().setStatus(ComponentVolumeStatus.UNKNOWN);
+ setValue(KEY_LEFT_REAR, newTireStatus);
+ tireStatus = newTireStatus;
+ DebugTool.logWarning(TAG, "TireStatus.leftRear was null and will be set to .unknown. In the future, this will change to be nullable.");
+ }
+ return tireStatus;
}
- public TireStatus setRightRear(@NonNull SingleTireStatus rightRear) {
+ /**
+ * Sets the rightRear.
+ *
+ * @param rightRear The status of the right rear tire.
+ * @since SmartDeviceLink 2.0.0
+ */
+ public TireStatus setRightRear(SingleTireStatus rightRear) {
setValue(KEY_RIGHT_REAR, rightRear);
return this;
}
+ /**
+ * Gets the rightRear.
+ *
+ * @return SingleTireStatus The status of the right rear tire.
+ * @since SmartDeviceLink 2.0.0
+ */
public SingleTireStatus getRightRear() {
- return (SingleTireStatus) getObject(SingleTireStatus.class, KEY_RIGHT_REAR);
+ SingleTireStatus tireStatus = (SingleTireStatus) getObject(SingleTireStatus.class, KEY_RIGHT_REAR);
+ if (tireStatus == null) {
+ SingleTireStatus newTireStatus = new SingleTireStatus().setStatus(ComponentVolumeStatus.UNKNOWN);
+ setValue(KEY_RIGHT_REAR, newTireStatus);
+ tireStatus = newTireStatus;
+ DebugTool.logWarning(TAG, "TireStatus.rightRear was null and will be set to .unknown. In the future, this will change to be nullable.");
+ }
+ return tireStatus;
}
- public TireStatus setInnerLeftRear(@NonNull SingleTireStatus innerLeftRear) {
+ /**
+ * Sets the innerLeftRear.
+ *
+ * @param innerLeftRear The status of the inner left rear.
+ * @since SmartDeviceLink 2.0.0
+ */
+ public TireStatus setInnerLeftRear(SingleTireStatus innerLeftRear) {
setValue(KEY_INNER_LEFT_REAR, innerLeftRear);
return this;
}
+ /**
+ * Gets the innerLeftRear.
+ *
+ * @return SingleTireStatus The status of the inner left rear.
+ * @since SmartDeviceLink 2.0.0
+ */
public SingleTireStatus getInnerLeftRear() {
- return (SingleTireStatus) getObject(SingleTireStatus.class, KEY_INNER_LEFT_REAR);
+ SingleTireStatus tireStatus = (SingleTireStatus) getObject(SingleTireStatus.class, KEY_INNER_LEFT_REAR);
+ if (tireStatus == null) {
+ SingleTireStatus newTireStatus = new SingleTireStatus().setStatus(ComponentVolumeStatus.UNKNOWN);
+ setValue(KEY_INNER_LEFT_REAR, newTireStatus);
+ tireStatus = newTireStatus;
+ DebugTool.logWarning(TAG, "TireStatus.innerLeftRear was null and will be set to .unknown. In the future, this will change to be nullable.");
+ }
+ return tireStatus;
}
- public TireStatus setInnerRightRear(@NonNull SingleTireStatus innerRightRear) {
+ /**
+ * Sets the innerRightRear.
+ *
+ * @param innerRightRear The status of the inner right rear.
+ * @since SmartDeviceLink 2.0.0
+ */
+ public TireStatus setInnerRightRear(SingleTireStatus innerRightRear) {
setValue(KEY_INNER_RIGHT_REAR, innerRightRear);
return this;
}
+ /**
+ * Gets the innerRightRear.
+ *
+ * @return SingleTireStatus The status of the inner right rear.
+ * @since SmartDeviceLink 2.0.0
+ */
public SingleTireStatus getInnerRightRear() {
- return (SingleTireStatus) getObject(SingleTireStatus.class, KEY_INNER_RIGHT_REAR);
+ SingleTireStatus tireStatus = (SingleTireStatus) getObject(SingleTireStatus.class, KEY_INNER_RIGHT_REAR);
+ if (tireStatus == null) {
+ SingleTireStatus newTireStatus = new SingleTireStatus().setStatus(ComponentVolumeStatus.UNKNOWN);
+ setValue(KEY_INNER_RIGHT_REAR, newTireStatus);
+ tireStatus = newTireStatus;
+ DebugTool.logWarning(TAG, "TireStatus.innerRightRear was null and will be set to .unknown. In the future, this will change to be nullable.");
+ }
+ return tireStatus;
}
}