/* * Copyright 2018-2023 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.fms.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* An individual Firewall Manager application. *
* * @see AWS API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class App implements Serializable, Cloneable, StructuredPojo { /** ** The application's name. *
*/ private String appName; /** *
* The IP protocol name or number. The name can be one of tcp
, udp
, or icmp
.
* For information on possible numbers, see Protocol Numbers.
*
* The application's port number, for example 80
.
*
* The application's name. *
* * @param appName * The application's name. */ public void setAppName(String appName) { this.appName = appName; } /** ** The application's name. *
* * @return The application's name. */ public String getAppName() { return this.appName; } /** ** The application's name. *
* * @param appName * The application's name. * @return Returns a reference to this object so that method calls can be chained together. */ public App withAppName(String appName) { setAppName(appName); return this; } /** *
* The IP protocol name or number. The name can be one of tcp
, udp
, or icmp
.
* For information on possible numbers, see Protocol Numbers.
*
tcp
, udp
, or
* icmp
. For information on possible numbers, see Protocol Numbers.
*/
public void setProtocol(String protocol) {
this.protocol = protocol;
}
/**
*
* The IP protocol name or number. The name can be one of tcp
, udp
, or icmp
.
* For information on possible numbers, see Protocol Numbers.
*
tcp
, udp
, or
* icmp
. For information on possible numbers, see Protocol Numbers.
*/
public String getProtocol() {
return this.protocol;
}
/**
*
* The IP protocol name or number. The name can be one of tcp
, udp
, or icmp
.
* For information on possible numbers, see Protocol Numbers.
*
tcp
, udp
, or
* icmp
. For information on possible numbers, see Protocol Numbers.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public App withProtocol(String protocol) {
setProtocol(protocol);
return this;
}
/**
*
* The application's port number, for example 80
.
*
80
.
*/
public void setPort(Long port) {
this.port = port;
}
/**
*
* The application's port number, for example 80
.
*
80
.
*/
public Long getPort() {
return this.port;
}
/**
*
* The application's port number, for example 80
.
*
80
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public App withPort(Long port) {
setPort(port);
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 (getAppName() != null)
sb.append("AppName: ").append(getAppName()).append(",");
if (getProtocol() != null)
sb.append("Protocol: ").append(getProtocol()).append(",");
if (getPort() != null)
sb.append("Port: ").append(getPort());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof App == false)
return false;
App other = (App) obj;
if (other.getAppName() == null ^ this.getAppName() == null)
return false;
if (other.getAppName() != null && other.getAppName().equals(this.getAppName()) == false)
return false;
if (other.getProtocol() == null ^ this.getProtocol() == null)
return false;
if (other.getProtocol() != null && other.getProtocol().equals(this.getProtocol()) == false)
return false;
if (other.getPort() == null ^ this.getPort() == null)
return false;
if (other.getPort() != null && other.getPort().equals(this.getPort()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getAppName() == null) ? 0 : getAppName().hashCode());
hashCode = prime * hashCode + ((getProtocol() == null) ? 0 : getProtocol().hashCode());
hashCode = prime * hashCode + ((getPort() == null) ? 0 : getPort().hashCode());
return hashCode;
}
@Override
public App clone() {
try {
return (App) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.fms.model.transform.AppMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}