All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jelastic.api.development.persistence.PlatformGroup Maven / Gradle / Ivy

The newest version!
/*Server class MD5: cfea0d95c55179cb855a6582bf0aa29a*/
package com.jelastic.api.development.persistence;

/**
 * @name Jelastic API Client
 * @version 8.11.2
 * @copyright Jelastic, Inc.
 */
public enum PlatformGroup {

    USERS(0), ADMIN(1), TESTER(2), TRUSTED(3);

    private int id;

    PlatformGroup(int id) {
        this.id = id;
    }

    public static final PlatformGroup get(String group) {
        if (group == null) {
            return null;
        }
        int id = -1;
        if (group.equalsIgnoreCase(USERS.toString())) {
            id = 0;
        } else if (group.equalsIgnoreCase(ADMIN.toString())) {
            id = 1;
        } else if (group.equalsIgnoreCase(TESTER.toString())) {
            id = 2;
        } else if (group.equalsIgnoreCase(TRUSTED.toString())) {
            id = 3;
        } else {
            try {
                id = Integer.parseInt(group);
            } catch (Exception ex) {
                return null;
            }
        }
        return get(id);
    }

    public static final PlatformGroup get(int id) {
        switch(id) {
            case 0:
                return USERS;
            case 1:
                return ADMIN;
            case 2:
                return TESTER;
            case 3:
                return TRUSTED;
            default:
                return null;
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy