001/*
002 * Copyright (C) Cross The Road Electronics.  All rights reserved.
003 * License information can be found in CTRE_LICENSE.txt
004 * For support and suggestions contact support@ctr-electronics.com or file
005 * an issue tracker at https://github.com/CrossTheRoadElec/Phoenix-Releases
006 */
007package com.ctre.phoenixpro.signals;
008
009import java.util.HashMap;
010
011/**
012 *  The Color of LED2 when it's "Off".
013 */
014public enum Led2OffColorValue
015{
016    Off(0),
017    Red(1),
018    Green(2),
019    Orange(3),
020    Blue(4),
021    Pink(5),
022    Cyan(6),
023    White(7),;
024
025    public final int value;
026
027    Led2OffColorValue(int initValue)
028    {
029        this.value = initValue;
030    }
031
032    private static HashMap<Integer, Led2OffColorValue> _map = null;
033    static
034    {
035        _map = new HashMap<Integer, Led2OffColorValue>();
036        for (Led2OffColorValue type : Led2OffColorValue.values())
037        {
038            _map.put(type.value, type);
039        }
040    }
041
042    /**
043     * Gets Led2OffColorValue from specified value
044     * @param value Value of Led2OffColorValue
045     * @return Led2OffColorValue of specified value
046     */
047    public static Led2OffColorValue valueOf(int value)
048    {
049        Led2OffColorValue retval = _map.get(value);
050        if(retval != null) return retval;
051        return Led2OffColorValue.values()[0];
052    }
053}