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

com.almworks.jira.structure.api.settings.AttributeSensitivityMode Maven / Gradle / Ivy

There is a newer version: 17.25.3
Show newest version
package com.almworks.jira.structure.api.settings;

/**
 * Attribute sensitivity mode defines the default sensitivity of attributes. See {@link AttributeSensitivitySettings} for details.
 */
public enum AttributeSensitivityMode {
  /**
   * Standard sensitivity mode allows unfiltered access to numeric and date values for aggregation.
   */
  STANDARD(0),

  /**
   * Strict sensitivity mode does not allow unfiltered access to any attribute.
   */
  STRICT(1),

  /**
   * Permissive sensitivity mode allows unfiltered access to any attribute for aggregation.
   */
  PERMISSIVE(2);

  private final int myCode;

  AttributeSensitivityMode(int code) {
    myCode = code;
  }

  /**
   * Returns the code for the mode. This code should be used when serializing the setting.
   *
   * @return code
   */
  public int getCode() {
    return myCode;
  }

  /**
   * Returns the mode associated with the given code
   *
   * @param value mode code
   * @return mode
   * @throws IllegalArgumentException if there's no mode with the given code
   */
  public static AttributeSensitivityMode valueOf(int value) {
    for (AttributeSensitivityMode mode : AttributeSensitivityMode.values()) {
      if (mode.getCode() == value) {
        return mode;
      }
    }
    throw new IllegalArgumentException(value + " is not a valid sensitivity mode code");
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy