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
019
020public enum EPedKeySort {
021    TLK(1),
022    TIK(2),
023    TMK(3),
024    TWK(4),
025    RSA(5),
026    AES(6),
027    SM2(7);
028    private int id;
029
030    private EPedKeySort(int id) {
031        this.id = id;
032    }
033
034    public int getId() {
035        return id;
036    }
037
038    public static EPedKeySort toKeyType(int id) {
039        EPedKeySort[] keyTypes = EPedKeySort.values();
040        for (EPedKeySort keyType : keyTypes) {
041            if (keyType.getId() == id) {
042                return keyType;
043            }
044        }
045        return null;
046    }
047
048    public static EPedKeySort toKeyType(String type) {
049        EPedKeySort[] keyTypes = EPedKeySort.values();
050        for (EPedKeySort keyType : keyTypes) {
051            if (keyType.toString().equals(type)) {
052                return keyType;
053            }
054        }
055        return null;
056    }
057}