com.amazonaws.services.neptune.model.CloudwatchLogsExportConfiguration Maven / Gradle / Ivy
Show all versions of aws-java-sdk-neptune Show documentation
/*
* Copyright 2019-2024 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.neptune.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* The configuration setting for the log types to be enabled for export to CloudWatch Logs for a specific DB instance or
* DB cluster.
*
*
* The EnableLogTypes
and DisableLogTypes
arrays determine which logs will be exported (or not
* exported) to CloudWatch Logs.
*
*
* Valid log types are: audit
(to publish audit logs) and slowquery
(to publish slow-query
* logs). See Publishing Neptune
* logs to Amazon CloudWatch logs.
*
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CloudwatchLogsExportConfiguration implements Serializable, Cloneable {
/**
*
* The list of log types to enable.
*
*/
private java.util.List enableLogTypes;
/**
*
* The list of log types to disable.
*
*/
private java.util.List disableLogTypes;
/**
*
* The list of log types to enable.
*
*
* @return The list of log types to enable.
*/
public java.util.List getEnableLogTypes() {
return enableLogTypes;
}
/**
*
* The list of log types to enable.
*
*
* @param enableLogTypes
* The list of log types to enable.
*/
public void setEnableLogTypes(java.util.Collection enableLogTypes) {
if (enableLogTypes == null) {
this.enableLogTypes = null;
return;
}
this.enableLogTypes = new java.util.ArrayList(enableLogTypes);
}
/**
*
* The list of log types to enable.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setEnableLogTypes(java.util.Collection)} or {@link #withEnableLogTypes(java.util.Collection)} if you want
* to override the existing values.
*
*
* @param enableLogTypes
* The list of log types to enable.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CloudwatchLogsExportConfiguration withEnableLogTypes(String... enableLogTypes) {
if (this.enableLogTypes == null) {
setEnableLogTypes(new java.util.ArrayList(enableLogTypes.length));
}
for (String ele : enableLogTypes) {
this.enableLogTypes.add(ele);
}
return this;
}
/**
*
* The list of log types to enable.
*
*
* @param enableLogTypes
* The list of log types to enable.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CloudwatchLogsExportConfiguration withEnableLogTypes(java.util.Collection enableLogTypes) {
setEnableLogTypes(enableLogTypes);
return this;
}
/**
*
* The list of log types to disable.
*
*
* @return The list of log types to disable.
*/
public java.util.List getDisableLogTypes() {
return disableLogTypes;
}
/**
*
* The list of log types to disable.
*
*
* @param disableLogTypes
* The list of log types to disable.
*/
public void setDisableLogTypes(java.util.Collection disableLogTypes) {
if (disableLogTypes == null) {
this.disableLogTypes = null;
return;
}
this.disableLogTypes = new java.util.ArrayList(disableLogTypes);
}
/**
*
* The list of log types to disable.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setDisableLogTypes(java.util.Collection)} or {@link #withDisableLogTypes(java.util.Collection)} if you
* want to override the existing values.
*
*
* @param disableLogTypes
* The list of log types to disable.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CloudwatchLogsExportConfiguration withDisableLogTypes(String... disableLogTypes) {
if (this.disableLogTypes == null) {
setDisableLogTypes(new java.util.ArrayList(disableLogTypes.length));
}
for (String ele : disableLogTypes) {
this.disableLogTypes.add(ele);
}
return this;
}
/**
*
* The list of log types to disable.
*
*
* @param disableLogTypes
* The list of log types to disable.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CloudwatchLogsExportConfiguration withDisableLogTypes(java.util.Collection disableLogTypes) {
setDisableLogTypes(disableLogTypes);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getEnableLogTypes() != null)
sb.append("EnableLogTypes: ").append(getEnableLogTypes()).append(",");
if (getDisableLogTypes() != null)
sb.append("DisableLogTypes: ").append(getDisableLogTypes());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CloudwatchLogsExportConfiguration == false)
return false;
CloudwatchLogsExportConfiguration other = (CloudwatchLogsExportConfiguration) obj;
if (other.getEnableLogTypes() == null ^ this.getEnableLogTypes() == null)
return false;
if (other.getEnableLogTypes() != null && other.getEnableLogTypes().equals(this.getEnableLogTypes()) == false)
return false;
if (other.getDisableLogTypes() == null ^ this.getDisableLogTypes() == null)
return false;
if (other.getDisableLogTypes() != null && other.getDisableLogTypes().equals(this.getDisableLogTypes()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getEnableLogTypes() == null) ? 0 : getEnableLogTypes().hashCode());
hashCode = prime * hashCode + ((getDisableLogTypes() == null) ? 0 : getDisableLogTypes().hashCode());
return hashCode;
}
@Override
public CloudwatchLogsExportConfiguration clone() {
try {
return (CloudwatchLogsExportConfiguration) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}