Record Class PutResult

java.lang.Object
java.lang.Record
org.exoplatform.caldav.client.PutResult
Record Components:
status - the HTTP status the server answered
etag - the stored object's version when the server named one, exactly as sent; null otherwise — and a null here does NOT mean the write failed, only that confirming the stored version needs a read-back
location - the entry's real URL when the server chose its own path (BlueMind's CardDAV twin does), resolved absolute; null otherwise

public record PutResult(int status, String etag, String location) extends Record
What a conditional PUT answered. A 412 is a result, not an exception: under If-None-Match: * it means "already exists", under If-Match it means "somebody changed it first" — facts the caller's conflict rules consume, not faults.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The status a refused precondition answers.
  • Constructor Summary

    Constructors
    Constructor
    Description
    PutResult(int status, String etag, String location)
    Creates an instance of a PutResult record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    Returns the value of the etag record component.
    final int
    Returns a hash code value for this object.
    Returns the value of the location record component.
    boolean
    Whether the precondition was refused rather than the write performed.
    int
    Returns the value of the status record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • PRECONDITION_FAILED

      public static final int PRECONDITION_FAILED
      The status a refused precondition answers.
      See Also:
  • Constructor Details

    • PutResult

      public PutResult(int status, String etag, String location)
      Creates an instance of a PutResult record class.
      Parameters:
      status - the value for the status record component
      etag - the value for the etag record component
      location - the value for the location record component
  • Method Details

    • preconditionFailed

      public boolean preconditionFailed()
      Whether the precondition was refused rather than the write performed.
      Returns:
      true on a 412
    • 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. 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.
    • status

      public int status()
      Returns the value of the status record component.
      Returns:
      the value of the status record component
    • etag

      public String etag()
      Returns the value of the etag record component.
      Returns:
      the value of the etag record component
    • location

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