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

com.aliction.gitproviders.bitbucket.objects.BitbucketPermission Maven / Gradle / Ivy

There is a newer version: 0.2.1
Show newest version
package com.aliction.gitproviders.bitbucket.objects;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonGetter;

/**
 * 
 * @author Aly Ibrahim
 * Date: Oct 25, 2019
 *
 */
public enum BitbucketPermission {
    ADMIN("admin"),
    READ("read"),
    WRITE("write");

    private String permission;

    private BitbucketPermission(String role) {
        this.permission = role.toUpperCase();
    }

    @Override
    public String toString() {
        return permission;
    }

    @JsonCreator
    public static BitbucketPermission setRole(String input) {
        return BitbucketPermission.valueOf(input.toUpperCase());
    }

    @JsonGetter
    // TODO: return JSON string (Serialized) value in lower case
    public String getRole() {
        return toString().toLowerCase();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy