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
009/** Compressor config type. */
010public enum CompressorConfigType {
011  /** Disabled. */
012  Disabled(REVPHJNI.COMPRESSOR_CONFIG_TYPE_DISABLED),
013  /** Digital. */
014  Digital(REVPHJNI.COMPRESSOR_CONFIG_TYPE_DIGITAL),
015  /** Analog. */
016  Analog(REVPHJNI.COMPRESSOR_CONFIG_TYPE_ANALOG),
017  /** Hybrid. */
018  Hybrid(REVPHJNI.COMPRESSOR_CONFIG_TYPE_HYBRID);
019
020  /** CompressorConfigType value. */
021  public final int value;
022
023  CompressorConfigType(int value) {
024    this.value = value;
025  }
026
027  /**
028   * Gets a type from an int value.
029   *
030   * @param value int value
031   * @return type
032   */
033  public static CompressorConfigType fromValue(int value) {
034    switch (value) {
035      case REVPHJNI.COMPRESSOR_CONFIG_TYPE_HYBRID:
036        return Hybrid;
037      case REVPHJNI.COMPRESSOR_CONFIG_TYPE_ANALOG:
038        return Analog;
039      case REVPHJNI.COMPRESSOR_CONFIG_TYPE_DIGITAL:
040        return Digital;
041      default:
042        return Disabled;
043    }
044  }
045
046  /**
047   * Returns the CompressorConfigType's value.
048   *
049   * @return The CompressorConfigType's value.
050   */
051  public int getValue() {
052    return value;
053  }
054}