Class V1LabelSelectorRequirement

java.lang.Object
io.kubernetes.client.openapi.models.V1LabelSelectorRequirement

@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", date="2025-02-12T21:15:49.397498Z[Etc/UTC]", comments="Generator version: 7.6.0") public class V1LabelSelectorRequirement extends Object
A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
  • Field Details

  • Constructor Details

    • V1LabelSelectorRequirement

      public V1LabelSelectorRequirement()
  • Method Details

    • key

    • getKey

      @Nonnull public String getKey()
      key is the label key that the selector applies to.
      Returns:
      key
    • setKey

      public void setKey(String key)
    • operator

      public V1LabelSelectorRequirement operator(String operator)
    • getOperator

      @Nonnull public String getOperator()
      operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
      Returns:
      operator
    • setOperator

      public void setOperator(String operator)
    • values

      public V1LabelSelectorRequirement values(List<String> values)
    • addValuesItem

      public V1LabelSelectorRequirement addValuesItem(String valuesItem)
    • getValues

      @Nullable public List<String> getValues()
      values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
      Returns:
      values
    • setValues

      public void setValues(List<String> values)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

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

      public static void validateJsonElement(com.google.gson.JsonElement jsonElement) throws IOException
      Validates the JSON Element and throws an exception if issues found
      Parameters:
      jsonElement - JSON Element
      Throws:
      IOException - if the JSON Element is invalid with respect to V1LabelSelectorRequirement
    • fromJson

      public static V1LabelSelectorRequirement fromJson(String jsonString) throws IOException
      Create an instance of V1LabelSelectorRequirement given an JSON string
      Parameters:
      jsonString - JSON string
      Returns:
      An instance of V1LabelSelectorRequirement
      Throws:
      IOException - if the JSON string is invalid with respect to V1LabelSelectorRequirement
    • toJson

      public String toJson()
      Convert an instance of V1LabelSelectorRequirement to an JSON string
      Returns:
      JSON string