Package it.polimi.ingsw.Server
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 firstcommuter
- synchronization commutersem
- synchronization Semaphore
- Enclosing class:
RMIServer
private static record RMIServer.AdmissionResult(int numPlayers, Object commuter, Semaphore sem)
extends Record
Admission phase result
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Object
The field for thecommuter
record component.private final int
The field for thenumPlayers
record component.private final Semaphore
The field for thesem
record component. -
Constructor Summary
ModifierConstructorDescriptionprivate
AdmissionResult
(int numPlayers, Object commuter, Semaphore sem) Creates an instance of aAdmissionResult
record class. -
Method Summary
Modifier and TypeMethodDescriptioncommuter()
Returns the value of thecommuter
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.int
Returns the value of thenumPlayers
record component.sem()
Returns the value of thesem
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
numPlayers
private final int numPlayersThe field for thenumPlayers
record component. -
commuter
The field for thecommuter
record component. -
sem
The field for thesem
record component.
-
-
Constructor Details
-
AdmissionResult
Creates an instance of aAdmissionResult
record class.- Parameters:
numPlayers
- the value for thenumPlayers
record componentcommuter
- the value for thecommuter
record componentsem
- the value for thesem
record component
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
numPlayers
public int numPlayers()Returns the value of thenumPlayers
record component.- Returns:
- the value of the
numPlayers
record component
-
commuter
Returns the value of thecommuter
record component.- Returns:
- the value of the
commuter
record component
-
sem
Returns the value of thesem
record component.- Returns:
- the value of the
sem
record component
-