Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 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.workspaces.model;
 

Contains information about a WorkSpace.

 
 public class Workspace implements SerializableCloneable {

    
The identifier of the WorkSpace.

Constraints:
Pattern: ^ws-[0-9a-z]{8,63}$

 
     private String workspaceId;

    
The identifier of the AWS Directory Service directory that the WorkSpace belongs to.

Constraints:
Pattern: ^d-[0-9a-f]{8,63}$

 
     private String directoryId;

    
The user that the WorkSpace is assigned to.

Constraints:
Length: 1 - 63

 
     private String userName;

    
The IP address of the WorkSpace.
 
     private String ipAddress;

    
The operational state of the WorkSpace.

Constraints:
Allowed Values: PENDING, AVAILABLE, IMPAIRED, UNHEALTHY, REBOOTING, REBUILDING, TERMINATING, TERMINATED, SUSPENDED, ERROR

 
     private String state;

    
The identifier of the bundle that the WorkSpace was created from.

Constraints:
Pattern: ^wsb-[0-9a-z]{8,63}$

 
     private String bundleId;

    
The identifier of the subnet that the WorkSpace is in.

Constraints:
Pattern: ^(subnet-[0-9a-f]{8})$

 
     private String subnetId;

    
If the WorkSpace could not be created, this contains a textual error message that describes the failure.
 
     private String errorMessage;

    
If the WorkSpace could not be created, this contains the error code.
 
     private String errorCode;

    
The identifier of the WorkSpace.

Constraints:
Pattern: ^ws-[0-9a-z]{8,63}$

Returns:
The identifier of the WorkSpace.
 
     public String getWorkspaceId() {
        return ;
    }
    
    
The identifier of the WorkSpace.

Constraints:
Pattern: ^ws-[0-9a-z]{8,63}$

Parameters:
workspaceId The identifier of the WorkSpace.
    public void setWorkspaceId(String workspaceId) {
        this. = workspaceId;
    }
    
    
The identifier of the WorkSpace.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Pattern: ^ws-[0-9a-z]{8,63}$

Parameters:
workspaceId The identifier of the WorkSpace.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Workspace withWorkspaceId(String workspaceId) {
        this. = workspaceId;
        return this;
    }

    
The identifier of the AWS Directory Service directory that the WorkSpace belongs to.

Constraints:
Pattern: ^d-[0-9a-f]{8,63}$

Returns:
The identifier of the AWS Directory Service directory that the WorkSpace belongs to.
    public String getDirectoryId() {
        return ;
    }
    
    
The identifier of the AWS Directory Service directory that the WorkSpace belongs to.

Constraints:
Pattern: ^d-[0-9a-f]{8,63}$

Parameters:
directoryId The identifier of the AWS Directory Service directory that the WorkSpace belongs to.
    public void setDirectoryId(String directoryId) {
        this. = directoryId;
    }
    
    
The identifier of the AWS Directory Service directory that the WorkSpace belongs to.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Pattern: ^d-[0-9a-f]{8,63}$

Parameters:
directoryId The identifier of the AWS Directory Service directory that the WorkSpace belongs to.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Workspace withDirectoryId(String directoryId) {
        this. = directoryId;
        return this;
    }

    
The user that the WorkSpace is assigned to.

Constraints:
Length: 1 - 63

Returns:
The user that the WorkSpace is assigned to.
    public String getUserName() {
        return ;
    }
    
    
The user that the WorkSpace is assigned to.

Constraints:
Length: 1 - 63

Parameters:
userName The user that the WorkSpace is assigned to.
    public void setUserName(String userName) {
        this. = userName;
    }
    
    
The user that the WorkSpace is assigned to.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 1 - 63

Parameters:
userName The user that the WorkSpace is assigned to.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Workspace withUserName(String userName) {
        this. = userName;
        return this;
    }

    
The IP address of the WorkSpace.

Returns:
The IP address of the WorkSpace.
    public String getIpAddress() {
        return ;
    }
    
    
The IP address of the WorkSpace.

Parameters:
ipAddress The IP address of the WorkSpace.
    public void setIpAddress(String ipAddress) {
        this. = ipAddress;
    }
    
    
The IP address of the WorkSpace.

Returns a reference to this object so that method calls can be chained together.

Parameters:
ipAddress The IP address of the WorkSpace.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Workspace withIpAddress(String ipAddress) {
        this. = ipAddress;
        return this;
    }

    
The operational state of the WorkSpace.

Constraints:
Allowed Values: PENDING, AVAILABLE, IMPAIRED, UNHEALTHY, REBOOTING, REBUILDING, TERMINATING, TERMINATED, SUSPENDED, ERROR

Returns:
The operational state of the WorkSpace.
See also:
WorkspaceState
    public String getState() {
        return ;
    }
    
    
The operational state of the WorkSpace.

Constraints:
Allowed Values: PENDING, AVAILABLE, IMPAIRED, UNHEALTHY, REBOOTING, REBUILDING, TERMINATING, TERMINATED, SUSPENDED, ERROR

Parameters:
state The operational state of the WorkSpace.
See also:
WorkspaceState
    public void setState(String state) {
        this. = state;
    }
    
    
The operational state of the WorkSpace.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: PENDING, AVAILABLE, IMPAIRED, UNHEALTHY, REBOOTING, REBUILDING, TERMINATING, TERMINATED, SUSPENDED, ERROR

Parameters:
state The operational state of the WorkSpace.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
WorkspaceState
    public Workspace withState(String state) {
        this. = state;
        return this;
    }

    
The operational state of the WorkSpace.

Constraints:
Allowed Values: PENDING, AVAILABLE, IMPAIRED, UNHEALTHY, REBOOTING, REBUILDING, TERMINATING, TERMINATED, SUSPENDED, ERROR

Parameters:
state The operational state of the WorkSpace.
See also:
WorkspaceState
    public void setState(WorkspaceState state) {
        this. = state.toString();
    }
    
    
The operational state of the WorkSpace.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Allowed Values: PENDING, AVAILABLE, IMPAIRED, UNHEALTHY, REBOOTING, REBUILDING, TERMINATING, TERMINATED, SUSPENDED, ERROR

Parameters:
state The operational state of the WorkSpace.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
WorkspaceState
    public Workspace withState(WorkspaceState state) {
        this. = state.toString();
        return this;
    }

    
The identifier of the bundle that the WorkSpace was created from.

Constraints:
Pattern: ^wsb-[0-9a-z]{8,63}$

Returns:
The identifier of the bundle that the WorkSpace was created from.
    public String getBundleId() {
        return ;
    }
    
    
The identifier of the bundle that the WorkSpace was created from.

Constraints:
Pattern: ^wsb-[0-9a-z]{8,63}$

Parameters:
bundleId The identifier of the bundle that the WorkSpace was created from.
    public void setBundleId(String bundleId) {
        this. = bundleId;
    }
    
    
The identifier of the bundle that the WorkSpace was created from.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Pattern: ^wsb-[0-9a-z]{8,63}$

Parameters:
bundleId The identifier of the bundle that the WorkSpace was created from.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Workspace withBundleId(String bundleId) {
        this. = bundleId;
        return this;
    }

    
The identifier of the subnet that the WorkSpace is in.

Constraints:
Pattern: ^(subnet-[0-9a-f]{8})$

Returns:
The identifier of the subnet that the WorkSpace is in.
    public String getSubnetId() {
        return ;
    }
    
    
The identifier of the subnet that the WorkSpace is in.

Constraints:
Pattern: ^(subnet-[0-9a-f]{8})$

Parameters:
subnetId The identifier of the subnet that the WorkSpace is in.
    public void setSubnetId(String subnetId) {
        this. = subnetId;
    }
    
    
The identifier of the subnet that the WorkSpace is in.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Pattern: ^(subnet-[0-9a-f]{8})$

Parameters:
subnetId The identifier of the subnet that the WorkSpace is in.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Workspace withSubnetId(String subnetId) {
        this. = subnetId;
        return this;
    }

    
If the WorkSpace could not be created, this contains a textual error message that describes the failure.

Returns:
If the WorkSpace could not be created, this contains a textual error message that describes the failure.
    public String getErrorMessage() {
        return ;
    }
    
    
If the WorkSpace could not be created, this contains a textual error message that describes the failure.

Parameters:
errorMessage If the WorkSpace could not be created, this contains a textual error message that describes the failure.
    public void setErrorMessage(String errorMessage) {
        this. = errorMessage;
    }
    
    
If the WorkSpace could not be created, this contains a textual error message that describes the failure.

Returns a reference to this object so that method calls can be chained together.

Parameters:
errorMessage If the WorkSpace could not be created, this contains a textual error message that describes the failure.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Workspace withErrorMessage(String errorMessage) {
        this. = errorMessage;
        return this;
    }

    
If the WorkSpace could not be created, this contains the error code.

Returns:
If the WorkSpace could not be created, this contains the error code.
    public String getErrorCode() {
        return ;
    }
    
    
If the WorkSpace could not be created, this contains the error code.

Parameters:
errorCode If the WorkSpace could not be created, this contains the error code.
    public void setErrorCode(String errorCode) {
        this. = errorCode;
    }
    
    
If the WorkSpace could not be created, this contains the error code.

Returns a reference to this object so that method calls can be chained together.

Parameters:
errorCode If the WorkSpace could not be created, this contains the error code.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Workspace withErrorCode(String errorCode) {
        this. = errorCode;
        return this;
    }

    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getWorkspaceId() != nullsb.append("WorkspaceId: " + getWorkspaceId() + ",");
        if (getDirectoryId() != nullsb.append("DirectoryId: " + getDirectoryId() + ",");
        if (getUserName() != nullsb.append("UserName: " + getUserName() + ",");
        if (getIpAddress() != nullsb.append("IpAddress: " + getIpAddress() + ",");
        if (getState() != nullsb.append("State: " + getState() + ",");
        if (getBundleId() != nullsb.append("BundleId: " + getBundleId() + ",");
        if (getSubnetId() != nullsb.append("SubnetId: " + getSubnetId() + ",");
        if (getErrorMessage() != nullsb.append("ErrorMessage: " + getErrorMessage() + ",");
        if (getErrorCode() != nullsb.append("ErrorCode: " + getErrorCode() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getWorkspaceId() == null) ? 0 : getWorkspaceId().hashCode()); 
        hashCode = prime * hashCode + ((getDirectoryId() == null) ? 0 : getDirectoryId().hashCode()); 
        hashCode = prime * hashCode + ((getUserName() == null) ? 0 : getUserName().hashCode()); 
        hashCode = prime * hashCode + ((getIpAddress() == null) ? 0 : getIpAddress().hashCode()); 
        hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode()); 
        hashCode = prime * hashCode + ((getBundleId() == null) ? 0 : getBundleId().hashCode()); 
        hashCode = prime * hashCode + ((getSubnetId() == null) ? 0 : getSubnetId().hashCode()); 
        hashCode = prime * hashCode + ((getErrorMessage() == null) ? 0 : getErrorMessage().hashCode()); 
        hashCode = prime * hashCode + ((getErrorCode() == null) ? 0 : getErrorCode().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof Workspace == falsereturn false;
        Workspace other = (Workspace)obj;
        
        if (other.getWorkspaceId() == null ^ this.getWorkspaceId() == nullreturn false;
        if (other.getWorkspaceId() != null && other.getWorkspaceId().equals(this.getWorkspaceId()) == falsereturn false
        if (other.getDirectoryId() == null ^ this.getDirectoryId() == nullreturn false;
        if (other.getDirectoryId() != null && other.getDirectoryId().equals(this.getDirectoryId()) == falsereturn false
        if (other.getUserName() == null ^ this.getUserName() == nullreturn false;
        if (other.getUserName() != null && other.getUserName().equals(this.getUserName()) == falsereturn false
        if (other.getIpAddress() == null ^ this.getIpAddress() == nullreturn false;
        if (other.getIpAddress() != null && other.getIpAddress().equals(this.getIpAddress()) == falsereturn false
        if (other.getState() == null ^ this.getState() == nullreturn false;
        if (other.getState() != null && other.getState().equals(this.getState()) == falsereturn false
        if (other.getBundleId() == null ^ this.getBundleId() == nullreturn false;
        if (other.getBundleId() != null && other.getBundleId().equals(this.getBundleId()) == falsereturn false
        if (other.getSubnetId() == null ^ this.getSubnetId() == nullreturn false;
        if (other.getSubnetId() != null && other.getSubnetId().equals(this.getSubnetId()) == falsereturn false
        if (other.getErrorMessage() == null ^ this.getErrorMessage() == nullreturn false;
        if (other.getErrorMessage() != null && other.getErrorMessage().equals(this.getErrorMessage()) == falsereturn false
        if (other.getErrorCode() == null ^ this.getErrorCode() == nullreturn false;
        if (other.getErrorCode() != null && other.getErrorCode().equals(this.getErrorCode()) == falsereturn false
        return true;
    }
    
    @Override
    public Workspace clone() {
        try {
            return (Workspacesuper.clone();
        
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException(
                    "Got a CloneNotSupportedException from Object.clone() "
                    + "even though we're Cloneable!",
                    e);
        }
        
    }
}
    
New to GrepCode? Check out our FAQ X