Record Class ResourceCondition<T extends io.fabric8.kubernetes.api.model.HasMetadata>

java.lang.Object
java.lang.Record
io.skodjob.testframe.resources.ResourceCondition<T>
Type Parameters:
T - Type of Kubernetes resource.
Record Components:
predicate - predicate function
conditionName - conditionName

public record ResourceCondition<T extends io.fabric8.kubernetes.api.model.HasMetadata>(Predicate<T extends io.fabric8.kubernetes.api.model.HasMetadata> predicate, String conditionName) extends Record
Represents a condition that can be applied to Kubernetes resources.
  • Constructor Details

    • ResourceCondition

      public ResourceCondition(Predicate<T> predicate, String conditionName)
      Creates an instance of a ResourceCondition record class.
      Parameters:
      predicate - the value for the predicate record component
      conditionName - the value for the conditionName record component
  • Method Details

    • readiness

      public static <T extends io.fabric8.kubernetes.api.model.HasMetadata> ResourceCondition<T> readiness(ResourceType<T> type)
      Creates a ResourceCondition representing readiness of a resource of the given type.
      Type Parameters:
      T - Type of Kubernetes resource.
      Parameters:
      type - The resource type.
      Returns:
      The ResourceCondition representing readiness.
    • deletion

      public static <T extends io.fabric8.kubernetes.api.model.HasMetadata> ResourceCondition<T> deletion()
      Creates a ResourceCondition representing deletion of a resource.
      Type Parameters:
      T - Type of Kubernetes resource.
      Returns:
      The ResourceCondition representing deletion.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • predicate

      public Predicate<T> predicate()
      Returns the value of the predicate record component.
      Returns:
      the value of the predicate record component
    • conditionName

      public String conditionName()
      Returns the value of the conditionName record component.
      Returns:
      the value of the conditionName record component