Class EqualityMatcher

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

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

    • equal

      public static EqualityMatcher equal(String key, String value)
      The "equal" matcher. Matches a label iff the label is present and equal.
      Parameters:
      key - the matching label key
      value - the matching label value
      Returns:
      the equality matcher
    • notEqual

      public static EqualityMatcher notEqual(String key, String value)
      The "not equal" matcher. Matches a label iff the label is not present or not equal.
      Parameters:
      key - the matching label key
      value - the matching label value
      Returns:
      the equality matcher
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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
    • getKey

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