<commit_before>package com.sequenceiq.cloudbreak.api.endpoint.v4.util.base;

import com.sequenceiq.authorization.resource.AuthorizationResourceAction;

public enum RightV4 {
    DISTROX_READ(AuthorizationResourceAction.DATAHUB_READ),
    DISTROX_WRITE(AuthorizationResourceAction.DATAHUB_WRITE),
    SDX_READ(AuthorizationResourceAction.DATALAKE_READ),
    SDX_WRITE(AuthorizationResourceAction.DATALAKE_WRITE),
    ENVIRONMENT_READ(AuthorizationResourceAction.ENVIRONMENT_READ),
    ENVIRONMENT_WRITE(AuthorizationResourceAction.ENVIRONMENT_WRITE);

    private AuthorizationResourceAction action;

    RightV4(AuthorizationResourceAction action) {
        this.action = action;
    }

    public AuthorizationResourceAction getAction() {
        return action;
    }
}<commit_msg>CB-9000 checkright util api should fall back to a default value for right enum in case of error<commit_after>package com.sequenceiq.cloudbreak.api.endpoint.v4.util.base;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.sequenceiq.authorization.resource.AuthorizationResourceAction;

public enum RightV4 {
    DISTROX_READ(AuthorizationResourceAction.DATAHUB_READ),
    DISTROX_WRITE(AuthorizationResourceAction.DATAHUB_WRITE),
    SDX_READ(AuthorizationResourceAction.DATALAKE_READ),
    SDX_WRITE(AuthorizationResourceAction.DATALAKE_WRITE),
    ENVIRONMENT_READ(AuthorizationResourceAction.ENVIRONMENT_READ),
    ENVIRONMENT_WRITE(AuthorizationResourceAction.ENVIRONMENT_WRITE);

    private AuthorizationResourceAction action;

    RightV4(AuthorizationResourceAction action) {
        this.action = action;
    }

    public AuthorizationResourceAction getAction() {
        return action;
    }

    @JsonCreator
    public static RightV4 fromString(String string) {
        try {
            return RightV4.valueOf(string);
        } catch (Exception e) {
            return ENVIRONMENT_READ;
        }
    }
}
{'fraction_non_alphanumeric': 0.06896551724137931, 'fraction_numerical': 0.006269592476489028, 'mean_word_length': 4.7164179104477615, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2020081', 'n_tokens_mistral': 553, 'n_tokens_neox': 547, 'n_words': 83}