Record Class DocumentLocks

java.lang.Object
java.lang.Record
com.priint.pubserverapi.document.lock.DocumentLocks
Record Components:
documentPointer - A set of values that identify a document system-wide.
locks - Current locks issued for the document. Document is considered unlocked if this set is empty.
All Implemented Interfaces:
Iterable<Lock>

public record DocumentLocks(DocumentPointer documentPointer, Set<Lock> locks) extends Record implements Iterable<Lock>
A class representing document and current locks issued for it.
  • Constructor Details

    • DocumentLocks

      public DocumentLocks(DocumentPointer documentPointer, Set<Lock> locks)
      Creates an instance of a DocumentLocks record class.
      Parameters:
      documentPointer - the value for the documentPointer record component
      locks - the value for the locks record component
  • Method Details

    • iterator

      public Iterator<Lock> iterator()
      Specified by:
      iterator in interface Iterable<Lock>
    • stream

      public Stream<Lock> stream()
    • isLocked

      public boolean isLocked()
    • isUnlocked

      public boolean isUnlocked()
    • 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.
    • documentPointer

      public DocumentPointer documentPointer()
      Returns the value of the documentPointer record component.
      Returns:
      the value of the documentPointer record component
    • locks

      public Set<Lock> locks()
      Returns the value of the locks record component.
      Returns:
      the value of the locks record component