Class V1LeaseSpec

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

@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", date="2025-05-20T20:47:13.890592Z[Etc/UTC]", comments="Generator version: 7.13.0") public class V1LeaseSpec extends Object
LeaseSpec is a specification of a Lease.
  • Field Details

  • Constructor Details

    • V1LeaseSpec

      public V1LeaseSpec()
  • Method Details

    • acquireTime

      public V1LeaseSpec acquireTime(@Nullable OffsetDateTime acquireTime)
    • getAcquireTime

      @Nullable public OffsetDateTime getAcquireTime()
      acquireTime is a time when the current lease was acquired.
      Returns:
      acquireTime
    • setAcquireTime

      public void setAcquireTime(@Nullable OffsetDateTime acquireTime)
    • holderIdentity

      public V1LeaseSpec holderIdentity(@Nullable String holderIdentity)
    • getHolderIdentity

      @Nullable public String getHolderIdentity()
      holderIdentity contains the identity of the holder of a current lease. If Coordinated Leader Election is used, the holder identity must be equal to the elected LeaseCandidate.metadata.name field.
      Returns:
      holderIdentity
    • setHolderIdentity

      public void setHolderIdentity(@Nullable String holderIdentity)
    • leaseDurationSeconds

      public V1LeaseSpec leaseDurationSeconds(@Nullable Integer leaseDurationSeconds)
    • getLeaseDurationSeconds

      @Nullable public Integer getLeaseDurationSeconds()
      leaseDurationSeconds is a duration that candidates for a lease need to wait to force acquire it. This is measured against the time of last observed renewTime.
      Returns:
      leaseDurationSeconds
    • setLeaseDurationSeconds

      public void setLeaseDurationSeconds(@Nullable Integer leaseDurationSeconds)
    • leaseTransitions

      public V1LeaseSpec leaseTransitions(@Nullable Integer leaseTransitions)
    • getLeaseTransitions

      @Nullable public Integer getLeaseTransitions()
      leaseTransitions is the number of transitions of a lease between holders.
      Returns:
      leaseTransitions
    • setLeaseTransitions

      public void setLeaseTransitions(@Nullable Integer leaseTransitions)
    • preferredHolder

      public V1LeaseSpec preferredHolder(@Nullable String preferredHolder)
    • getPreferredHolder

      @Nullable public String getPreferredHolder()
      PreferredHolder signals to a lease holder that the lease has a more optimal holder and should be given up. This field can only be set if Strategy is also set.
      Returns:
      preferredHolder
    • setPreferredHolder

      public void setPreferredHolder(@Nullable String preferredHolder)
    • renewTime

      public V1LeaseSpec renewTime(@Nullable OffsetDateTime renewTime)
    • getRenewTime

      @Nullable public OffsetDateTime getRenewTime()
      renewTime is a time when the current holder of a lease has last updated the lease.
      Returns:
      renewTime
    • setRenewTime

      public void setRenewTime(@Nullable OffsetDateTime renewTime)
    • strategy

      public V1LeaseSpec strategy(@Nullable String strategy)
    • getStrategy

      @Nullable public String getStrategy()
      Strategy indicates the strategy for picking the leader for coordinated leader election. If the field is not specified, there is no active coordination for this lease. (Alpha) Using this field requires the CoordinatedLeaderElection feature gate to be enabled.
      Returns:
      strategy
    • setStrategy

      public void setStrategy(@Nullable String strategy)
    • 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 V1LeaseSpec
    • fromJson

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

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