All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amazonaws.services.gamelift.model.GameSession Maven / Gradle / Ivy

Go to download

The AWS SDK for Java with support for OSGi. The AWS SDK for Java provides Java APIs for building software on AWS' cost-effective, scalable, and reliable infrastructure products. The AWS Java SDK allows developers to code against APIs for all of Amazon's infrastructure web services (Amazon S3, Amazon EC2, Amazon SQS, Amazon Relational Database Service, Amazon AutoScaling, etc).

There is a newer version: 1.11.60
Show newest version
/*
 * Copyright 2011-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not
 * use this file except in compliance with the License. A copy of the License is
 * located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on
 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */
package com.amazonaws.services.gamelift.model;

import java.io.Serializable;

/**
 * 

* Properties describing a game session. *

*/ public class GameSession implements Serializable, Cloneable { /** *

* Unique identifier for a game session. *

*/ private String gameSessionId; /** *

* Descriptive label associated with a game session. Session names do not * need to be unique. *

*/ private String name; /** *

* Unique identifier for a fleet. *

*/ private String fleetId; /** *

* Time stamp indicating when this object was created. Format is an integer * representing the number of seconds since the Unix epoch (Unix time). *

*/ private java.util.Date creationTime; /** *

* Time stamp indicating when this fleet was terminated. Format is an * integer representing the number of seconds since the Unix epoch (Unix * time). *

*/ private java.util.Date terminationTime; /** *

* Number of players currently in the game session. *

*/ private Integer currentPlayerSessionCount; /** *

* Maximum number of players allowed in the game session. *

*/ private Integer maximumPlayerSessionCount; /** *

* Current status of the game session. A game session must be in an * ACTIVE state to have player sessions. *

*/ private String status; /** *

* Set of custom properties for the game session. *

*/ private java.util.List gameProperties; /** *

* IP address of the game session. To connect to a GameLift server process, * an app needs both the IP address and port number. *

*/ private String ipAddress; /** *

* Port number for the game session. To connect to a GameLift server * process, an app needs both the IP address and port number. *

*/ private Integer port; /** *

* Indicates whether or not the game session is accepting new players. *

*/ private String playerSessionCreationPolicy; /** *

* Unique identifier for a game session. *

* * @param gameSessionId * Unique identifier for a game session. */ public void setGameSessionId(String gameSessionId) { this.gameSessionId = gameSessionId; } /** *

* Unique identifier for a game session. *

* * @return Unique identifier for a game session. */ public String getGameSessionId() { return this.gameSessionId; } /** *

* Unique identifier for a game session. *

* * @param gameSessionId * Unique identifier for a game session. * @return Returns a reference to this object so that method calls can be * chained together. */ public GameSession withGameSessionId(String gameSessionId) { setGameSessionId(gameSessionId); return this; } /** *

* Descriptive label associated with a game session. Session names do not * need to be unique. *

* * @param name * Descriptive label associated with a game session. Session names do * not need to be unique. */ public void setName(String name) { this.name = name; } /** *

* Descriptive label associated with a game session. Session names do not * need to be unique. *

* * @return Descriptive label associated with a game session. Session names * do not need to be unique. */ public String getName() { return this.name; } /** *

* Descriptive label associated with a game session. Session names do not * need to be unique. *

* * @param name * Descriptive label associated with a game session. Session names do * not need to be unique. * @return Returns a reference to this object so that method calls can be * chained together. */ public GameSession withName(String name) { setName(name); return this; } /** *

* Unique identifier for a fleet. *

* * @param fleetId * Unique identifier for a fleet. */ public void setFleetId(String fleetId) { this.fleetId = fleetId; } /** *

* Unique identifier for a fleet. *

* * @return Unique identifier for a fleet. */ public String getFleetId() { return this.fleetId; } /** *

* Unique identifier for a fleet. *

* * @param fleetId * Unique identifier for a fleet. * @return Returns a reference to this object so that method calls can be * chained together. */ public GameSession withFleetId(String fleetId) { setFleetId(fleetId); return this; } /** *

* Time stamp indicating when this object was created. Format is an integer * representing the number of seconds since the Unix epoch (Unix time). *

* * @param creationTime * Time stamp indicating when this object was created. Format is an * integer representing the number of seconds since the Unix epoch * (Unix time). */ public void setCreationTime(java.util.Date creationTime) { this.creationTime = creationTime; } /** *

* Time stamp indicating when this object was created. Format is an integer * representing the number of seconds since the Unix epoch (Unix time). *

* * @return Time stamp indicating when this object was created. Format is an * integer representing the number of seconds since the Unix epoch * (Unix time). */ public java.util.Date getCreationTime() { return this.creationTime; } /** *

* Time stamp indicating when this object was created. Format is an integer * representing the number of seconds since the Unix epoch (Unix time). *

* * @param creationTime * Time stamp indicating when this object was created. Format is an * integer representing the number of seconds since the Unix epoch * (Unix time). * @return Returns a reference to this object so that method calls can be * chained together. */ public GameSession withCreationTime(java.util.Date creationTime) { setCreationTime(creationTime); return this; } /** *

* Time stamp indicating when this fleet was terminated. Format is an * integer representing the number of seconds since the Unix epoch (Unix * time). *

* * @param terminationTime * Time stamp indicating when this fleet was terminated. Format is an * integer representing the number of seconds since the Unix epoch * (Unix time). */ public void setTerminationTime(java.util.Date terminationTime) { this.terminationTime = terminationTime; } /** *

* Time stamp indicating when this fleet was terminated. Format is an * integer representing the number of seconds since the Unix epoch (Unix * time). *

* * @return Time stamp indicating when this fleet was terminated. Format is * an integer representing the number of seconds since the Unix * epoch (Unix time). */ public java.util.Date getTerminationTime() { return this.terminationTime; } /** *

* Time stamp indicating when this fleet was terminated. Format is an * integer representing the number of seconds since the Unix epoch (Unix * time). *

* * @param terminationTime * Time stamp indicating when this fleet was terminated. Format is an * integer representing the number of seconds since the Unix epoch * (Unix time). * @return Returns a reference to this object so that method calls can be * chained together. */ public GameSession withTerminationTime(java.util.Date terminationTime) { setTerminationTime(terminationTime); return this; } /** *

* Number of players currently in the game session. *

* * @param currentPlayerSessionCount * Number of players currently in the game session. */ public void setCurrentPlayerSessionCount(Integer currentPlayerSessionCount) { this.currentPlayerSessionCount = currentPlayerSessionCount; } /** *

* Number of players currently in the game session. *

* * @return Number of players currently in the game session. */ public Integer getCurrentPlayerSessionCount() { return this.currentPlayerSessionCount; } /** *

* Number of players currently in the game session. *

* * @param currentPlayerSessionCount * Number of players currently in the game session. * @return Returns a reference to this object so that method calls can be * chained together. */ public GameSession withCurrentPlayerSessionCount( Integer currentPlayerSessionCount) { setCurrentPlayerSessionCount(currentPlayerSessionCount); return this; } /** *

* Maximum number of players allowed in the game session. *

* * @param maximumPlayerSessionCount * Maximum number of players allowed in the game session. */ public void setMaximumPlayerSessionCount(Integer maximumPlayerSessionCount) { this.maximumPlayerSessionCount = maximumPlayerSessionCount; } /** *

* Maximum number of players allowed in the game session. *

* * @return Maximum number of players allowed in the game session. */ public Integer getMaximumPlayerSessionCount() { return this.maximumPlayerSessionCount; } /** *

* Maximum number of players allowed in the game session. *

* * @param maximumPlayerSessionCount * Maximum number of players allowed in the game session. * @return Returns a reference to this object so that method calls can be * chained together. */ public GameSession withMaximumPlayerSessionCount( Integer maximumPlayerSessionCount) { setMaximumPlayerSessionCount(maximumPlayerSessionCount); return this; } /** *

* Current status of the game session. A game session must be in an * ACTIVE state to have player sessions. *

* * @param status * Current status of the game session. A game session must be in an * ACTIVE state to have player sessions. * @see GameSessionStatus */ public void setStatus(String status) { this.status = status; } /** *

* Current status of the game session. A game session must be in an * ACTIVE state to have player sessions. *

* * @return Current status of the game session. A game session must be in an * ACTIVE state to have player sessions. * @see GameSessionStatus */ public String getStatus() { return this.status; } /** *

* Current status of the game session. A game session must be in an * ACTIVE state to have player sessions. *

* * @param status * Current status of the game session. A game session must be in an * ACTIVE state to have player sessions. * @return Returns a reference to this object so that method calls can be * chained together. * @see GameSessionStatus */ public GameSession withStatus(String status) { setStatus(status); return this; } /** *

* Current status of the game session. A game session must be in an * ACTIVE state to have player sessions. *

* * @param status * Current status of the game session. A game session must be in an * ACTIVE state to have player sessions. * @see GameSessionStatus */ public void setStatus(GameSessionStatus status) { this.status = status.toString(); } /** *

* Current status of the game session. A game session must be in an * ACTIVE state to have player sessions. *

* * @param status * Current status of the game session. A game session must be in an * ACTIVE state to have player sessions. * @return Returns a reference to this object so that method calls can be * chained together. * @see GameSessionStatus */ public GameSession withStatus(GameSessionStatus status) { setStatus(status); return this; } /** *

* Set of custom properties for the game session. *

* * @return Set of custom properties for the game session. */ public java.util.List getGameProperties() { return gameProperties; } /** *

* Set of custom properties for the game session. *

* * @param gameProperties * Set of custom properties for the game session. */ public void setGameProperties( java.util.Collection gameProperties) { if (gameProperties == null) { this.gameProperties = null; return; } this.gameProperties = new java.util.ArrayList( gameProperties); } /** *

* Set of custom properties for the game session. *

*

* NOTE: This method appends the values to the existing list (if * any). Use {@link #setGameProperties(java.util.Collection)} or * {@link #withGameProperties(java.util.Collection)} if you want to override * the existing values. *

* * @param gameProperties * Set of custom properties for the game session. * @return Returns a reference to this object so that method calls can be * chained together. */ public GameSession withGameProperties(GameProperty... gameProperties) { if (this.gameProperties == null) { setGameProperties(new java.util.ArrayList( gameProperties.length)); } for (GameProperty ele : gameProperties) { this.gameProperties.add(ele); } return this; } /** *

* Set of custom properties for the game session. *

* * @param gameProperties * Set of custom properties for the game session. * @return Returns a reference to this object so that method calls can be * chained together. */ public GameSession withGameProperties( java.util.Collection gameProperties) { setGameProperties(gameProperties); return this; } /** *

* IP address of the game session. To connect to a GameLift server process, * an app needs both the IP address and port number. *

* * @param ipAddress * IP address of the game session. To connect to a GameLift server * process, an app needs both the IP address and port number. */ public void setIpAddress(String ipAddress) { this.ipAddress = ipAddress; } /** *

* IP address of the game session. To connect to a GameLift server process, * an app needs both the IP address and port number. *

* * @return IP address of the game session. To connect to a GameLift server * process, an app needs both the IP address and port number. */ public String getIpAddress() { return this.ipAddress; } /** *

* IP address of the game session. To connect to a GameLift server process, * an app needs both the IP address and port number. *

* * @param ipAddress * IP address of the game session. To connect to a GameLift server * process, an app needs both the IP address and port number. * @return Returns a reference to this object so that method calls can be * chained together. */ public GameSession withIpAddress(String ipAddress) { setIpAddress(ipAddress); return this; } /** *

* Port number for the game session. To connect to a GameLift server * process, an app needs both the IP address and port number. *

* * @param port * Port number for the game session. To connect to a GameLift server * process, an app needs both the IP address and port number. */ public void setPort(Integer port) { this.port = port; } /** *

* Port number for the game session. To connect to a GameLift server * process, an app needs both the IP address and port number. *

* * @return Port number for the game session. To connect to a GameLift server * process, an app needs both the IP address and port number. */ public Integer getPort() { return this.port; } /** *

* Port number for the game session. To connect to a GameLift server * process, an app needs both the IP address and port number. *

* * @param port * Port number for the game session. To connect to a GameLift server * process, an app needs both the IP address and port number. * @return Returns a reference to this object so that method calls can be * chained together. */ public GameSession withPort(Integer port) { setPort(port); return this; } /** *

* Indicates whether or not the game session is accepting new players. *

* * @param playerSessionCreationPolicy * Indicates whether or not the game session is accepting new * players. * @see PlayerSessionCreationPolicy */ public void setPlayerSessionCreationPolicy( String playerSessionCreationPolicy) { this.playerSessionCreationPolicy = playerSessionCreationPolicy; } /** *

* Indicates whether or not the game session is accepting new players. *

* * @return Indicates whether or not the game session is accepting new * players. * @see PlayerSessionCreationPolicy */ public String getPlayerSessionCreationPolicy() { return this.playerSessionCreationPolicy; } /** *

* Indicates whether or not the game session is accepting new players. *

* * @param playerSessionCreationPolicy * Indicates whether or not the game session is accepting new * players. * @return Returns a reference to this object so that method calls can be * chained together. * @see PlayerSessionCreationPolicy */ public GameSession withPlayerSessionCreationPolicy( String playerSessionCreationPolicy) { setPlayerSessionCreationPolicy(playerSessionCreationPolicy); return this; } /** *

* Indicates whether or not the game session is accepting new players. *

* * @param playerSessionCreationPolicy * Indicates whether or not the game session is accepting new * players. * @see PlayerSessionCreationPolicy */ public void setPlayerSessionCreationPolicy( PlayerSessionCreationPolicy playerSessionCreationPolicy) { this.playerSessionCreationPolicy = playerSessionCreationPolicy .toString(); } /** *

* Indicates whether or not the game session is accepting new players. *

* * @param playerSessionCreationPolicy * Indicates whether or not the game session is accepting new * players. * @return Returns a reference to this object so that method calls can be * chained together. * @see PlayerSessionCreationPolicy */ public GameSession withPlayerSessionCreationPolicy( PlayerSessionCreationPolicy playerSessionCreationPolicy) { setPlayerSessionCreationPolicy(playerSessionCreationPolicy); return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getGameSessionId() != null) sb.append("GameSessionId: " + getGameSessionId() + ","); if (getName() != null) sb.append("Name: " + getName() + ","); if (getFleetId() != null) sb.append("FleetId: " + getFleetId() + ","); if (getCreationTime() != null) sb.append("CreationTime: " + getCreationTime() + ","); if (getTerminationTime() != null) sb.append("TerminationTime: " + getTerminationTime() + ","); if (getCurrentPlayerSessionCount() != null) sb.append("CurrentPlayerSessionCount: " + getCurrentPlayerSessionCount() + ","); if (getMaximumPlayerSessionCount() != null) sb.append("MaximumPlayerSessionCount: " + getMaximumPlayerSessionCount() + ","); if (getStatus() != null) sb.append("Status: " + getStatus() + ","); if (getGameProperties() != null) sb.append("GameProperties: " + getGameProperties() + ","); if (getIpAddress() != null) sb.append("IpAddress: " + getIpAddress() + ","); if (getPort() != null) sb.append("Port: " + getPort() + ","); if (getPlayerSessionCreationPolicy() != null) sb.append("PlayerSessionCreationPolicy: " + getPlayerSessionCreationPolicy()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof GameSession == false) return false; GameSession other = (GameSession) obj; if (other.getGameSessionId() == null ^ this.getGameSessionId() == null) return false; if (other.getGameSessionId() != null && other.getGameSessionId().equals(this.getGameSessionId()) == false) return false; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getFleetId() == null ^ this.getFleetId() == null) return false; if (other.getFleetId() != null && other.getFleetId().equals(this.getFleetId()) == false) return false; if (other.getCreationTime() == null ^ this.getCreationTime() == null) return false; if (other.getCreationTime() != null && other.getCreationTime().equals(this.getCreationTime()) == false) return false; if (other.getTerminationTime() == null ^ this.getTerminationTime() == null) return false; if (other.getTerminationTime() != null && other.getTerminationTime().equals(this.getTerminationTime()) == false) return false; if (other.getCurrentPlayerSessionCount() == null ^ this.getCurrentPlayerSessionCount() == null) return false; if (other.getCurrentPlayerSessionCount() != null && other.getCurrentPlayerSessionCount().equals( this.getCurrentPlayerSessionCount()) == false) return false; if (other.getMaximumPlayerSessionCount() == null ^ this.getMaximumPlayerSessionCount() == null) return false; if (other.getMaximumPlayerSessionCount() != null && other.getMaximumPlayerSessionCount().equals( this.getMaximumPlayerSessionCount()) == false) return false; if (other.getStatus() == null ^ this.getStatus() == null) return false; if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false) return false; if (other.getGameProperties() == null ^ this.getGameProperties() == null) return false; if (other.getGameProperties() != null && other.getGameProperties().equals(this.getGameProperties()) == false) return false; if (other.getIpAddress() == null ^ this.getIpAddress() == null) return false; if (other.getIpAddress() != null && other.getIpAddress().equals(this.getIpAddress()) == false) return false; if (other.getPort() == null ^ this.getPort() == null) return false; if (other.getPort() != null && other.getPort().equals(this.getPort()) == false) return false; if (other.getPlayerSessionCreationPolicy() == null ^ this.getPlayerSessionCreationPolicy() == null) return false; if (other.getPlayerSessionCreationPolicy() != null && other.getPlayerSessionCreationPolicy().equals( this.getPlayerSessionCreationPolicy()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getGameSessionId() == null) ? 0 : getGameSessionId() .hashCode()); hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getFleetId() == null) ? 0 : getFleetId().hashCode()); hashCode = prime * hashCode + ((getCreationTime() == null) ? 0 : getCreationTime() .hashCode()); hashCode = prime * hashCode + ((getTerminationTime() == null) ? 0 : getTerminationTime() .hashCode()); hashCode = prime * hashCode + ((getCurrentPlayerSessionCount() == null) ? 0 : getCurrentPlayerSessionCount().hashCode()); hashCode = prime * hashCode + ((getMaximumPlayerSessionCount() == null) ? 0 : getMaximumPlayerSessionCount().hashCode()); hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); hashCode = prime * hashCode + ((getGameProperties() == null) ? 0 : getGameProperties() .hashCode()); hashCode = prime * hashCode + ((getIpAddress() == null) ? 0 : getIpAddress().hashCode()); hashCode = prime * hashCode + ((getPort() == null) ? 0 : getPort().hashCode()); hashCode = prime * hashCode + ((getPlayerSessionCreationPolicy() == null) ? 0 : getPlayerSessionCreationPolicy().hashCode()); return hashCode; } @Override public GameSession clone() { try { return (GameSession) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException( "Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy