001// Copyright (c) FIRST and other WPILib contributors.
002// Open Source Software; you can modify and/or share it under the terms of
003// the WPILib BSD license file in the root directory of this project.
004
005package edu.wpi.first.wpilibj;
006
007import edu.wpi.first.hal.REVPHJNI;
008
009public enum CompressorConfigType {
010  Disabled(REVPHJNI.COMPRESSOR_CONFIG_TYPE_DISABLED),
011  Digital(REVPHJNI.COMPRESSOR_CONFIG_TYPE_DIGITAL),
012  Analog(REVPHJNI.COMPRESSOR_CONFIG_TYPE_ANALOG),
013  Hybrid(REVPHJNI.COMPRESSOR_CONFIG_TYPE_HYBRID);
014
015  public final int value;
016
017  CompressorConfigType(int value) {
018    this.value = value;
019  }
020
021  /**
022   * Gets a type from an int value.
023   *
024   * @param value int value
025   * @return type
026   */
027  public static CompressorConfigType fromValue(int value) {
028    switch (value) {
029      case REVPHJNI.COMPRESSOR_CONFIG_TYPE_HYBRID:
030        return Hybrid;
031      case REVPHJNI.COMPRESSOR_CONFIG_TYPE_ANALOG:
032        return Analog;
033      case REVPHJNI.COMPRESSOR_CONFIG_TYPE_DIGITAL:
034        return Digital;
035      default:
036        return Disabled;
037    }
038  }
039
040  public int getValue() {
041    return value;
042  }
043}