001/* Copyright (C) Cross The Road Electronics 2024 */
002package com.ctre.phoenix.platform.can;
003
004/**
005 * Keeps track of cache state
006 */
007public enum AutocacheState {
008        /**
009         * Disabled cache
010         */
011        Disabled(0), 
012        /**
013         * Enabled cache
014         */
015        Enabled(1);
016
017        /**
018         * Get AutocacheState of specified value
019         * @param value Value of autocacheState
020         * @return AutocacheState of specified value
021         */
022        public static AutocacheState valueOf(int value) {
023                for (AutocacheState frame : values()) {
024                        if (frame.value == value) {
025                                return frame;
026                        }
027                }
028                return null;
029        }
030
031        /**
032         * Value of AutocacheState
033         */
034        public final int value;
035
036        /**
037         * Create AutocacheState of initValue
038         * @param initValue Value of AutocacheState
039         */
040        AutocacheState(int initValue) {
041                this.value = initValue;
042        }
043}