File tree Expand file tree Collapse file tree
src/main/java/de/rwth/idsg/steve/ocpp/converter Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -229,10 +229,11 @@ public DataTransferResponse convertResponse(ocpp.cs._2015._10.DataTransferRespon
229229 * but something else might make more sense at this place
230230 */
231231 private static ChargePointStatus customMapStatus (ocpp .cs ._2012 ._06 .ChargePointStatus status ) {
232- if (status .equals (ocpp .cs ._2012 ._06 .ChargePointStatus .OCCUPIED )) {
233- return ChargePointStatus .CHARGING ;
234- } else {
235- return ChargePointStatus .fromValue (status .value ());
232+ switch (status ) {
233+ case OCCUPIED :
234+ return ChargePointStatus .CHARGING ;
235+ default :
236+ return ChargePointStatus .fromValue (status .value ());
236237 }
237238 }
238239
@@ -241,10 +242,11 @@ private static ChargePointStatus customMapStatus(ocpp.cs._2012._06.ChargePointSt
241242 * Update: According to the 1.6 specification, MODE_3_ERROR was simply renamed to EV_COMMUNICATION_ERROR
242243 */
243244 private static ChargePointErrorCode customMapErrorCode (ocpp .cs ._2012 ._06 .ChargePointErrorCode errorCode15 ) {
244- if (errorCode15 .equals (ocpp .cs ._2012 ._06 .ChargePointErrorCode .MODE_3_ERROR )) {
245- return ChargePointErrorCode .EV_COMMUNICATION_ERROR ;
246- } else {
247- return ChargePointErrorCode .fromValue (errorCode15 .value ());
245+ switch (errorCode15 ) {
246+ case MODE_3_ERROR :
247+ return ChargePointErrorCode .EV_COMMUNICATION_ERROR ;
248+ default :
249+ return ChargePointErrorCode .fromValue (errorCode15 .value ());
248250 }
249251 }
250252
You can’t perform that action at this time.
0 commit comments