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

Configuration for access logging for a distribution.

 
 public class LoggingConfig {

    
The bucket to receive access logs.
 
     private String bucket;

    
The prefix to use for stored access log files.
 
     private String prefix;

    
Default constructor for a new LoggingConfig object. Callers should use the setter or fluent setter (with...) methods to initialize this object after creating it.
 
     public LoggingConfig() {}
    
    
Constructs a new LoggingConfig object. Callers should use the setter or fluent setter (with...) methods to initialize any additional object members.

Parameters:
bucket The bucket to receive access logs.
prefix The prefix to use for stored access log files.
 
     public LoggingConfig(String bucketString prefix) {
         this. = bucket;
         this. = prefix;
     }

    
    
    
The bucket to receive access logs.

Returns:
The bucket to receive access logs.
 
     public String getBucket() {
         return ;
     }
    
    
The bucket to receive access logs.

Parameters:
bucket The bucket to receive access logs.
 
     public void setBucket(String bucket) {
         this. = bucket;
     }
    
    
The bucket to receive access logs.

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

Parameters:
bucket The bucket to receive access logs.
Returns:
A reference to this updated object so that method calls can be chained together.
 
     public LoggingConfig withBucket(String bucket) {
         this. = bucket;
         return this;
     }
    
    
    
The prefix to use for stored access log files.

Returns:
The prefix to use for stored access log files.
 
     public String getPrefix() {
         return ;
     }
    
    
The prefix to use for stored access log files.

Parameters:
prefix The prefix to use for stored access log files.
    public void setPrefix(String prefix) {
        this. = prefix;
    }
    
    
The prefix to use for stored access log files.

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

Parameters:
prefix The prefix to use for stored access log files.
Returns:
A reference to this updated object so that method calls can be chained together.
    public LoggingConfig withPrefix(String prefix) {
        this. = prefix;
        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 ( != nullsb.append("Bucket: " +  + ", ");
        if ( != nullsb.append("Prefix: " +  + ", ");
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getBucket() == null) ? 0 : getBucket().hashCode()); 
        hashCode = prime * hashCode + ((getPrefix() == null) ? 0 : getPrefix().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
    
        if (obj instanceof LoggingConfig == falsereturn false;
        LoggingConfig other = (LoggingConfig)obj;
        
        if (other.getBucket() == null ^ this.getBucket() == nullreturn false;
        if (other.getBucket() != null && other.getBucket().equals(this.getBucket()) == falsereturn false
        if (other.getPrefix() == null ^ this.getPrefix() == nullreturn false;
        if (other.getPrefix() != null && other.getPrefix().equals(this.getPrefix()) == falsereturn false
        return true;
    }
    
}
    
New to GrepCode? Check out our FAQ X