com.amazonaws.services.cloudfront.model.FunctionMetadata Maven / Gradle / Ivy
/*
* Copyright 2016-2021 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;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* Contains metadata about a CloudFront function.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class FunctionMetadata implements Serializable, Cloneable {
/**
*
* The Amazon Resource Name (ARN) of the function. The ARN uniquely identifies the function.
*
*/
private String functionARN;
/**
*
* The stage that the function is in, either DEVELOPMENT
or LIVE
.
*
*
* When a function is in the DEVELOPMENT
stage, you can test the function with
* TestFunction
, and update it with UpdateFunction
.
*
*
* When a function is in the LIVE
stage, you can attach the function to a distribution’s cache
* behavior, using the function’s ARN.
*
*/
private String stage;
/**
*
* The date and time when the function was created.
*
*/
private java.util.Date createdTime;
/**
*
* The date and time when the function was most recently updated.
*
*/
private java.util.Date lastModifiedTime;
/**
*
* The Amazon Resource Name (ARN) of the function. The ARN uniquely identifies the function.
*
*
* @param functionARN
* The Amazon Resource Name (ARN) of the function. The ARN uniquely identifies the function.
*/
public void setFunctionARN(String functionARN) {
this.functionARN = functionARN;
}
/**
*
* The Amazon Resource Name (ARN) of the function. The ARN uniquely identifies the function.
*
*
* @return The Amazon Resource Name (ARN) of the function. The ARN uniquely identifies the function.
*/
public String getFunctionARN() {
return this.functionARN;
}
/**
*
* The Amazon Resource Name (ARN) of the function. The ARN uniquely identifies the function.
*
*
* @param functionARN
* The Amazon Resource Name (ARN) of the function. The ARN uniquely identifies the function.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public FunctionMetadata withFunctionARN(String functionARN) {
setFunctionARN(functionARN);
return this;
}
/**
*
* The stage that the function is in, either DEVELOPMENT
or LIVE
.
*
*
* When a function is in the DEVELOPMENT
stage, you can test the function with
* TestFunction
, and update it with UpdateFunction
.
*
*
* When a function is in the LIVE
stage, you can attach the function to a distribution’s cache
* behavior, using the function’s ARN.
*
*
* @param stage
* The stage that the function is in, either DEVELOPMENT
or LIVE
.
*
* When a function is in the DEVELOPMENT
stage, you can test the function with
* TestFunction
, and update it with UpdateFunction
.
*
*
* When a function is in the LIVE
stage, you can attach the function to a distribution’s cache
* behavior, using the function’s ARN.
* @see FunctionStage
*/
public void setStage(String stage) {
this.stage = stage;
}
/**
*
* The stage that the function is in, either DEVELOPMENT
or LIVE
.
*
*
* When a function is in the DEVELOPMENT
stage, you can test the function with
* TestFunction
, and update it with UpdateFunction
.
*
*
* When a function is in the LIVE
stage, you can attach the function to a distribution’s cache
* behavior, using the function’s ARN.
*
*
* @return The stage that the function is in, either DEVELOPMENT
or LIVE
.
*
* When a function is in the DEVELOPMENT
stage, you can test the function with
* TestFunction
, and update it with UpdateFunction
.
*
*
* When a function is in the LIVE
stage, you can attach the function to a distribution’s cache
* behavior, using the function’s ARN.
* @see FunctionStage
*/
public String getStage() {
return this.stage;
}
/**
*
* The stage that the function is in, either DEVELOPMENT
or LIVE
.
*
*
* When a function is in the DEVELOPMENT
stage, you can test the function with
* TestFunction
, and update it with UpdateFunction
.
*
*
* When a function is in the LIVE
stage, you can attach the function to a distribution’s cache
* behavior, using the function’s ARN.
*
*
* @param stage
* The stage that the function is in, either DEVELOPMENT
or LIVE
.
*
* When a function is in the DEVELOPMENT
stage, you can test the function with
* TestFunction
, and update it with UpdateFunction
.
*
*
* When a function is in the LIVE
stage, you can attach the function to a distribution’s cache
* behavior, using the function’s ARN.
* @return Returns a reference to this object so that method calls can be chained together.
* @see FunctionStage
*/
public FunctionMetadata withStage(String stage) {
setStage(stage);
return this;
}
/**
*
* The stage that the function is in, either DEVELOPMENT
or LIVE
.
*
*
* When a function is in the DEVELOPMENT
stage, you can test the function with
* TestFunction
, and update it with UpdateFunction
.
*
*
* When a function is in the LIVE
stage, you can attach the function to a distribution’s cache
* behavior, using the function’s ARN.
*
*
* @param stage
* The stage that the function is in, either DEVELOPMENT
or LIVE
.
*
* When a function is in the DEVELOPMENT
stage, you can test the function with
* TestFunction
, and update it with UpdateFunction
.
*
*
* When a function is in the LIVE
stage, you can attach the function to a distribution’s cache
* behavior, using the function’s ARN.
* @return Returns a reference to this object so that method calls can be chained together.
* @see FunctionStage
*/
public FunctionMetadata withStage(FunctionStage stage) {
this.stage = stage.toString();
return this;
}
/**
*
* The date and time when the function was created.
*
*
* @param createdTime
* The date and time when the function was created.
*/
public void setCreatedTime(java.util.Date createdTime) {
this.createdTime = createdTime;
}
/**
*
* The date and time when the function was created.
*
*
* @return The date and time when the function was created.
*/
public java.util.Date getCreatedTime() {
return this.createdTime;
}
/**
*
* The date and time when the function was created.
*
*
* @param createdTime
* The date and time when the function was created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public FunctionMetadata withCreatedTime(java.util.Date createdTime) {
setCreatedTime(createdTime);
return this;
}
/**
*
* The date and time when the function was most recently updated.
*
*
* @param lastModifiedTime
* The date and time when the function was most recently updated.
*/
public void setLastModifiedTime(java.util.Date lastModifiedTime) {
this.lastModifiedTime = lastModifiedTime;
}
/**
*
* The date and time when the function was most recently updated.
*
*
* @return The date and time when the function was most recently updated.
*/
public java.util.Date getLastModifiedTime() {
return this.lastModifiedTime;
}
/**
*
* The date and time when the function was most recently updated.
*
*
* @param lastModifiedTime
* The date and time when the function was most recently updated.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public FunctionMetadata withLastModifiedTime(java.util.Date lastModifiedTime) {
setLastModifiedTime(lastModifiedTime);
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 (getFunctionARN() != null)
sb.append("FunctionARN: ").append(getFunctionARN()).append(",");
if (getStage() != null)
sb.append("Stage: ").append(getStage()).append(",");
if (getCreatedTime() != null)
sb.append("CreatedTime: ").append(getCreatedTime()).append(",");
if (getLastModifiedTime() != null)
sb.append("LastModifiedTime: ").append(getLastModifiedTime());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof FunctionMetadata == false)
return false;
FunctionMetadata other = (FunctionMetadata) obj;
if (other.getFunctionARN() == null ^ this.getFunctionARN() == null)
return false;
if (other.getFunctionARN() != null && other.getFunctionARN().equals(this.getFunctionARN()) == false)
return false;
if (other.getStage() == null ^ this.getStage() == null)
return false;
if (other.getStage() != null && other.getStage().equals(this.getStage()) == false)
return false;
if (other.getCreatedTime() == null ^ this.getCreatedTime() == null)
return false;
if (other.getCreatedTime() != null && other.getCreatedTime().equals(this.getCreatedTime()) == false)
return false;
if (other.getLastModifiedTime() == null ^ this.getLastModifiedTime() == null)
return false;
if (other.getLastModifiedTime() != null && other.getLastModifiedTime().equals(this.getLastModifiedTime()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getFunctionARN() == null) ? 0 : getFunctionARN().hashCode());
hashCode = prime * hashCode + ((getStage() == null) ? 0 : getStage().hashCode());
hashCode = prime * hashCode + ((getCreatedTime() == null) ? 0 : getCreatedTime().hashCode());
hashCode = prime * hashCode + ((getLastModifiedTime() == null) ? 0 : getLastModifiedTime().hashCode());
return hashCode;
}
@Override
public FunctionMetadata clone() {
try {
return (FunctionMetadata) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}