Record Class RrpcInterfaceMethodMeta.Policy

java.lang.Object
java.lang.Record
org.apache.juneau.http.remote.RrpcInterfaceMethodMeta.Policy
Record Components:
interceptors - The interceptor classes to apply (each must implement the client-side interceptor SPI).
timeout - The per-call response timeout as a duration string (empty = none).
retries - The max retry attempts (0 = disabled).
retryNonIdempotent - Whether to allow retrying non-idempotent verbs (POST/PATCH).
throwOnError - Whether to throw a generic exception on an unmatched error response.
Enclosing class:
RrpcInterfaceMethodMeta

public static record RrpcInterfaceMethodMeta.Policy(Class<?>[] interceptors, String timeout, int retries, boolean retryNonIdempotent, boolean throwOnError) extends Record
Method-level cross-cutting call policy: interceptors, per-call timeout, retries, and the generic throwOnError flag, sourced from @RemoteOp/verb annotation members.

Kept as a single carrier so the (already busy) method-meta constructor isn't flooded with scalar arguments. The interceptors are stored as raw Class<?>[] (rather than Class<? extends RestCallInterceptor>[]) because RestCallInterceptor lives in the juneau-rest-client module, which this module must not depend on; they are resolved to interceptor instances by the next-gen RemoteClient.

  • Field Details

  • Constructor Details

    • Policy

      public Policy(Class<?>[] interceptors, String timeout, int retries, boolean retryNonIdempotent, boolean throwOnError)
      Compact constructor.

      Defensively clones the mutable interceptors array so callers cannot mutate the cached policy's state.

  • Method Details

    • interceptors

      public Class<?>[] interceptors()
      Returns the value of the interceptors record component.
      Returns:
      the value of the interceptors record component
    • equals

      public 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • hashCode

      public 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
    • toString

      public 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
    • timeout

      public String timeout()
      Returns the value of the timeout record component.
      Returns:
      the value of the timeout record component
    • retries

      public int retries()
      Returns the value of the retries record component.
      Returns:
      the value of the retries record component
    • retryNonIdempotent

      public boolean retryNonIdempotent()
      Returns the value of the retryNonIdempotent record component.
      Returns:
      the value of the retryNonIdempotent record component
    • throwOnError

      public boolean throwOnError()
      Returns the value of the throwOnError record component.
      Returns:
      the value of the throwOnError record component