Skip to content

Commit

Permalink
Added enum Wheel indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
ppatierno committed Dec 27, 2020
1 parent 5607fc7 commit 17a5ccc
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions f1-telemetry/src/main/java/io/ppatierno/formula1/enums/Wheel.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright Paolo Patierno.
* License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html).
*/
package io.ppatierno.formula1.enums;

import java.util.HashMap;
import java.util.Map;

/**
* Wheel
* (represents wheel indexes in the corresponding arrays)
*/
public enum Wheel {
REAR_LEFT(0),
REAR_RIGHT(1),
FRONT_LEFT(2),
FRONT_RIGHT(3);

private static Map<Integer, Wheel> map = new HashMap<>();

static {
for (Wheel wheel : Wheel.values()) {
map.put(wheel.value, wheel);
}
}

private int value;

Wheel(int value) {
this.value = value;
}

public static Wheel valueOf(int value) {
return map.get(value);
}

public int getValue() {
return value;
}
}

0 comments on commit 17a5ccc

Please sign in to comment.