All Downloads are FREE. Search and download functionalities are using the official Maven repository.

t.21.120.2.source-code.FitBaseType Maven / Gradle / Ivy

There is a newer version: 21.141.0
Show newest version
/////////////////////////////////////////////////////////////////////////////////////////////
// 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.HashMap;
import java.util.Map;

public class FitBaseType  {
    public static final short ENUM = 0;
    public static final short SINT8 = 1;
    public static final short UINT8 = 2;
    public static final short SINT16 = 131;
    public static final short UINT16 = 132;
    public static final short SINT32 = 133;
    public static final short UINT32 = 134;
    public static final short STRING = 7;
    public static final short FLOAT32 = 136;
    public static final short FLOAT64 = 137;
    public static final short UINT8Z = 10;
    public static final short UINT16Z = 139;
    public static final short UINT32Z = 140;
    public static final short BYTE = 13;
    public static final short SINT64 = 142;
    public static final short UINT64 = 143;
    public static final short UINT64Z = 144;
    public static final short INVALID = Fit.UINT8_INVALID;

    private static final Map stringMap;

    static {
        stringMap = new HashMap();
        stringMap.put(ENUM, "ENUM");
        stringMap.put(SINT8, "SINT8");
        stringMap.put(UINT8, "UINT8");
        stringMap.put(SINT16, "SINT16");
        stringMap.put(UINT16, "UINT16");
        stringMap.put(SINT32, "SINT32");
        stringMap.put(UINT32, "UINT32");
        stringMap.put(STRING, "STRING");
        stringMap.put(FLOAT32, "FLOAT32");
        stringMap.put(FLOAT64, "FLOAT64");
        stringMap.put(UINT8Z, "UINT8Z");
        stringMap.put(UINT16Z, "UINT16Z");
        stringMap.put(UINT32Z, "UINT32Z");
        stringMap.put(BYTE, "BYTE");
        stringMap.put(SINT64, "SINT64");
        stringMap.put(UINT64, "UINT64");
        stringMap.put(UINT64Z, "UINT64Z");
    }


    /**
     * Retrieves the String Representation of the Value
     * @param value The enum constant
     * @return The name of this enum contsant
     */
    public static String getStringFromValue( Short value ) {
        if( stringMap.containsKey( value ) ) {
            return stringMap.get( value );
        }

        return "";
    }

    /**
     * Returns the enum constant with the specified name.
     * @param value The enum string value
     * @return The enum constant or INVALID if unknown
     */
    public static Short getValueFromString( String value ) {
        for( Map.Entry entry : stringMap.entrySet() ) {
            if( entry.getValue().equals( value ) ) {
                return entry.getKey();
            }
        }

        return INVALID;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy