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.directory.model;
 
 
Container for the parameters to the CreateComputer operation.

Creates a computer account in the specified directory, and joins the computer to the directory.

 
 public class CreateComputerRequest extends AmazonWebServiceRequest implements SerializableCloneable {

    
The identifier of the directory to create the computer account in.

Constraints:
Pattern: ^d-[0-9a-f]{10}$

 
     private String directoryId;

    
The name of the computer account.

Constraints:
Length: 1 - 15

 
     private String computerName;

    
A one-time password that is used to join the computer to the directory. You should generate a random, strong password to use for this parameter.

Constraints:
Length: 8 - 64
Pattern: [\u0020-\u00FF]+

 
     private String password;

    
The fully-qualified distinguished name of the organizational unit to place the computer account in.

Constraints:
Length: 1 - 2000

 
     private String organizationalUnitDistinguishedName;

    
An array of Attribute objects that contain any LDAP attributes to apply to the computer account.
 
The identifier of the directory to create the computer account in.

Constraints:
Pattern: ^d-[0-9a-f]{10}$

Returns:
The identifier of the directory to create the computer account in.
 
     public String getDirectoryId() {
         return ;
     }
    
    
The identifier of the directory to create the computer account in.

Constraints:
Pattern: ^d-[0-9a-f]{10}$

Parameters:
directoryId The identifier of the directory to create the computer account in.
 
     public void setDirectoryId(String directoryId) {
         this. = directoryId;
     }
    
    
The identifier of the directory to create the computer account in.

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

Constraints:
Pattern: ^d-[0-9a-f]{10}$

Parameters:
directoryId The identifier of the directory to create the computer account in.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateComputerRequest withDirectoryId(String directoryId) {
        this. = directoryId;
        return this;
    }

    
The name of the computer account.

Constraints:
Length: 1 - 15

Returns:
The name of the computer account.
    public String getComputerName() {
        return ;
    }
    
    
The name of the computer account.

Constraints:
Length: 1 - 15

Parameters:
computerName The name of the computer account.
    public void setComputerName(String computerName) {
        this. = computerName;
    }
    
    
The name of the computer account.

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

Constraints:
Length: 1 - 15

Parameters:
computerName The name of the computer account.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateComputerRequest withComputerName(String computerName) {
        this. = computerName;
        return this;
    }

    
A one-time password that is used to join the computer to the directory. You should generate a random, strong password to use for this parameter.

Constraints:
Length: 8 - 64
Pattern: [\u0020-\u00FF]+

Returns:
A one-time password that is used to join the computer to the directory. You should generate a random, strong password to use for this parameter.
    public String getPassword() {
        return ;
    }
    
    
A one-time password that is used to join the computer to the directory. You should generate a random, strong password to use for this parameter.

Constraints:
Length: 8 - 64
Pattern: [\u0020-\u00FF]+

Parameters:
password A one-time password that is used to join the computer to the directory. You should generate a random, strong password to use for this parameter.
    public void setPassword(String password) {
        this. = password;
    }
    
    
A one-time password that is used to join the computer to the directory. You should generate a random, strong password to use for this parameter.

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

Constraints:
Length: 8 - 64
Pattern: [\u0020-\u00FF]+

Parameters:
password A one-time password that is used to join the computer to the directory. You should generate a random, strong password to use for this parameter.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateComputerRequest withPassword(String password) {
        this. = password;
        return this;
    }

    
The fully-qualified distinguished name of the organizational unit to place the computer account in.

Constraints:
Length: 1 - 2000

Returns:
The fully-qualified distinguished name of the organizational unit to place the computer account in.
    }
    
    
The fully-qualified distinguished name of the organizational unit to place the computer account in.

Constraints:
Length: 1 - 2000

Parameters:
organizationalUnitDistinguishedName The fully-qualified distinguished name of the organizational unit to place the computer account in.
    public void setOrganizationalUnitDistinguishedName(String organizationalUnitDistinguishedName) {
        this. = organizationalUnitDistinguishedName;
    }
    
    
The fully-qualified distinguished name of the organizational unit to place the computer account in.

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

Constraints:
Length: 1 - 2000

Parameters:
organizationalUnitDistinguishedName The fully-qualified distinguished name of the organizational unit to place the computer account in.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateComputerRequest withOrganizationalUnitDistinguishedName(String organizationalUnitDistinguishedName) {
        this. = organizationalUnitDistinguishedName;
        return this;
    }

    
