All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.guardduty.model.Organization Maven / Gradle / Ivy

/*
 * Copyright 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 software.amazon.awssdk.services.guardduty.model;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Contains information about the ISP organization of the remote IP address. *

*/ @Generated("software.amazon.awssdk:codegen") public final class Organization implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField ASN_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Asn") .getter(getter(Organization::asn)).setter(setter(Builder::asn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("asn").build()).build(); private static final SdkField ASN_ORG_FIELD = SdkField. builder(MarshallingType.STRING).memberName("AsnOrg") .getter(getter(Organization::asnOrg)).setter(setter(Builder::asnOrg)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("asnOrg").build()).build(); private static final SdkField ISP_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Isp") .getter(getter(Organization::isp)).setter(setter(Builder::isp)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("isp").build()).build(); private static final SdkField ORG_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Org") .getter(getter(Organization::org)).setter(setter(Builder::org)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("org").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ASN_FIELD, ASN_ORG_FIELD, ISP_FIELD, ORG_FIELD)); private static final long serialVersionUID = 1L; private final String asn; private final String asnOrg; private final String isp; private final String org; private Organization(BuilderImpl builder) { this.asn = builder.asn; this.asnOrg = builder.asnOrg; this.isp = builder.isp; this.org = builder.org; } /** *

* The Autonomous System Number (ASN) of the internet provider of the remote IP address. *

* * @return The Autonomous System Number (ASN) of the internet provider of the remote IP address. */ public final String asn() { return asn; } /** *

* The organization that registered this ASN. *

* * @return The organization that registered this ASN. */ public final String asnOrg() { return asnOrg; } /** *

* The ISP information for the internet provider. *

* * @return The ISP information for the internet provider. */ public final String isp() { return isp; } /** *

* The name of the internet provider. *

* * @return The name of the internet provider. */ public final String org() { return org; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + Objects.hashCode(asn()); hashCode = 31 * hashCode + Objects.hashCode(asnOrg()); hashCode = 31 * hashCode + Objects.hashCode(isp()); hashCode = 31 * hashCode + Objects.hashCode(org()); return hashCode; } @Override public final boolean equals(Object obj) { return equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof Organization)) { return false; } Organization other = (Organization) obj; return Objects.equals(asn(), other.asn()) && Objects.equals(asnOrg(), other.asnOrg()) && Objects.equals(isp(), other.isp()) && Objects.equals(org(), other.org()); } /** * 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. */ @Override public final String toString() { return ToString.builder("Organization").add("Asn", asn()).add("AsnOrg", asnOrg()).add("Isp", isp()).add("Org", org()) .build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "Asn": return Optional.ofNullable(clazz.cast(asn())); case "AsnOrg": return Optional.ofNullable(clazz.cast(asnOrg())); case "Isp": return Optional.ofNullable(clazz.cast(isp())); case "Org": return Optional.ofNullable(clazz.cast(org())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((Organization) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The Autonomous System Number (ASN) of the internet provider of the remote IP address. *

* * @param asn * The Autonomous System Number (ASN) of the internet provider of the remote IP address. * @return Returns a reference to this object so that method calls can be chained together. */ Builder asn(String asn); /** *

* The organization that registered this ASN. *

* * @param asnOrg * The organization that registered this ASN. * @return Returns a reference to this object so that method calls can be chained together. */ Builder asnOrg(String asnOrg); /** *

* The ISP information for the internet provider. *

* * @param isp * The ISP information for the internet provider. * @return Returns a reference to this object so that method calls can be chained together. */ Builder isp(String isp); /** *

* The name of the internet provider. *

* * @param org * The name of the internet provider. * @return Returns a reference to this object so that method calls can be chained together. */ Builder org(String org); } static final class BuilderImpl implements Builder { private String asn; private String asnOrg; private String isp; private String org; private BuilderImpl() { } private BuilderImpl(Organization model) { asn(model.asn); asnOrg(model.asnOrg); isp(model.isp); org(model.org); } public final String getAsn() { return asn; } public final void setAsn(String asn) { this.asn = asn; } @Override public final Builder asn(String asn) { this.asn = asn; return this; } public final String getAsnOrg() { return asnOrg; } public final void setAsnOrg(String asnOrg) { this.asnOrg = asnOrg; } @Override public final Builder asnOrg(String asnOrg) { this.asnOrg = asnOrg; return this; } public final String getIsp() { return isp; } public final void setIsp(String isp) { this.isp = isp; } @Override public final Builder isp(String isp) { this.isp = isp; return this; } public final String getOrg() { return org; } public final void setOrg(String org) { this.org = org; } @Override public final Builder org(String org) { this.org = org; return this; } @Override public Organization build() { return new Organization(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy