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;
 

Contains information about a computer account in a directory.

 
 public class Computer implements SerializableCloneable {

    
The identifier of the computer.

Constraints:
Length: 1 - 256
Pattern: [&\w+-.@]+

 
     private String computerId;

    
The computer name.

Constraints:
Length: 1 - 15

 
     private String computerName;

    
An array of Attribute objects that contain the LDAP attributes that belong to the computer account.
 
The identifier of the computer.

Constraints:
Length: 1 - 256
Pattern: [&\w+-.@]+

Returns:
The identifier of the computer.
 
     public String getComputerId() {
         return ;
     }
    
    
The identifier of the computer.

Constraints:
Length: 1 - 256
Pattern: [&\w+-.@]+

Parameters:
computerId The identifier of the computer.
 
     public void setComputerId(String computerId) {
         this. = computerId;
     }
    
    
The identifier of the computer.

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

Constraints:
Length: 1 - 256
Pattern: [&\w+-.@]+

Parameters:
computerId The identifier of the computer.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public Computer withComputerId(String computerId) {
         this. = computerId;
         return this;
     }

    
The computer name.

Constraints:
Length: 1 - 15

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

Constraints:
Length: 1 - 15

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

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

Constraints:
Length: 1 - 15

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

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

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

Parameters:
computerAttributes An array of Attribute objects that contain the LDAP attributes that belong 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 the LDAP attributes that belong 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 the LDAP attributes that belong to the computer account.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Computer 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 the LDAP attributes that belong 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 the LDAP attributes that belong to the computer account.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Computer withComputerAttributes(java.util.Collection<AttributecomputerAttributes) {
        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 (getComputerId() != nullsb.append("ComputerId: " + getComputerId() + ",");
        if (getComputerName() != nullsb.append("ComputerName: " + getComputerName() + ",");
        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 + ((getComputerId() == null) ? 0 : getComputerId().hashCode()); 
        hashCode = prime * hashCode + ((getComputerName() == null) ? 0 : getComputerName().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 Computer == falsereturn false;
        Computer other = (Computer)obj;
        
        if (other.getComputerId() == null ^ this.getComputerId() == nullreturn false;
        if (other.getComputerId() != null && other.getComputerId().equals(this.getComputerId()) == falsereturn false
        if (other.getComputerName() == null ^ this.getComputerName() == nullreturn false;
        if (other.getComputerName() != null && other.getComputerName().equals(this.getComputerName()) == 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 Computer clone() {
        try {
            return (Computersuper.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