Enum ValidFeatureKeyPredicate

java.lang.Object
java.lang.Enum<ValidFeatureKeyPredicate>
com.atlassian.sal.api.features.ValidFeatureKeyPredicate
All Implemented Interfaces:
Serializable, Comparable<ValidFeatureKeyPredicate>, java.lang.constant.Constable, Predicate<String>

@Immutable public enum ValidFeatureKeyPredicate extends Enum<ValidFeatureKeyPredicate> implements Predicate<String>
A given string represents a valid feature key if the following conditions are satisfied:
  • Contains alphanumeric characters including the dot (.), dash (,) and underscore (_) only
  • The minimal size is at least one character, while the upper limit is not restricted
Since:
2.10
  • Enum Constant Details

  • Method Details

    • values

      public static ValidFeatureKeyPredicate[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static ValidFeatureKeyPredicate valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • isValidFeatureKey

      public static boolean isValidFeatureKey(@Nullable String input)
      Verify that the given string represents a valid feature key.
      Parameters:
      input - a feature key candidate
      Returns:
      true if the given input is an acceptable feature key, false otherwise
      See Also:
    • checkFeatureKey

      public static String checkFeatureKey(@Nullable String input)
      Ensure that the given input string is a valid feature key. Otherwise an exception is thrown.
      Parameters:
      input - the expected feature key
      Returns:
      the input if it is a valid feature key
      Throws:
      InvalidFeatureKeyException - if the input is not a valid feature key
    • test

      public boolean test(@Nullable String input)
      Verify that the given string represents a valid feature key.
      Specified by:
      test in interface Predicate<String>
      Parameters:
      input - a feature key candidate
      Returns:
      true if the given input is an acceptable feature key, false otherwise
      Since:
      4.6.0