<commit_before><commit_msg>An enumeration of statuses for entities<commit_after>package brooklyn.entity.basic;

import brooklyn.entity.Entity;

import com.google.common.base.CaseFormat;

/**
 * An enumeration representing the status of an {@link Entity}.
 */
public enum Status {
    UNINITIALIZED,  // TODO document
    READY,          // TODO document
    STARTING,       // TODO document
    STARTED,        // TODO document
    PAUSED,         // TODO document
    STOPPING,       // TODO document
    STOPPED,        // TODO document
    FAILED,         // TODO document
    ERROR,          // TODO document
    IDLE,           // TODO document
    TIMED_OUT,      // TODO document
    WORKING,        // TODO document
    IN_PROGRESS,    // TODO document
    NOT_FOUND,      // TODO document
    ACCESS_DENIED,  // TODO document
    ON_FIRE,        // The entity is on fire
    UNRECOGNIZED;   // Returned if the status text cannot be parsed

    /**
     * The text representation of the {@link #name()}.
     *
     * This is formatted as lower case characters, with hyphens instead of spaces.
     */
    public String value() {
       return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_HYPHEN, name());
    }

    /** @see #value() */
    @Override
    public String toString() { return value(); }

    /**
     * Creates a {@link Status} from a text representation.
     *
     * This accepts the text representations output by the {@link #value()} method for each entry.
     *
     * @see #value()
     */
    public static Status fromValue(String v) {
       try {
          return valueOf(CaseFormat.LOWER_HYPHEN.to(CaseFormat.UPPER_UNDERSCORE, v));
       } catch (IllegalArgumentException iae) {
          return UNRECOGNIZED;
       }
    }
}
{'fraction_non_alphanumeric': 0.09750566893424037, 'fraction_numerical': 0.0, 'mean_word_length': 2.085664335664336, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '130869', 'n_tokens_mistral': 510, 'n_tokens_neox': 499, 'n_words': 155}