t.21.120.2.source-code.Factory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fit Show documentation
Show all versions of fit Show documentation
The Official Garmin FIT SDK
/////////////////////////////////////////////////////////////////////////////////////////////
// Copyright 2023 Garmin International, Inc.
// Licensed under the Flexible and Interoperable Data Transfer (FIT) Protocol License; you
// may not use this file except in compliance with the Flexible and Interoperable Data
// Transfer (FIT) Protocol License.
/////////////////////////////////////////////////////////////////////////////////////////////
// ****WARNING**** This file is auto-generated! Do NOT edit this file.
// Profile Version = 21.120Release
// Tag = production/release/21.120.00-0-g2d77811
/////////////////////////////////////////////////////////////////////////////////////////////
package com.garmin.fit;
import java.util.ArrayList;
public class Factory {
static public Mesg createMesg(Mesg mesg) {
switch (mesg.getNum()) {
case MesgNum.FILE_ID:
return new FileIdMesg(mesg);
case MesgNum.FILE_CREATOR:
return new FileCreatorMesg(mesg);
case MesgNum.TIMESTAMP_CORRELATION:
return new TimestampCorrelationMesg(mesg);
case MesgNum.SOFTWARE:
return new SoftwareMesg(mesg);
case MesgNum.SLAVE_DEVICE:
return new SlaveDeviceMesg(mesg);
case MesgNum.CAPABILITIES:
return new CapabilitiesMesg(mesg);
case MesgNum.FILE_CAPABILITIES:
return new FileCapabilitiesMesg(mesg);
case MesgNum.MESG_CAPABILITIES:
return new MesgCapabilitiesMesg(mesg);
case MesgNum.FIELD_CAPABILITIES:
return new FieldCapabilitiesMesg(mesg);
case MesgNum.DEVICE_SETTINGS:
return new DeviceSettingsMesg(mesg);
case MesgNum.USER_PROFILE:
return new UserProfileMesg(mesg);
case MesgNum.HRM_PROFILE:
return new HrmProfileMesg(mesg);
case MesgNum.SDM_PROFILE:
return new SdmProfileMesg(mesg);
case MesgNum.BIKE_PROFILE:
return new BikeProfileMesg(mesg);
case MesgNum.CONNECTIVITY:
return new ConnectivityMesg(mesg);
case MesgNum.WATCHFACE_SETTINGS:
return new WatchfaceSettingsMesg(mesg);
case MesgNum.OHR_SETTINGS:
return new OhrSettingsMesg(mesg);
case MesgNum.TIME_IN_ZONE:
return new TimeInZoneMesg(mesg);
case MesgNum.ZONES_TARGET:
return new ZonesTargetMesg(mesg);
case MesgNum.SPORT:
return new SportMesg(mesg);
case MesgNum.HR_ZONE:
return new HrZoneMesg(mesg);
case MesgNum.SPEED_ZONE:
return new SpeedZoneMesg(mesg);
case MesgNum.CADENCE_ZONE:
return new CadenceZoneMesg(mesg);
case MesgNum.POWER_ZONE:
return new PowerZoneMesg(mesg);
case MesgNum.MET_ZONE:
return new MetZoneMesg(mesg);
case MesgNum.DIVE_SETTINGS:
return new DiveSettingsMesg(mesg);
case MesgNum.DIVE_ALARM:
return new DiveAlarmMesg(mesg);
case MesgNum.DIVE_APNEA_ALARM:
return new DiveApneaAlarmMesg(mesg);
case MesgNum.DIVE_GAS:
return new DiveGasMesg(mesg);
case MesgNum.GOAL:
return new GoalMesg(mesg);
case MesgNum.ACTIVITY:
return new ActivityMesg(mesg);
case MesgNum.SESSION:
return new SessionMesg(mesg);
case MesgNum.LAP:
return new LapMesg(mesg);
case MesgNum.LENGTH:
return new LengthMesg(mesg);
case MesgNum.RECORD:
return new RecordMesg(mesg);
case MesgNum.EVENT:
return new EventMesg(mesg);
case MesgNum.DEVICE_INFO:
return new DeviceInfoMesg(mesg);
case MesgNum.DEVICE_AUX_BATTERY_INFO:
return new DeviceAuxBatteryInfoMesg(mesg);
case MesgNum.TRAINING_FILE:
return new TrainingFileMesg(mesg);
case MesgNum.WEATHER_CONDITIONS:
return new WeatherConditionsMesg(mesg);
case MesgNum.WEATHER_ALERT:
return new WeatherAlertMesg(mesg);
case MesgNum.GPS_METADATA:
return new GpsMetadataMesg(mesg);
case MesgNum.CAMERA_EVENT:
return new CameraEventMesg(mesg);
case MesgNum.GYROSCOPE_DATA:
return new GyroscopeDataMesg(mesg);
case MesgNum.ACCELEROMETER_DATA:
return new AccelerometerDataMesg(mesg);
case MesgNum.MAGNETOMETER_DATA:
return new MagnetometerDataMesg(mesg);
case MesgNum.BAROMETER_DATA:
return new BarometerDataMesg(mesg);
case MesgNum.THREE_D_SENSOR_CALIBRATION:
return new ThreeDSensorCalibrationMesg(mesg);
case MesgNum.ONE_D_SENSOR_CALIBRATION:
return new OneDSensorCalibrationMesg(mesg);
case MesgNum.VIDEO_FRAME:
return new VideoFrameMesg(mesg);
case MesgNum.OBDII_DATA:
return new ObdiiDataMesg(mesg);
case MesgNum.NMEA_SENTENCE:
return new NmeaSentenceMesg(mesg);
case MesgNum.AVIATION_ATTITUDE:
return new AviationAttitudeMesg(mesg);
case MesgNum.VIDEO:
return new VideoMesg(mesg);
case MesgNum.VIDEO_TITLE:
return new VideoTitleMesg(mesg);
case MesgNum.VIDEO_DESCRIPTION:
return new VideoDescriptionMesg(mesg);
case MesgNum.VIDEO_CLIP:
return new VideoClipMesg(mesg);
case MesgNum.SET:
return new SetMesg(mesg);
case MesgNum.JUMP:
return new JumpMesg(mesg);
case MesgNum.SPLIT:
return new SplitMesg(mesg);
case MesgNum.CLIMB_PRO:
return new ClimbProMesg(mesg);
case MesgNum.FIELD_DESCRIPTION:
return new FieldDescriptionMesg(mesg);
case MesgNum.DEVELOPER_DATA_ID:
return new DeveloperDataIdMesg(mesg);
case MesgNum.COURSE:
return new CourseMesg(mesg);
case MesgNum.COURSE_POINT:
return new CoursePointMesg(mesg);
case MesgNum.SEGMENT_ID:
return new SegmentIdMesg(mesg);
case MesgNum.SEGMENT_LEADERBOARD_ENTRY:
return new SegmentLeaderboardEntryMesg(mesg);
case MesgNum.SEGMENT_POINT:
return new SegmentPointMesg(mesg);
case MesgNum.SEGMENT_LAP:
return new SegmentLapMesg(mesg);
case MesgNum.SEGMENT_FILE:
return new SegmentFileMesg(mesg);
case MesgNum.WORKOUT:
return new WorkoutMesg(mesg);
case MesgNum.WORKOUT_SESSION:
return new WorkoutSessionMesg(mesg);
case MesgNum.WORKOUT_STEP:
return new WorkoutStepMesg(mesg);
case MesgNum.EXERCISE_TITLE:
return new ExerciseTitleMesg(mesg);
case MesgNum.SCHEDULE:
return new ScheduleMesg(mesg);
case MesgNum.TOTALS:
return new TotalsMesg(mesg);
case MesgNum.WEIGHT_SCALE:
return new WeightScaleMesg(mesg);
case MesgNum.BLOOD_PRESSURE:
return new BloodPressureMesg(mesg);
case MesgNum.MONITORING_INFO:
return new MonitoringInfoMesg(mesg);
case MesgNum.MONITORING:
return new MonitoringMesg(mesg);
case MesgNum.MONITORING_HR_DATA:
return new MonitoringHrDataMesg(mesg);
case MesgNum.SPO2_DATA:
return new Spo2DataMesg(mesg);
case MesgNum.HR:
return new HrMesg(mesg);
case MesgNum.STRESS_LEVEL:
return new StressLevelMesg(mesg);
case MesgNum.MAX_MET_DATA:
return new MaxMetDataMesg(mesg);
case MesgNum.MEMO_GLOB:
return new MemoGlobMesg(mesg);
case MesgNum.SLEEP_LEVEL:
return new SleepLevelMesg(mesg);
case MesgNum.ANT_CHANNEL_ID:
return new AntChannelIdMesg(mesg);
case MesgNum.ANT_RX:
return new AntRxMesg(mesg);
case MesgNum.ANT_TX:
return new AntTxMesg(mesg);
case MesgNum.EXD_SCREEN_CONFIGURATION:
return new ExdScreenConfigurationMesg(mesg);
case MesgNum.EXD_DATA_FIELD_CONFIGURATION:
return new ExdDataFieldConfigurationMesg(mesg);
case MesgNum.EXD_DATA_CONCEPT_CONFIGURATION:
return new ExdDataConceptConfigurationMesg(mesg);
case MesgNum.DIVE_SUMMARY:
return new DiveSummaryMesg(mesg);
case MesgNum.HRV:
return new HrvMesg(mesg);
case MesgNum.BEAT_INTERVALS:
return new BeatIntervalsMesg(mesg);
case MesgNum.HRV_STATUS_SUMMARY:
return new HrvStatusSummaryMesg(mesg);
case MesgNum.HRV_VALUE:
return new HrvValueMesg(mesg);
case MesgNum.RESPIRATION_RATE:
return new RespirationRateMesg(mesg);
case MesgNum.TANK_UPDATE:
return new TankUpdateMesg(mesg);
case MesgNum.TANK_SUMMARY:
return new TankSummaryMesg(mesg);
case MesgNum.SLEEP_ASSESSMENT:
return new SleepAssessmentMesg(mesg);
case MesgNum.PAD:
return new PadMesg(mesg);
default:
break;
}
return new Mesg("unknown", MesgNum.INVALID);
}
static public Mesg createMesg(int mesgNum) {
for (int i = 0; i < mesgs.length; i++) {
if (mesgs[i].num == mesgNum) {
return new Mesg(mesgs[i]);
}
}
return new Mesg("unknown", mesgNum);
}
static public Mesg createMesg(String mesgName) {
for (int i = 0; i < mesgs.length; i++) {
if (mesgs[i].name.equals(mesgName)) {
return new Mesg(mesgs[i]);
}
}
return new Mesg(mesgName, MesgNum.INVALID);
}
static public Field createField(String mesgName, String fieldName) {
for (int i = 0; i < mesgs.length; i++) {
if (mesgs[i].name.equals(mesgName)) {
return new Field(mesgs[i].getField(fieldName, false));
}
}
return new Field(fieldName, Fit.FIELD_NUM_INVALID, 0, 1, 0, "", false, Profile.Type.ENUM);
}
static public Field createField(String mesgName, int fieldNum) {
for (int i = 0; i < mesgs.length; i++) {
if (mesgs[i].name.equals(mesgName)) {
return new Field(mesgs[i].getField(fieldNum));
}
}
return new Field("unknown", fieldNum, 0, 1, 0, "", false, Profile.Type.ENUM);
}
static public Field createField(int mesgNum, int fieldNum) {
for (int i = 0; i < mesgs.length; i++) {
if (mesgs[i].num == mesgNum) {
return new Field(mesgs[i].getField(fieldNum));
}
}
return new Field("unknown", fieldNum, 0, 1, 0, "", false, Profile.Type.ENUM);
}
static public Field createField(int mesgNum, String fieldName) {
for (int i = 0; i < mesgs.length; i++) {
if (mesgs[i].num == mesgNum) {
return new Field(mesgs[i].getField(fieldName, false));
}
}
return new Field(fieldName, Fit.FIELD_NUM_INVALID, 0, 1, 0, "", false, Profile.Type.ENUM);
}
static public Field createField(String mesgName, String fieldName, ArrayList