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

The policies for a load balancer.

 
 public class Policies implements SerializableCloneable {

    
The stickiness policies created using CreateAppCookieStickinessPolicy.
 
The stickiness policies created using CreateLBCookieStickinessPolicy.
 
The policies other than the stickiness policies.
 
Default constructor for a new Policies object. Callers should use the setter or fluent setter (with...) methods to initialize this object after creating it.
 
     public Policies() {}
    
    
The stickiness policies created using CreateAppCookieStickinessPolicy.

Returns:
The stickiness policies created using CreateAppCookieStickinessPolicy.
 
         if ( == null) {
               .setAutoConstruct(true);
         }
         return ;
     }
    
    
The stickiness policies created using CreateAppCookieStickinessPolicy.

Parameters:
appCookieStickinessPolicies The stickiness policies created using CreateAppCookieStickinessPolicy.
 
     public void setAppCookieStickinessPolicies(java.util.Collection<AppCookieStickinessPolicyappCookieStickinessPolicies) {
         if (appCookieStickinessPolicies == null) {
             this. = null;
             return;
         }
         com.amazonaws.internal.ListWithAutoConstructFlag<AppCookieStickinessPolicyappCookieStickinessPoliciesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<AppCookieStickinessPolicy>(appCookieStickinessPolicies.size());
         appCookieStickinessPoliciesCopy.addAll(appCookieStickinessPolicies);
         this. = appCookieStickinessPoliciesCopy;
     }
    
    
The stickiness policies created using CreateAppCookieStickinessPolicy.