An array of Attribute objects that contain any LDAP attributes to apply to the computer account.

Returns:
An array of Attribute objects that contain any LDAP attributes to apply to the computer account.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
An array of Attribute objects that contain any LDAP attributes to apply to the computer account.

Parameters:
computerAttributes An array of Attribute objects that contain any LDAP attributes to apply to the computer account.
    public void setComputerAttributes(java.util.Collection<AttributecomputerAttributes) {
        if (computerAttributes == null) {
            this. = null;
            return;
        }
        com.amazonaws.internal.ListWithAutoConstructFlag<AttributecomputerAttributesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<Attribute>(computerAttributes.size());
        computerAttributesCopy.addAll(computerAttributes);
        this. = computerAttributesCopy;
    }
    
    
An array of Attribute objects that contain any LDAP attributes to apply to the computer account.

NOTE: This method appends the values to the existing list (if any). Use setComputerAttributes(java.util.Collection) or withComputerAttributes(java.util.Collection) if you want to override the existing values.

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

Parameters:
computerAttributes An array of Attribute objects that contain any LDAP attributes to apply to the computer account.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateComputerRequest withComputerAttributes(Attribute... computerAttributes) {
        if (getComputerAttributes() == nullsetComputerAttributes(new java.util.ArrayList<Attribute>(computerAttributes.length));
        for (Attribute value : computerAttributes) {
            getComputerAttributes().add(value);
        }
        return this;
    }
    
    
An array of Attribute objects that contain any LDAP attributes to apply to the computer account.

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

Parameters:
computerAttributes An array of Attribute objects that contain any LDAP attributes to apply to the computer account.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (computerAttributes == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<AttributecomputerAttributesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<Attribute>(computerAttributes.size());
            computerAttributesCopy.addAll(computerAttributes);
            this. = computerAttributesCopy;
        }
        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 (getDirectoryId() != nullsb.append("DirectoryId: " + getDirectoryId() + ",");
        if (getComputerName() != nullsb.append("ComputerName: " + getComputerName() + ",");
        if (getPassword() != nullsb.append("Password: " + getPassword() + ",");
        if (getOrganizationalUnitDistinguishedName() != nullsb.append("OrganizationalUnitDistinguishedName: " + getOrganizationalUnitDistinguishedName() + ",");
        if (getComputerAttributes() != nullsb.append("ComputerAttributes: " + getComputerAttributes() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getDirectoryId() == null) ? 0 : getDirectoryId().hashCode()); 
        hashCode = prime * hashCode + ((getComputerName() == null) ? 0 : getComputerName().hashCode()); 
        hashCode = prime * hashCode + ((getPassword() == null) ? 0 : getPassword().hashCode()); 
        hashCode = prime * hashCode + ((getOrganizationalUnitDistinguishedName() == null) ? 0 : getOrganizationalUnitDistinguishedName().hashCode()); 
        hashCode = prime * hashCode + ((getComputerAttributes() == null) ? 0 : getComputerAttributes().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof CreateComputerRequest == falsereturn false;
        CreateComputerRequest other = (CreateComputerRequest)obj;
        
        if (other.getDirectoryId() == null ^ this.getDirectoryId() == nullreturn false;
        if (other.getDirectoryId() != null && other.getDirectoryId().equals(this.getDirectoryId()) == falsereturn false
        if (other.getComputerName() == null ^ this.getComputerName() == nullreturn false;
        if (other.getComputerName() != null && other.getComputerName().equals(this.getComputerName()) == falsereturn false
        if (other.getPassword() == null ^ this.getPassword() == nullreturn false;
        if (other.getPassword() != null && other.getPassword().equals(this.getPassword()) == falsereturn false
        if (other.getOrganizationalUnitDistinguishedName() == null ^ this.getOrganizationalUnitDistinguishedName() == nullreturn false;
        if (other.getOrganizationalUnitDistinguishedName() != null && other.getOrganizationalUnitDistinguishedName().equals(this.getOrganizationalUnitDistinguishedName()) == falsereturn false
        if (other.getComputerAttributes() == null ^ this.getComputerAttributes() == nullreturn false;
        if (other.getComputerAttributes() != null && other.getComputerAttributes().equals(this.getComputerAttributes()) == falsereturn false
        return true;
    }
    
    @Override
    public CreateComputerRequest clone() {
        
            return (CreateComputerRequestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X