package a.c.b;

import com.google.protobuf.InvalidProtocolBufferException;
import com.ucar.databus.proto.UCarProto;
import java.util.HashMap;

public class x extends v {

    public class a extends HashMap<Integer, String> {
        public a() {
            put(1, "gps");
            put(2, "lights");
            put(3, "gyro_scope");
            put(4, "acceleration");
            put(5, "oil");
            put(6, "gear_info");
            put(7, "light_sensor_info");
        }
    }

    public static s a(UCarProto.Acceleration acceleration) {
        return v.a(c().a(o.CAR).a(4).a(acceleration));
    }

    public static s a(UCarProto.GearInfo gearInfo) {
        return v.a(c().a(o.CAR).a(6).a(gearInfo));
    }

    public static s a(UCarProto.Gps gps) {
        return v.a(c().a(o.CAR).a(1).a(gps));
    }

    public static s a(UCarProto.GyroScope gyroScope) {
        return v.a(c().a(o.CAR).a(3).a(gyroScope));
    }

    public static s a(UCarProto.LightSensorInfo lightSensorInfo) {
        return v.a(c().a(o.CAR).a(7).a(lightSensorInfo));
    }

    public static s a(UCarProto.Lights lights) {
        return v.a(c().a(o.CAR).a(2).a(lights));
    }

    public static s a(UCarProto.Oil oil) {
        return v.a(c().a(o.CAR).a(5).a(oil));
    }

    private static void a(int i, s sVar) {
        v.a(f.PB3, c.SENSOR, i, sVar);
    }

    public static void b() {
        v.a(c.SENSOR, new a());
    }

    public static boolean b(s sVar) {
        return sVar != null && sVar.f() == c.SENSOR && sVar.o() && sVar.j() == 4;
    }

    private static t c() {
        return s.r().a(c.SENSOR);
    }

    public static boolean c(s sVar) {
        return sVar != null && sVar.f() == c.SENSOR && sVar.o() && sVar.j() == 6;
    }

    public static boolean d(s sVar) {
        return sVar != null && sVar.f() == c.SENSOR && sVar.o() && sVar.j() == 1;
    }

    public static boolean e(s sVar) {
        return sVar != null && sVar.f() == c.SENSOR && sVar.o() && sVar.j() == 3;
    }

    public static boolean f(s sVar) {
        return sVar != null && sVar.f() == c.SENSOR && sVar.o() && sVar.j() == 7;
    }

    public static boolean g(s sVar) {
        return sVar != null && sVar.f() == c.SENSOR && sVar.o() && sVar.j() == 2;
    }

    public static boolean h(s sVar) {
        return sVar != null && sVar.f() == c.SENSOR && sVar.o() && sVar.j() == 5;
    }

    public static UCarProto.Acceleration i(s sVar) {
        a(4, sVar);
        try {
            return UCarProto.Acceleration.parseFrom(sVar.b());
        } catch (InvalidProtocolBufferException e) {
            throw new l("parseAccelerationMessage error: " + e.getMessage());
        }
    }

    public static UCarProto.GearInfo j(s sVar) {
        a(6, sVar);
        try {
            return UCarProto.GearInfo.parseFrom(sVar.b());
        } catch (InvalidProtocolBufferException e) {
            throw new l("parseGearInfoMessage error: " + e.getMessage());
        }
    }

    public static UCarProto.Gps k(s sVar) {
        a(1, sVar);
        try {
            return UCarProto.Gps.parseFrom(sVar.b());
        } catch (InvalidProtocolBufferException e) {
            throw new l("parseGpsMessage error: " + e.getMessage());
        }
    }

    public static UCarProto.GyroScope l(s sVar) {
        a(3, sVar);
        try {
            return UCarProto.GyroScope.parseFrom(sVar.b());
        } catch (InvalidProtocolBufferException e) {
            throw new l("parseGyroScopeMessage error: " + e.getMessage());
        }
    }

    public static UCarProto.LightSensorInfo m(s sVar) {
        a(7, sVar);
        try {
            return UCarProto.LightSensorInfo.parseFrom(sVar.b());
        } catch (InvalidProtocolBufferException e) {
            throw new l("parseLightSensorInfoMessage error: " + e.getMessage());
        }
    }

    public static UCarProto.Lights n(s sVar) {
        a(2, sVar);
        try {
            return UCarProto.Lights.parseFrom(sVar.b());
        } catch (InvalidProtocolBufferException e) {
            throw new l("parseLightsMessage error: " + e.getMessage());
        }
    }

    public static UCarProto.Oil o(s sVar) {
        a(5, sVar);
        try {
            return UCarProto.Oil.parseFrom(sVar.b());
        } catch (InvalidProtocolBufferException e) {
            throw new l("parseOilMessage error: " + e.getMessage());
        }
    }
}
