001/*
002 * ===========================================================================================
003 * = COPYRIGHT
004 *          PAX Computer Technology (Shenzhen) Co., Ltd. PROPRIETARY INFORMATION
005 *   This software is supplied under the terms of a license agreement or nondisclosure
006 *   agreement with PAX Computer Technology (Shenzhen) Co., Ltd. and may not be copied or
007 *   disclosed except in accordance with the terms in that agreement.
008 *     Copyright (C) 2017-2023 PAX Computer Technology (Shenzhen) Co., Ltd. All rights reserved.
009 * Description: // Detail description about the function of this module,
010 *             // interfaces with the other modules, and dependencies.
011 * Revision History:
012 * Date                         Author                        Action
013 * 2017/04/01                   PAX                     Create/Add/Modify/Delete
014 * ===========================================================================================
015 */
016
017package com.pax.dal.entity;
018
019public enum EmmcInfo {
020    /**
021     * <div class="zh"> not defined </div> <div class="en"> not defined </div>
022     */
023    EMMC_LIFE_NOT_DEFINED("not defined", 0),
024    /**
025     * <div class="zh"> 0% - 10% device life time used </div> <div class="en"> 0% - 10% device life time used </div>
026     */
027    EMMC_LIFE_USED_0("0%", 1),
028    /**
029     * <div class="zh"> 10% - 20% device life time used </div> <div class="en"> 10% - 20% device life time used </div>
030     */
031    EMMC_LIFE_USED_10("10%", 2),
032    /**
033     * <div class="zh"> 20% - 30% device life time used </div> <div class="en"> 20% - 30% device life time used </div>
034     */
035    EMMC_LIFE_USED_20("20%", 3),
036    /**
037     * <div class="zh"> 30% - 40% device life time used </div> <div class="en"> 30% - 40% device life time used </div>
038     */
039    EMMC_LIFE_USED_30("30%", 4),
040    /**
041     * <div class="zh"> 40% - 50% device life time used </div> <div class="en"> 40% - 50% device life time used </div>
042     */
043    EMMC_LIFE_USED_40("40%", 5),
044    /**
045     * <div class="zh"> 50% - 60% device life time used </div> <div class="en"> 50% - 60% device life time used </div>
046     */
047    EMMC_LIFE_USED_50("50%", 6),
048    /**
049     * <div class="zh"> 60% - 70% device life time used </div> <div class="en"> 60% - 70% device life time used </div>
050     */
051    EMMC_LIFE_USED_60("60%", 7),
052    /**
053     * <div class="zh"> 70% - 80% device life time used </div> <div class="en"> 70% - 80% device life time used </div>
054     */
055    EMMC_LIFE_USED_70("70%", 8),
056    /**
057     * <div class="zh"> 80% - 90% device life time used </div> <div class="en"> 80% - 90% device life time used </div>
058     */
059    EMMC_LIFE_USED_80("80%", 9),
060    /**
061     * <div class="zh"> 90% - 100% device life time used </div> <div class="en"> 90% - 100% device life time used </div>
062     */
063    EMMC_LIFE_USED_90("90%", 10),
064    /**
065     * <div class="zh"> Exceeded its maximum estimated device life time </div> <div class="en"> Exceeded its maximum estimated device life time </div>
066     */
067    EMMC_LIFE_EXCEEDEDOFLIFE("Exceeded its maximum estimated device life time", 11);
068
069    private String info;
070    private int value;
071
072    private EmmcInfo(String info, int value) {
073        this.info = info;
074        this.value = value;
075    }
076
077    public String getInfo() {
078        return this.info;
079    }
080
081    public int getValue() {
082        return this.value;
083    }
084
085    public static EmmcInfo fromValue(int value) {
086        EmmcInfo[] emmcInfos;
087        int count = (emmcInfos = values()).length;
088
089        for(int i = 0; i < count; ++i) {
090            EmmcInfo emmcInfo = emmcInfos[i];
091            if (emmcInfo.getValue() == value) {
092                return emmcInfo;
093            }
094        }
095
096        return null;
097    }
098
099}