Class SetMatcher

java.lang.Object
io.kubernetes.client.util.labels.SetMatcher
All Implemented Interfaces:
LabelMatcher

public class SetMatcher extends Object implements LabelMatcher
Set-based matcher for label-selection. https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#set-based-requirement
  • Method Details

    • in

      public static SetMatcher in(String key, String... values)
      The "in" set matcher. Matches if the label exists in the set.
      Parameters:
      key - the key
      values - the values
      Returns:
      the set matcher
    • notIn

      public static SetMatcher notIn(String key, String... values)
      The "not in" set matcher. Matches if the label doesn't exist in the set.
      Parameters:
      key - the key
      values - the values
      Returns:
      the set matcher
    • exists

      public static SetMatcher exists(String key)
      The "exists" set matcher. Matches if the label is present in the set.
      Parameters:
      key - the key
      Returns:
      the set matcher
    • notExists

      public static SetMatcher notExists(String key)
      The "not exists" set matcher. Matches if the label is not present in the set.
      Parameters:
      key - the key
      Returns:
      the set matcher
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getKey

      public String getKey()
      Specified by:
      getKey in interface LabelMatcher
    • test

      public boolean test(String s)
      Description copied from interface: LabelMatcher
      Returns true if a label value matches.
      Specified by:
      test in interface LabelMatcher
      Parameters:
      s - the label value
      Returns:
      the boolean