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.identitymanagement.model;
 

Contains the response to a successful ListEntitiesForPolicy request.

 
 public class ListEntitiesForPolicyResult implements SerializableCloneable {

    
A list of groups that the policy is attached to.
 
A list of users that the policy is attached to.
 
A list of roles that the policy is attached to.
 
A flag that indicates whether there are more entities to list. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more entities in the list.
 
     private Boolean isTruncated;

    
If IsTruncated is true, this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.

Constraints:
Length: 1 - 320
Pattern: [\u0020-\u00FF]*

 
     private String marker;

    
A list of groups that the policy is attached to.

Returns:
A list of groups that the policy is attached to.
 
     public java.util.List<PolicyGroupgetPolicyGroups() {
         if ( == null) {
                = new com.amazonaws.internal.ListWithAutoConstructFlag<PolicyGroup>();
               .setAutoConstruct(true);
         }
         return ;
     }
    
    
A list of groups that the policy is attached to.

Parameters:
policyGroups A list of groups that the policy is attached to.
 
     public void setPolicyGroups(java.util.Collection<PolicyGrouppolicyGroups) {
         if (policyGroups == null) {
             this. = null;
             return;
         }
         policyGroupsCopy.addAll(policyGroups);
         this. = policyGroupsCopy;
     }
    
    
A list of groups that the policy is attached to.

NOTE: This method appends the values to the existing list (if any). Use setPolicyGroups(java.util.Collection) or withPolicyGroups(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:
policyGroups A list of groups that the policy is attached to.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ListEntitiesForPolicyResult withPolicyGroups(PolicyGroup... policyGroups) {
        if (getPolicyGroups() == nullsetPolicyGroups(new java.util.ArrayList<PolicyGroup>(policyGroups.length));
        for (PolicyGroup value : policyGroups) {
            getPolicyGroups().add(value);
        }
        return this;
    }
    
    
A list of groups that the policy is attached to.

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

Parameters:
policyGroups A list of groups that the policy is attached to.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (policyGroups == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<PolicyGrouppolicyGroupsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<PolicyGroup>(policyGroups.size());
            policyGroupsCopy.addAll(policyGroups);
            this. = policyGroupsCopy;
        }
        return this;
    }

    
A list of users that the policy is attached to.

Returns:
A list of users that the policy is attached to.
    public java.util.List<PolicyUsergetPolicyUsers() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<PolicyUser>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
A list of users that the policy is attached to.

Parameters:
policyUsers A list of users that the policy is attached to.
    public void setPolicyUsers(java.util.Collection<PolicyUserpolicyUsers) {
        if (policyUsers == null) {
            this. = null;
            return;
        }
        policyUsersCopy.addAll(policyUsers);
        this. = policyUsersCopy;
    }
    
    
A list of users that the policy is attached to.

NOTE: This method appends the values to the existing list (if any). Use setPolicyUsers(java.util.Collection) or withPolicyUsers(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:
policyUsers A list of users that the policy is attached to.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ListEntitiesForPolicyResult withPolicyUsers(PolicyUser... policyUsers) {
        if (getPolicyUsers() == nullsetPolicyUsers(new java.util.ArrayList<PolicyUser>(policyUsers.length));
        for (PolicyUser value : policyUsers) {
            getPolicyUsers().add(value);
        }
        return this;
    }
    
    
A list of users that the policy is attached to.

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

Parameters:
policyUsers A list of users that the policy is attached to.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (policyUsers == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<PolicyUserpolicyUsersCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<PolicyUser>(policyUsers.size());
            policyUsersCopy.addAll(policyUsers);
            this. = policyUsersCopy;
        }
        return this;
    }

    
A list of roles that the policy is attached to.

Returns:
A list of roles that the policy is attached to.
    public java.util.List<PolicyRolegetPolicyRoles() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<PolicyRole>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
A list of roles that the policy is attached to.

Parameters:
policyRoles A list of roles that the policy is attached to.
    public void setPolicyRoles(java.util.Collection<PolicyRolepolicyRoles) {
        if (policyRoles == null) {
            this. = null;
            return;
        }
        policyRolesCopy.addAll(policyRoles);
        this. = policyRolesCopy;
    }
    
    
A list of roles that the policy is attached to.

NOTE: This method appends the values to the existing list (if any). Use setPolicyRoles(java.util.Collection) or withPolicyRoles(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:
policyRoles A list of roles that the policy is attached to.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ListEntitiesForPolicyResult withPolicyRoles(PolicyRole... policyRoles) {
        if (getPolicyRoles() == nullsetPolicyRoles(new java.util.ArrayList<PolicyRole>(policyRoles.length));
        for (PolicyRole value : policyRoles) {
            getPolicyRoles().add(value);
        }
        return this;
    }
    
    
A list of roles that the policy is attached to.

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

Parameters:
policyRoles A list of roles that the policy is attached to.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (policyRoles == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<PolicyRolepolicyRolesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<PolicyRole>(policyRoles.size());
            policyRolesCopy.addAll(policyRoles);
            this. = policyRolesCopy;
        }
        return this;
    }

    
A flag that indicates whether there are more entities to list. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more entities in the list.

Returns:
A flag that indicates whether there are more entities to list. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more entities in the list.
    public Boolean isTruncated() {
        return ;
    }
    
    
A flag that indicates whether there are more entities to list. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more entities in the list.

Parameters:
isTruncated A flag that indicates whether there are more entities to list. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more entities in the list.
    public void setIsTruncated(Boolean isTruncated) {
        this. = isTruncated;
    }
    
    
A flag that indicates whether there are more entities to list. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more entities in the list.

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

Parameters:
isTruncated A flag that indicates whether there are more entities to list. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more entities in the list.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ListEntitiesForPolicyResult withIsTruncated(Boolean isTruncated) {
        this. = isTruncated;
        return this;
    }

    
A flag that indicates whether there are more entities to list. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more entities in the list.

Returns:
A flag that indicates whether there are more entities to list. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more entities in the list.
    public Boolean getIsTruncated() {
        return ;
    }

    
If IsTruncated is true, this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.

Constraints:
Length: 1 - 320
Pattern: [\u0020-\u00FF]*

Returns:
If IsTruncated is true, this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.
    public String getMarker() {
        return ;
    }
    
    
If IsTruncated is true, this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.

Constraints:
Length: 1 - 320
Pattern: [\u0020-\u00FF]*

Parameters:
marker If IsTruncated is true, this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.
    public void setMarker(String marker) {
        this. = marker;
    }
    
    
If IsTruncated is true, this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.

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

Constraints:
Length: 1 - 320
Pattern: [\u0020-\u00FF]*

Parameters:
marker If IsTruncated is true, this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.
Returns:
A reference to this updated object so that method calls can be chained together.
    public ListEntitiesForPolicyResult withMarker(String marker) {
        this. = marker;
        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 (getPolicyGroups() != nullsb.append("PolicyGroups: " + getPolicyGroups() + ",");
        if (getPolicyUsers() != nullsb.append("PolicyUsers: " + getPolicyUsers() + ",");
        if (getPolicyRoles() != nullsb.append("PolicyRoles: " + getPolicyRoles() + ",");
        if (isTruncated() != nullsb.append("IsTruncated: " + isTruncated() + ",");
        if (getMarker() != nullsb.append("Marker: " + getMarker() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getPolicyGroups() == null) ? 0 : getPolicyGroups().hashCode()); 
        hashCode = prime * hashCode + ((getPolicyUsers() == null) ? 0 : getPolicyUsers().hashCode()); 
        hashCode = prime * hashCode + ((getPolicyRoles() == null) ? 0 : getPolicyRoles().hashCode()); 
        hashCode = prime * hashCode + ((isTruncated() == null) ? 0 : isTruncated().hashCode()); 
        hashCode = prime * hashCode + ((getMarker() == null) ? 0 : getMarker().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof ListEntitiesForPolicyResult == falsereturn false;
        
        if (other.getPolicyGroups() == null ^ this.getPolicyGroups() == nullreturn false;
        if (other.getPolicyGroups() != null && other.getPolicyGroups().equals(this.getPolicyGroups()) == falsereturn false
        if (other.getPolicyUsers() == null ^ this.getPolicyUsers() == nullreturn false;
        if (other.getPolicyUsers() != null && other.getPolicyUsers().equals(this.getPolicyUsers()) == falsereturn false
        if (other.getPolicyRoles() == null ^ this.getPolicyRoles() == nullreturn false;
        if (other.getPolicyRoles() != null && other.getPolicyRoles().equals(this.getPolicyRoles()) == falsereturn false
        if (other.isTruncated() == null ^ this.isTruncated() == nullreturn false;
        if (other.isTruncated() != null && other.isTruncated().equals(this.isTruncated()) == falsereturn false
        if (other.getMarker() == null ^ this.getMarker() == nullreturn false;
        if (other.getMarker() != null && other.getMarker().equals(this.getMarker()) == falsereturn false
        return true;
    }
    
    @Override
        try {
            return (ListEntitiesForPolicyResultsuper.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