Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2014 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.ec2.model;
 
 
 public class CreateVolumePermission implements Serializable {

    
The specific AWS account ID that is to be added or removed from a volume's list of create volume permissions.
 
     private String userId;

    
The specific group that is to be added or removed from a volume's list of create volume permissions.

Constraints:
Allowed Values: all

 
     private String group;

    
The specific AWS account ID that is to be added or removed from a volume's list of create volume permissions.

Returns:
The specific AWS account ID that is to be added or removed from a volume's list of create volume permissions.
 
     public String getUserId() {
         return ;
     }
    
    
The specific AWS account ID that is to be added or removed from a volume's list of create volume permissions.

Parameters:
userId The specific AWS account ID that is to be added or removed from a volume's list of create volume permissions.
 
     public void setUserId(String userId) {
         this. = userId;
     }
    
    
The specific AWS account ID that is to be added or removed from a volume's list of create volume permissions.

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

Parameters:
userId The specific AWS account ID that is to be added or removed from a volume's list of create volume permissions.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public CreateVolumePermission withUserId(String userId) {
         this. = userId;
         return this;
     }

    
The specific group that is to be added or removed from a volume's list of create volume permissions.

Constraints:
Allowed Values: all

Returns:
The specific group that is to be added or removed from a volume's list of create volume permissions.
See also:
PermissionGroup
 
     public String getGroup() {
         return ;
     }
    
    
The specific group that is to be added or removed from a volume's list of create volume permissions.

Constraints:
Allowed Values: all

Parameters:
group The specific group that is to be added or removed from a volume's list of create volume permissions.
See also:
PermissionGroup
    public void setGroup(String group) {
        this. = group;
    }
    
    
The specific group that is to be added or removed from a volume's list of create volume permissions.

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

Constraints:
Allowed Values: all

Parameters:
group The specific group that is to be added or removed from a volume's list of create volume permissions.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
PermissionGroup
    public CreateVolumePermission withGroup(String group) {
        this. = group;
        return this;
    }

    
The specific group that is to be added or removed from a volume's list of create volume permissions.

Constraints:
Allowed Values: all

Parameters:
group The specific group that is to be added or removed from a volume's list of create volume permissions.
See also:
PermissionGroup
    public void setGroup(PermissionGroup group) {
        this. = group.toString();
    }
    
    
The specific group that is to be added or removed from a volume's list of create volume permissions.

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

Constraints:
Allowed Values: all

Parameters:
group The specific group that is to be added or removed from a volume's list of create volume permissions.
Returns:
A reference to this updated object so that method calls can be chained together.
See also:
PermissionGroup
    public CreateVolumePermission withGroup(PermissionGroup group) {
        this. = group.toString();
        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 (getUserId() != nullsb.append("UserId: " + getUserId() + ",");
        if (getGroup() != nullsb.append("Group: " + getGroup() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getUserId() == null) ? 0 : getUserId().hashCode()); 
        hashCode = prime * hashCode + ((getGroup() == null) ? 0 : getGroup().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof CreateVolumePermission == falsereturn false;
        CreateVolumePermission other = (CreateVolumePermission)obj;
        
        if (other.getUserId() == null ^ this.getUserId() == nullreturn false;
        if (other.getUserId() != null && other.getUserId().equals(this.getUserId()) == falsereturn false
        if (other.getGroup() == null ^ this.getGroup() == nullreturn false;
        if (other.getGroup() != null && other.getGroup().equals(this.getGroup()) == falsereturn false
        return true;
    }
    
}
    
New to GrepCode? Check out our FAQ X