Class GameSession
- java.lang.Object
-
- com.amazonaws.services.gamelift.model.GameSession
-
- All Implemented Interfaces:
Serializable,Cloneable
public class GameSession extends Object implements Serializable, Cloneable
Properties describing a game session.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description GameSession()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GameSessionclone()booleanequals(Object obj)DategetCreationTime()Time stamp indicating when this object was created.IntegergetCurrentPlayerSessionCount()Number of players currently in the game session.StringgetFleetId()Unique identifier for a fleet.List<GameProperty>getGameProperties()Set of custom properties for the game session.StringgetGameSessionId()Unique identifier for a game session.StringgetIpAddress()IP address of the game session.IntegergetMaximumPlayerSessionCount()Maximum number of players allowed in the game session.StringgetName()Descriptive label associated with this game session.StringgetPlayerSessionCreationPolicy()Indicates whether or not the game session is accepting new players.StringgetStatus()Current status of the game session.DategetTerminationTime()Time stamp indicating when this fleet was terminated.inthashCode()voidsetCreationTime(Date creationTime)Time stamp indicating when this object was created.voidsetCurrentPlayerSessionCount(Integer currentPlayerSessionCount)Number of players currently in the game session.voidsetFleetId(String fleetId)Unique identifier for a fleet.voidsetGameProperties(Collection<GameProperty> gameProperties)Set of custom properties for the game session.voidsetGameSessionId(String gameSessionId)Unique identifier for a game session.voidsetIpAddress(String ipAddress)IP address of the game session.voidsetMaximumPlayerSessionCount(Integer maximumPlayerSessionCount)Maximum number of players allowed in the game session.voidsetName(String name)Descriptive label associated with this game session.voidsetPlayerSessionCreationPolicy(PlayerSessionCreationPolicy playerSessionCreationPolicy)Indicates whether or not the game session is accepting new players.voidsetPlayerSessionCreationPolicy(String playerSessionCreationPolicy)Indicates whether or not the game session is accepting new players.voidsetStatus(GameSessionStatus status)Current status of the game session.voidsetStatus(String status)Current status of the game session.voidsetTerminationTime(Date terminationTime)Time stamp indicating when this fleet was terminated.StringtoString()Returns a string representation of this object; useful for testing and debugging.GameSessionwithCreationTime(Date creationTime)Time stamp indicating when this object was created.GameSessionwithCurrentPlayerSessionCount(Integer currentPlayerSessionCount)Number of players currently in the game session.GameSessionwithFleetId(String fleetId)Unique identifier for a fleet.GameSessionwithGameProperties(GameProperty... gameProperties)Set of custom properties for the game session.GameSessionwithGameProperties(Collection<GameProperty> gameProperties)Set of custom properties for the game session.GameSessionwithGameSessionId(String gameSessionId)Unique identifier for a game session.GameSessionwithIpAddress(String ipAddress)IP address of the game session.GameSessionwithMaximumPlayerSessionCount(Integer maximumPlayerSessionCount)Maximum number of players allowed in the game session.GameSessionwithName(String name)Descriptive label associated with this game session.GameSessionwithPlayerSessionCreationPolicy(PlayerSessionCreationPolicy playerSessionCreationPolicy)Indicates whether or not the game session is accepting new players.GameSessionwithPlayerSessionCreationPolicy(String playerSessionCreationPolicy)Indicates whether or not the game session is accepting new players.GameSessionwithStatus(GameSessionStatus status)Current status of the game session.GameSessionwithStatus(String status)Current status of the game session.GameSessionwithTerminationTime(Date terminationTime)Time stamp indicating when this fleet was terminated.
-
-
-
Method Detail
-
setGameSessionId
public void setGameSessionId(String gameSessionId)
Unique identifier for a game session.
- Parameters:
gameSessionId- Unique identifier for a game session.
-
getGameSessionId
public String getGameSessionId()
Unique identifier for a game session.
- Returns:
- Unique identifier for a game session.
-
withGameSessionId
public GameSession withGameSessionId(String gameSessionId)
Unique identifier for a game session.
- Parameters:
gameSessionId- Unique identifier for a game session.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setName
public void setName(String name)
Descriptive label associated with this game session. Session names do not need to be unique.
- Parameters:
name- Descriptive label associated with this game session. Session names do not need to be unique.
-
getName
public String getName()
Descriptive label associated with this game session. Session names do not need to be unique.
- Returns:
- Descriptive label associated with this game session. Session names do not need to be unique.
-
withName
public GameSession withName(String name)
Descriptive label associated with this game session. Session names do not need to be unique.
- Parameters:
name- Descriptive label associated with this game session. Session names do not need to be unique.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setFleetId
public void setFleetId(String fleetId)
Unique identifier for a fleet.
- Parameters:
fleetId- Unique identifier for a fleet.
-
getFleetId
public String getFleetId()
Unique identifier for a fleet.
- Returns:
- Unique identifier for a fleet.
-
withFleetId
public GameSession withFleetId(String fleetId)
Unique identifier for a fleet.
- Parameters:
fleetId- Unique identifier for a fleet.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setCreationTime
public void setCreationTime(Date creationTime)
Time stamp indicating when this object was created. Format is an integer representing the number of seconds since the Unix epoch (Unix time).
- Parameters:
creationTime- Time stamp indicating when this object was created. Format is an integer representing the number of seconds since the Unix epoch (Unix time).
-
getCreationTime
public Date getCreationTime()
Time stamp indicating when this object was created. Format is an integer representing the number of seconds since the Unix epoch (Unix time).
- Returns:
- Time stamp indicating when this object was created. Format is an integer representing the number of seconds since the Unix epoch (Unix time).
-
withCreationTime
public GameSession withCreationTime(Date creationTime)
Time stamp indicating when this object was created. Format is an integer representing the number of seconds since the Unix epoch (Unix time).
- Parameters:
creationTime- Time stamp indicating when this object was created. Format is an integer representing the number of seconds since the Unix epoch (Unix time).- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setTerminationTime
public void setTerminationTime(Date terminationTime)
Time stamp indicating when this fleet was terminated. Format is an integer representing the number of seconds since the Unix epoch (Unix time).
- Parameters:
terminationTime- Time stamp indicating when this fleet was terminated. Format is an integer representing the number of seconds since the Unix epoch (Unix time).
-
getTerminationTime
public Date getTerminationTime()
Time stamp indicating when this fleet was terminated. Format is an integer representing the number of seconds since the Unix epoch (Unix time).
- Returns:
- Time stamp indicating when this fleet was terminated. Format is an integer representing the number of seconds since the Unix epoch (Unix time).
-
withTerminationTime
public GameSession withTerminationTime(Date terminationTime)
Time stamp indicating when this fleet was terminated. Format is an integer representing the number of seconds since the Unix epoch (Unix time).
- Parameters:
terminationTime- Time stamp indicating when this fleet was terminated. Format is an integer representing the number of seconds since the Unix epoch (Unix time).- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setCurrentPlayerSessionCount
public void setCurrentPlayerSessionCount(Integer currentPlayerSessionCount)
Number of players currently in the game session.
- Parameters:
currentPlayerSessionCount- Number of players currently in the game session.
-
getCurrentPlayerSessionCount
public Integer getCurrentPlayerSessionCount()
Number of players currently in the game session.
- Returns:
- Number of players currently in the game session.
-
withCurrentPlayerSessionCount
public GameSession withCurrentPlayerSessionCount(Integer currentPlayerSessionCount)
Number of players currently in the game session.
- Parameters:
currentPlayerSessionCount- Number of players currently in the game session.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setMaximumPlayerSessionCount
public void setMaximumPlayerSessionCount(Integer maximumPlayerSessionCount)
Maximum number of players allowed in the game session.
- Parameters:
maximumPlayerSessionCount- Maximum number of players allowed in the game session.
-
getMaximumPlayerSessionCount
public Integer getMaximumPlayerSessionCount()
Maximum number of players allowed in the game session.
- Returns:
- Maximum number of players allowed in the game session.
-
withMaximumPlayerSessionCount
public GameSession withMaximumPlayerSessionCount(Integer maximumPlayerSessionCount)
Maximum number of players allowed in the game session.
- Parameters:
maximumPlayerSessionCount- Maximum number of players allowed in the game session.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setStatus
public void setStatus(String status)
Current status of the game session. A game session must be in an ACTIVE state to have player sessions.
- Parameters:
status- Current status of the game session. A game session must be in an ACTIVE state to have player sessions.- See Also:
GameSessionStatus
-
getStatus
public String getStatus()
Current status of the game session. A game session must be in an ACTIVE state to have player sessions.
- Returns:
- Current status of the game session. A game session must be in an ACTIVE state to have player sessions.
- See Also:
GameSessionStatus
-
withStatus
public GameSession withStatus(String status)
Current status of the game session. A game session must be in an ACTIVE state to have player sessions.
- Parameters:
status- Current status of the game session. A game session must be in an ACTIVE state to have player sessions.- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
GameSessionStatus
-
setStatus
public void setStatus(GameSessionStatus status)
Current status of the game session. A game session must be in an ACTIVE state to have player sessions.
- Parameters:
status- Current status of the game session. A game session must be in an ACTIVE state to have player sessions.- See Also:
GameSessionStatus
-
withStatus
public GameSession withStatus(GameSessionStatus status)
Current status of the game session. A game session must be in an ACTIVE state to have player sessions.
- Parameters:
status- Current status of the game session. A game session must be in an ACTIVE state to have player sessions.- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
GameSessionStatus
-
getGameProperties
public List<GameProperty> getGameProperties()
Set of custom properties for the game session.
- Returns:
- Set of custom properties for the game session.
-
setGameProperties
public void setGameProperties(Collection<GameProperty> gameProperties)
Set of custom properties for the game session.
- Parameters:
gameProperties- Set of custom properties for the game session.
-
withGameProperties
public GameSession withGameProperties(GameProperty... gameProperties)
Set of custom properties for the game session.
NOTE: This method appends the values to the existing list (if any). Use
setGameProperties(java.util.Collection)orwithGameProperties(java.util.Collection)if you want to override the existing values.- Parameters:
gameProperties- Set of custom properties for the game session.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
withGameProperties
public GameSession withGameProperties(Collection<GameProperty> gameProperties)
Set of custom properties for the game session.
- Parameters:
gameProperties- Set of custom properties for the game session.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setIpAddress
public void setIpAddress(String ipAddress)
IP address of the game session.
- Parameters:
ipAddress- IP address of the game session.
-
getIpAddress
public String getIpAddress()
IP address of the game session.
- Returns:
- IP address of the game session.
-
withIpAddress
public GameSession withIpAddress(String ipAddress)
IP address of the game session.
- Parameters:
ipAddress- IP address of the game session.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setPlayerSessionCreationPolicy
public void setPlayerSessionCreationPolicy(String playerSessionCreationPolicy)
Indicates whether or not the game session is accepting new players.
- Parameters:
playerSessionCreationPolicy- Indicates whether or not the game session is accepting new players.- See Also:
PlayerSessionCreationPolicy
-
getPlayerSessionCreationPolicy
public String getPlayerSessionCreationPolicy()
Indicates whether or not the game session is accepting new players.
- Returns:
- Indicates whether or not the game session is accepting new players.
- See Also:
PlayerSessionCreationPolicy
-
withPlayerSessionCreationPolicy
public GameSession withPlayerSessionCreationPolicy(String playerSessionCreationPolicy)
Indicates whether or not the game session is accepting new players.
- Parameters:
playerSessionCreationPolicy- Indicates whether or not the game session is accepting new players.- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
PlayerSessionCreationPolicy
-
setPlayerSessionCreationPolicy
public void setPlayerSessionCreationPolicy(PlayerSessionCreationPolicy playerSessionCreationPolicy)
Indicates whether or not the game session is accepting new players.
- Parameters:
playerSessionCreationPolicy- Indicates whether or not the game session is accepting new players.- See Also:
PlayerSessionCreationPolicy
-
withPlayerSessionCreationPolicy
public GameSession withPlayerSessionCreationPolicy(PlayerSessionCreationPolicy playerSessionCreationPolicy)
Indicates whether or not the game session is accepting new players.
- Parameters:
playerSessionCreationPolicy- Indicates whether or not the game session is accepting new players.- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
PlayerSessionCreationPolicy
-
toString
public String toString()
Returns a string representation of this object; useful for testing and debugging.- Overrides:
toStringin classObject- Returns:
- A string representation of this object.
- See Also:
Object.toString()
-
clone
public GameSession clone()
-
-