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

io.codemodder.DefaultRuleSetting Maven / Gradle / Ivy

There is a newer version: 0.98.6
Show newest version
package io.codemodder;

import java.util.Objects;

/**
 * During analysis, this will be the default setting for every rule. All of the rules listed in the
 * 'exceptions' section of the configuration will be considered the other, opposite value.
 */
public enum DefaultRuleSetting {
  ENABLED("enabled"),
  DISABLED("disabled");

  private final String description;

  DefaultRuleSetting(final String description) {
    this.description = Objects.requireNonNull(description);
  }

  public String getDescription() {
    return description;
  }

  public static DefaultRuleSetting fromDescription(final String s) {
    for (DefaultRuleSetting value : values()) {
      if (value.getDescription().equalsIgnoreCase(s)) {
        return value;
      }
    }
    throw new IllegalArgumentException("unknown default rule setting");
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy