Record Class RMIServer.AdmissionResult

java.lang.Object
java.lang.Record
it.polimi.ingsw.Server.RMIServer.AdmissionResult
Record Components:
numPlayers - number of players in the game, tipically ignored by players following the first
commuter - synchronization commuter
sem - synchronization Semaphore
Enclosing class:
RMIServer

private static record RMIServer.AdmissionResult(int numPlayers, Object commuter, Semaphore sem) extends Record
Admission phase result
  • Field Details

    • numPlayers

      private final int numPlayers
      The field for the numPlayers record component.
    • commuter

      private final Object commuter
      The field for the commuter record component.
    • sem

      private final Semaphore sem
      The field for the sem record component.
  • Constructor Details

    • AdmissionResult

      private AdmissionResult(int numPlayers, Object commuter, Semaphore sem)
      Creates an instance of a AdmissionResult record class.
      Parameters:
      numPlayers - the value for the numPlayers record component
      commuter - the value for the commuter record component
      sem - the value for the sem record component
  • Method Details

    • 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.
    • numPlayers

      public int numPlayers()
      Returns the value of the numPlayers record component.
      Returns:
      the value of the numPlayers record component
    • commuter

      public Object commuter()
      Returns the value of the commuter record component.
      Returns:
      the value of the commuter record component
    • sem

      public Semaphore sem()
      Returns the value of the sem record component.
      Returns:
      the value of the sem record component