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

A complex type that specifies the AWS accounts, if any, that you want to allow to create signed URLs for private content. If you want to require signed URLs in requests for objects in the target origin that match the PathPattern for this cache behavior, specify true for Enabled, and specify the applicable values for Quantity and Items. For more information, go to Using a Signed URL to Serve Private Content in the Amazon CloudFront Developer Guide. If you don't want to require signed URLs in requests for objects that match PathPattern, specify false for Enabled and 0 for Quantity. Omit Items. To add, change, or remove one or more trusted signers, change Enabled to true (if it's currently false), change Quantity as applicable, and specify all of the trusted signers that you want to include in the updated distribution.

 
 public class TrustedSigners implements SerializableCloneable {

    
Specifies whether you want to require end users to use signed URLs to access the files specified by PathPattern and TargetOriginId.
 
     private Boolean enabled;

    
The number of trusted signers for this cache behavior.
 
     private Integer quantity;

    
Optional: A complex type that contains trusted signers for this cache behavior. If Quantity is 0, you can omit Items.
 
Default constructor for a new TrustedSigners object. Callers should use the setter or fluent setter (with...) methods to initialize this object after creating it.
 
     public TrustedSigners() {}
    
    
Constructs a new TrustedSigners object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.

Parameters:
items Optional: A complex type that contains trusted signers for this cache behavior. If Quantity is 0, you can omit Items.
 
     public TrustedSigners(java.util.List<Stringitems) {
         setItems(items);
     }

    
Specifies whether you want to require end users to use signed URLs to access the files specified by PathPattern and TargetOriginId.

Returns:
Specifies whether you want to require end users to use signed URLs to access the files specified by PathPattern and TargetOriginId.
 
     public Boolean isEnabled() {
         return ;
     }
    
    
Specifies whether you want to require end users to use signed URLs to access the files specified by PathPattern and TargetOriginId.

Parameters:
enabled Specifies whether you want to require end users to use signed URLs to access the files specified by PathPattern and TargetOriginId.
 
     public void setEnabled(Boolean enabled) {
         this. = enabled;
     }
    
    
Specifies whether you want to require end users to use signed URLs to access the files specified by PathPattern and TargetOriginId.

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

Parameters:
enabled Specifies whether you want to require end users to use signed URLs to access the files specified by PathPattern and TargetOriginId.
Returns:
A reference to this updated object so that method calls can be chained together.
    public TrustedSigners withEnabled(Boolean enabled) {
        this. = enabled;
        return this;
    }

    
Specifies whether you want to require end users to use signed URLs to access the files specified by PathPattern and TargetOriginId.

Returns:
Specifies whether you want to require end users to use signed URLs to access the files specified by PathPattern and TargetOriginId.
    public Boolean getEnabled() {
        return ;
    }

    
The number of trusted signers for this cache behavior.

Returns:
The number of trusted signers for this cache behavior.
    public Integer getQuantity() {
        return ;
    }
    
    
The number of trusted signers for this cache behavior.

Parameters:
quantity The number of trusted signers for this cache behavior.
    public void setQuantity(Integer quantity) {
        this. = quantity;
    }
    
    
The number of trusted signers for this cache behavior.

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

Parameters:
quantity The number of trusted signers for this cache behavior.
Returns:
A reference to this updated object so that method calls can be chained together.
    public TrustedSigners withQuantity(Integer quantity) {
        this. = quantity;
        return this;
    }

    
Optional: A complex type that contains trusted signers for this cache behavior. If Quantity is 0, you can omit Items.

Returns:
Optional: A complex type that contains trusted signers for this cache behavior. If Quantity is 0, you can omit Items.
    public java.util.List<StringgetItems() {
        if ( == null) {
               = new com.amazonaws.internal.ListWithAutoConstructFlag<String>();
              .setAutoConstruct(true);
        }
        return ;
    }
    
    
Optional: A complex type that contains trusted signers for this cache behavior. If Quantity is 0, you can omit Items.

Parameters:
items Optional: A complex type that contains trusted signers for this cache behavior. If Quantity is 0, you can omit Items.
    public void setItems(java.util.Collection<Stringitems) {
        if (items == null) {
            this. = null;
            return;
        }
        itemsCopy.addAll(items);
        this. = itemsCopy;
    }
    
    
Optional: A complex type that contains trusted signers for this cache behavior. If Quantity is 0, you can omit Items.

NOTE: This method appends the values to the existing list (if any). Use setItems(java.util.Collection) or withItems(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:
items Optional: A complex type that contains trusted signers for this cache behavior. If Quantity is 0, you can omit Items.
Returns:
A reference to this updated object so that method calls can be chained together.
    public TrustedSigners withItems(String... items) {
        if (getItems() == nullsetItems(new java.util.ArrayList<String>(items.length));
        for (String value : items) {
            getItems().add(value);
        }
        return this;
    }
    
    
Optional: A complex type that contains trusted signers for this cache behavior. If Quantity is 0, you can omit Items.

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

Parameters:
items Optional: A complex type that contains trusted signers for this cache behavior. If Quantity is 0, you can omit Items.
Returns:
A reference to this updated object so that method calls can be chained together.
    public TrustedSigners withItems(java.util.Collection<Stringitems) {
        if (items == null) {
            this. = null;
        } else {
            itemsCopy.addAll(items);
            this. = itemsCopy;
        }
        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 (isEnabled() != nullsb.append("Enabled: " + isEnabled() + ",");
        if (getQuantity() != nullsb.append("Quantity: " + getQuantity() + ",");
        if (getItems() != nullsb.append("Items: " + getItems() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((isEnabled() == null) ? 0 : isEnabled().hashCode()); 
        hashCode = prime * hashCode + ((getQuantity() == null) ? 0 : getQuantity().hashCode()); 
        hashCode = prime * hashCode + ((getItems() == null) ? 0 : getItems().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof TrustedSigners == falsereturn false;
        TrustedSigners other = (TrustedSigners)obj;
        
        if (other.isEnabled() == null ^ this.isEnabled() == nullreturn false;
        if (other.isEnabled() != null && other.isEnabled().equals(this.isEnabled()) == falsereturn false
        if (other.getQuantity() == null ^ this.getQuantity() == nullreturn false;
        if (other.getQuantity() != null && other.getQuantity().equals(this.getQuantity()) == falsereturn false
        if (other.getItems() == null ^ this.getItems() == nullreturn false;
        if (other.getItems() != null && other.getItems().equals(this.getItems()) == falsereturn false
        return true;
    }
    
    @Override
    public TrustedSigners clone() {
        try {
            return (TrustedSignerssuper.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