software.amazon.awssdk.services.sagemaker.model.ContextSummary Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sagemaker Show documentation
Show all versions of sagemaker Show documentation
The AWS Java SDK for Amazon SageMaker module holds the client classes that are used for communicating
with Amazon SageMaker Service
/*
* 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.sagemaker.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.Consumer;
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;
/**
*
* Lists a summary of the properties of a context. A context provides a logical grouping of other entities.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class ContextSummary implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField CONTEXT_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ContextArn").getter(getter(ContextSummary::contextArn)).setter(setter(Builder::contextArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ContextArn").build()).build();
private static final SdkField CONTEXT_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ContextName").getter(getter(ContextSummary::contextName)).setter(setter(Builder::contextName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ContextName").build()).build();
private static final SdkField SOURCE_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("Source").getter(getter(ContextSummary::source)).setter(setter(Builder::source))
.constructor(ContextSource::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Source").build()).build();
private static final SdkField CONTEXT_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ContextType").getter(getter(ContextSummary::contextType)).setter(setter(Builder::contextType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ContextType").build()).build();
private static final SdkField CREATION_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("CreationTime").getter(getter(ContextSummary::creationTime)).setter(setter(Builder::creationTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreationTime").build()).build();
private static final SdkField LAST_MODIFIED_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("LastModifiedTime").getter(getter(ContextSummary::lastModifiedTime))
.setter(setter(Builder::lastModifiedTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastModifiedTime").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CONTEXT_ARN_FIELD,
CONTEXT_NAME_FIELD, SOURCE_FIELD, CONTEXT_TYPE_FIELD, CREATION_TIME_FIELD, LAST_MODIFIED_TIME_FIELD));
private static final long serialVersionUID = 1L;
private final String contextArn;
private final String contextName;
private final ContextSource source;
private final String contextType;
private final Instant creationTime;
private final Instant lastModifiedTime;
private ContextSummary(BuilderImpl builder) {
this.contextArn = builder.contextArn;
this.contextName = builder.contextName;
this.source = builder.source;
this.contextType = builder.contextType;
this.creationTime = builder.creationTime;
this.lastModifiedTime = builder.lastModifiedTime;
}
/**
*
* The Amazon Resource Name (ARN) of the context.
*
*
* @return The Amazon Resource Name (ARN) of the context.
*/
public final String contextArn() {
return contextArn;
}
/**
*
* The name of the context.
*
*
* @return The name of the context.
*/
public final String contextName() {
return contextName;
}
/**
*
* The source of the context.
*
*
* @return The source of the context.
*/
public final ContextSource source() {
return source;
}
/**
*
* The type of the context.
*
*
* @return The type of the context.
*/
public final String contextType() {
return contextType;
}
/**
*
* When the context was created.
*
*
* @return When the context was created.
*/
public final Instant creationTime() {
return creationTime;
}
/**
*
* When the context was last modified.
*
*
* @return When the context was last modified.
*/
public final Instant lastModifiedTime() {
return lastModifiedTime;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(contextArn());
hashCode = 31 * hashCode + Objects.hashCode(contextName());
hashCode = 31 * hashCode + Objects.hashCode(source());
hashCode = 31 * hashCode + Objects.hashCode(contextType());
hashCode = 31 * hashCode + Objects.hashCode(creationTime());
hashCode = 31 * hashCode + Objects.hashCode(lastModifiedTime());
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 ContextSummary)) {
return false;
}
ContextSummary other = (ContextSummary) obj;
return Objects.equals(contextArn(), other.contextArn()) && Objects.equals(contextName(), other.contextName())
&& Objects.equals(source(), other.source()) && Objects.equals(contextType(), other.contextType())
&& Objects.equals(creationTime(), other.creationTime())
&& Objects.equals(lastModifiedTime(), other.lastModifiedTime());
}
/**
* 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("ContextSummary").add("ContextArn", contextArn()).add("ContextName", contextName())
.add("Source", source()).add("ContextType", contextType()).add("CreationTime", creationTime())
.add("LastModifiedTime", lastModifiedTime()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "ContextArn":
return Optional.ofNullable(clazz.cast(contextArn()));
case "ContextName":
return Optional.ofNullable(clazz.cast(contextName()));
case "Source":
return Optional.ofNullable(clazz.cast(source()));
case "ContextType":
return Optional.ofNullable(clazz.cast(contextType()));
case "CreationTime":
return Optional.ofNullable(clazz.cast(creationTime()));
case "LastModifiedTime":
return Optional.ofNullable(clazz.cast(lastModifiedTime()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function