NOTE: This method appends the values to the existing list (if any). Use setAppCookieStickinessPolicies(java.util.Collection) or withAppCookieStickinessPolicies(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:
appCookieStickinessPolicies The stickiness policies created using CreateAppCookieStickinessPolicy.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public Policies withAppCookieStickinessPolicies(AppCookieStickinessPolicy... appCookieStickinessPolicies) {
        if (getAppCookieStickinessPolicies() == nullsetAppCookieStickinessPolicies(new java.util.ArrayList<AppCookieStickinessPolicy>(appCookieStickinessPolicies.length));
        for (AppCookieStickinessPolicy value : appCookieStickinessPolicies) {
            getAppCookieStickinessPolicies().add(value);
        }
        return this;
    }
    
    
The stickiness policies created using CreateAppCookieStickinessPolicy.

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

Parameters:
appCookieStickinessPolicies The stickiness policies created using CreateAppCookieStickinessPolicy.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (appCookieStickinessPolicies == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<AppCookieStickinessPolicyappCookieStickinessPoliciesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<AppCookieStickinessPolicy>(appCookieStickinessPolicies.size());
            appCookieStickinessPoliciesCopy.addAll(appCookieStickinessPolicies);
            this. = appCookieStickinessPoliciesCopy;
        }
        return this;
    }

    
The stickiness policies created using CreateLBCookieStickinessPolicy.

Returns:
The stickiness policies created using CreateLBCookieStickinessPolicy.
        if ( == null) {
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
The stickiness policies created using CreateLBCookieStickinessPolicy.

Parameters:
lBCookieStickinessPolicies The stickiness policies created using CreateLBCookieStickinessPolicy.
    public void setLBCookieStickinessPolicies(java.util.Collection<LBCookieStickinessPolicylBCookieStickinessPolicies) {
        if (lBCookieStickinessPolicies == null) {
            this. = null;
            return;
        }
        com.amazonaws.internal.ListWithAutoConstructFlag<LBCookieStickinessPolicylBCookieStickinessPoliciesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<LBCookieStickinessPolicy>(lBCookieStickinessPolicies.size());
        lBCookieStickinessPoliciesCopy.addAll(lBCookieStickinessPolicies);
        this. = lBCookieStickinessPoliciesCopy;
    }
    
    
The stickiness policies created using CreateLBCookieStickinessPolicy.

NOTE: This method appends the values to the existing list (if any). Use setLBCookieStickinessPolicies(java.util.Collection) or withLBCookieStickinessPolicies(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:
lBCookieStickinessPolicies The stickiness policies created using CreateLBCookieStickinessPolicy.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Policies withLBCookieStickinessPolicies(LBCookieStickinessPolicy... lBCookieStickinessPolicies) {
        if (getLBCookieStickinessPolicies() == nullsetLBCookieStickinessPolicies(new java.util.ArrayList<LBCookieStickinessPolicy>(lBCookieStickinessPolicies.length));
        for (LBCookieStickinessPolicy value : lBCookieStickinessPolicies) {
            getLBCookieStickinessPolicies().add(value);
        }
        return this;
    }
    
    
The stickiness policies created using CreateLBCookieStickinessPolicy.

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

Parameters:
lBCookieStickinessPolicies The stickiness policies created using CreateLBCookieStickinessPolicy.
Returns:
A reference to this updated object so that method calls can be chained together.
        if (lBCookieStickinessPolicies == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<LBCookieStickinessPolicylBCookieStickinessPoliciesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<LBCookieStickinessPolicy>(lBCookieStickinessPolicies.size());
            lBCookieStickinessPoliciesCopy.addAll(lBCookieStickinessPolicies);
            this. = lBCookieStickinessPoliciesCopy;
        }
        return this;
    }

    
The policies other than the stickiness policies.

Returns:
The policies other than the stickiness policies.
    public java.util.List<StringgetOtherPolicies() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
The policies other than the stickiness policies.

Parameters:
otherPolicies The policies other than the stickiness policies.
    public void setOtherPolicies(java.util.Collection<StringotherPolicies) {
        if (otherPolicies == null) {
            this. = null;
            return;
        }
        com.amazonaws.internal.ListWithAutoConstructFlag<StringotherPoliciesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(otherPolicies.size());
        otherPoliciesCopy.addAll(otherPolicies);
        this. = otherPoliciesCopy;
    }
    
    
The policies other than the stickiness policies.

NOTE: This method appends the values to the existing list (if any). Use setOtherPolicies(java.util.Collection) or withOtherPolicies(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:
otherPolicies The policies other than the stickiness policies.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Policies withOtherPolicies(String... otherPolicies) {
        if (getOtherPolicies() == nullsetOtherPolicies(new java.util.ArrayList<String>(otherPolicies.length));
        for (String value : otherPolicies) {
            getOtherPolicies().add(value);
        }
        return this;
    }
    
    
The policies other than the stickiness policies.

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

Parameters:
otherPolicies The policies other than the stickiness policies.
Returns:
A reference to this updated object so that method calls can be chained together.
    public Policies withOtherPolicies(java.util.Collection<StringotherPolicies) {
        if (otherPolicies == null) {
            this. = null;
        } else {
            com.amazonaws.internal.ListWithAutoConstructFlag<StringotherPoliciesCopy = new com.amazonaws.internal.ListWithAutoConstructFlag<String>(otherPolicies.size());
            otherPoliciesCopy.addAll(otherPolicies);
            this. = otherPoliciesCopy;
        }
        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 (getAppCookieStickinessPolicies() != nullsb.append("AppCookieStickinessPolicies: " + getAppCookieStickinessPolicies() + ",");
        if (getLBCookieStickinessPolicies() != nullsb.append("LBCookieStickinessPolicies: " + getLBCookieStickinessPolicies() + ",");
        if (getOtherPolicies() != nullsb.append("OtherPolicies: " + getOtherPolicies() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getAppCookieStickinessPolicies() == null) ? 0 : getAppCookieStickinessPolicies().hashCode()); 
        hashCode = prime * hashCode + ((getLBCookieStickinessPolicies() == null) ? 0 : getLBCookieStickinessPolicies().hashCode()); 
        hashCode = prime * hashCode + ((getOtherPolicies() == null) ? 0 : getOtherPolicies().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof Policies == falsereturn false;
        Policies other = (Policies)obj;
        
        if (other.getAppCookieStickinessPolicies() == null ^ this.getAppCookieStickinessPolicies() == nullreturn false;
        if (other.getAppCookieStickinessPolicies() != null && other.getAppCookieStickinessPolicies().equals(this.getAppCookieStickinessPolicies()) == falsereturn false
        if (other.getLBCookieStickinessPolicies() == null ^ this.getLBCookieStickinessPolicies() == nullreturn false;
        if (other.getLBCookieStickinessPolicies() != null && other.getLBCookieStickinessPolicies().equals(this.getLBCookieStickinessPolicies()) == falsereturn false
        if (other.getOtherPolicies() == null ^ this.getOtherPolicies() == nullreturn false;
        if (other.getOtherPolicies() != null && other.getOtherPolicies().equals(this.getOtherPolicies()) == falsereturn false
        return true;
    }
    
    @Override
    public Policies clone() {
        try {
            return (Policiessuper.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