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

software.amazon.awssdk.services.workspacesweb.model.CertificateSummary Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Work Spaces Web module holds the client classes that are used for communicating with Work Spaces Web.

There is a newer version: 2.29.16
Show newest version
/*
 * 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.workspacesweb.model;

import java.io.Serializable;
import java.time.Instant;
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;

/**
 * 

* The summary of the certificate. *

*/ @Generated("software.amazon.awssdk:codegen") public final class CertificateSummary implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField ISSUER_FIELD = SdkField. builder(MarshallingType.STRING).memberName("issuer") .getter(getter(CertificateSummary::issuer)).setter(setter(Builder::issuer)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("issuer").build()).build(); private static final SdkField NOT_VALID_AFTER_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("notValidAfter").getter(getter(CertificateSummary::notValidAfter)).setter(setter(Builder::notValidAfter)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("notValidAfter").build()).build(); private static final SdkField NOT_VALID_BEFORE_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("notValidBefore").getter(getter(CertificateSummary::notValidBefore)) .setter(setter(Builder::notValidBefore)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("notValidBefore").build()).build(); private static final SdkField SUBJECT_FIELD = SdkField. builder(MarshallingType.STRING).memberName("subject") .getter(getter(CertificateSummary::subject)).setter(setter(Builder::subject)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("subject").build()).build(); private static final SdkField THUMBPRINT_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("thumbprint").getter(getter(CertificateSummary::thumbprint)).setter(setter(Builder::thumbprint)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("thumbprint").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(ISSUER_FIELD, NOT_VALID_AFTER_FIELD, NOT_VALID_BEFORE_FIELD, SUBJECT_FIELD, THUMBPRINT_FIELD)); private static final long serialVersionUID = 1L; private final String issuer; private final Instant notValidAfter; private final Instant notValidBefore; private final String subject; private final String thumbprint; private CertificateSummary(BuilderImpl builder) { this.issuer = builder.issuer; this.notValidAfter = builder.notValidAfter; this.notValidBefore = builder.notValidBefore; this.subject = builder.subject; this.thumbprint = builder.thumbprint; } /** *

* The entity that issued the certificate. *

* * @return The entity that issued the certificate. */ public final String issuer() { return issuer; } /** *

* The certificate is not valid after this date. *

* * @return The certificate is not valid after this date. */ public final Instant notValidAfter() { return notValidAfter; } /** *

* The certificate is not valid before this date. *

* * @return The certificate is not valid before this date. */ public final Instant notValidBefore() { return notValidBefore; } /** *

* The entity the certificate belongs to. *

* * @return The entity the certificate belongs to. */ public final String subject() { return subject; } /** *

* A hexadecimal identifier for the certificate. *

* * @return A hexadecimal identifier for the certificate. */ public final String thumbprint() { return thumbprint; } @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(issuer()); hashCode = 31 * hashCode + Objects.hashCode(notValidAfter()); hashCode = 31 * hashCode + Objects.hashCode(notValidBefore()); hashCode = 31 * hashCode + Objects.hashCode(subject()); hashCode = 31 * hashCode + Objects.hashCode(thumbprint()); 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 CertificateSummary)) { return false; } CertificateSummary other = (CertificateSummary) obj; return Objects.equals(issuer(), other.issuer()) && Objects.equals(notValidAfter(), other.notValidAfter()) && Objects.equals(notValidBefore(), other.notValidBefore()) && Objects.equals(subject(), other.subject()) && Objects.equals(thumbprint(), other.thumbprint()); } /** * 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("CertificateSummary").add("Issuer", issuer()).add("NotValidAfter", notValidAfter()) .add("NotValidBefore", notValidBefore()).add("Subject", subject()).add("Thumbprint", thumbprint()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "issuer": return Optional.ofNullable(clazz.cast(issuer())); case "notValidAfter": return Optional.ofNullable(clazz.cast(notValidAfter())); case "notValidBefore": return Optional.ofNullable(clazz.cast(notValidBefore())); case "subject": return Optional.ofNullable(clazz.cast(subject())); case "thumbprint": return Optional.ofNullable(clazz.cast(thumbprint())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((CertificateSummary) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* The entity that issued the certificate. *

* * @param issuer * The entity that issued the certificate. * @return Returns a reference to this object so that method calls can be chained together. */ Builder issuer(String issuer); /** *

* The certificate is not valid after this date. *

* * @param notValidAfter * The certificate is not valid after this date. * @return Returns a reference to this object so that method calls can be chained together. */ Builder notValidAfter(Instant notValidAfter); /** *

* The certificate is not valid before this date. *

* * @param notValidBefore * The certificate is not valid before this date. * @return Returns a reference to this object so that method calls can be chained together. */ Builder notValidBefore(Instant notValidBefore); /** *

* The entity the certificate belongs to. *

* * @param subject * The entity the certificate belongs to. * @return Returns a reference to this object so that method calls can be chained together. */ Builder subject(String subject); /** *

* A hexadecimal identifier for the certificate. *

* * @param thumbprint * A hexadecimal identifier for the certificate. * @return Returns a reference to this object so that method calls can be chained together. */ Builder thumbprint(String thumbprint); } static final class BuilderImpl implements Builder { private String issuer; private Instant notValidAfter; private Instant notValidBefore; private String subject; private String thumbprint; private BuilderImpl() { } private BuilderImpl(CertificateSummary model) { issuer(model.issuer); notValidAfter(model.notValidAfter); notValidBefore(model.notValidBefore); subject(model.subject); thumbprint(model.thumbprint); } public final String getIssuer() { return issuer; } public final void setIssuer(String issuer) { this.issuer = issuer; } @Override public final Builder issuer(String issuer) { this.issuer = issuer; return this; } public final Instant getNotValidAfter() { return notValidAfter; } public final void setNotValidAfter(Instant notValidAfter) { this.notValidAfter = notValidAfter; } @Override public final Builder notValidAfter(Instant notValidAfter) { this.notValidAfter = notValidAfter; return this; } public final Instant getNotValidBefore() { return notValidBefore; } public final void setNotValidBefore(Instant notValidBefore) { this.notValidBefore = notValidBefore; } @Override public final Builder notValidBefore(Instant notValidBefore) { this.notValidBefore = notValidBefore; return this; } public final String getSubject() { return subject; } public final void setSubject(String subject) { this.subject = subject; } @Override public final Builder subject(String subject) { this.subject = subject; return this; } public final String getThumbprint() { return thumbprint; } public final void setThumbprint(String thumbprint) { this.thumbprint = thumbprint; } @Override public final Builder thumbprint(String thumbprint) { this.thumbprint = thumbprint; return this; } @Override public CertificateSummary build() { return new CertificateSummary(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy