software.amazon.awssdk.services.medicalimaging.model.SearchByAttributeValue Maven / Gradle / Ivy
Show all versions of medicalimaging Show documentation
/*
* 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.medicalimaging.model;
import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
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.core.util.SdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* The search input attribute value.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class SearchByAttributeValue implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField DICOM_PATIENT_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DICOMPatientId").getter(getter(SearchByAttributeValue::dicomPatientId))
.setter(setter(Builder::dicomPatientId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DICOMPatientId").build()).build();
private static final SdkField DICOM_ACCESSION_NUMBER_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DICOMAccessionNumber").getter(getter(SearchByAttributeValue::dicomAccessionNumber))
.setter(setter(Builder::dicomAccessionNumber))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DICOMAccessionNumber").build())
.build();
private static final SdkField DICOM_STUDY_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DICOMStudyId").getter(getter(SearchByAttributeValue::dicomStudyId))
.setter(setter(Builder::dicomStudyId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DICOMStudyId").build()).build();
private static final SdkField DICOM_STUDY_INSTANCE_UID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DICOMStudyInstanceUID").getter(getter(SearchByAttributeValue::dicomStudyInstanceUID))
.setter(setter(Builder::dicomStudyInstanceUID))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DICOMStudyInstanceUID").build())
.build();
private static final SdkField DICOM_SERIES_INSTANCE_UID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("DICOMSeriesInstanceUID").getter(getter(SearchByAttributeValue::dicomSeriesInstanceUID))
.setter(setter(Builder::dicomSeriesInstanceUID))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DICOMSeriesInstanceUID").build())
.build();
private static final SdkField CREATED_AT_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("createdAt").getter(getter(SearchByAttributeValue::createdAt)).setter(setter(Builder::createdAt))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("createdAt").build()).build();
private static final SdkField UPDATED_AT_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("updatedAt").getter(getter(SearchByAttributeValue::updatedAt)).setter(setter(Builder::updatedAt))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("updatedAt").build()).build();
private static final SdkField DICOM_STUDY_DATE_AND_TIME_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("DICOMStudyDateAndTime")
.getter(getter(SearchByAttributeValue::dicomStudyDateAndTime)).setter(setter(Builder::dicomStudyDateAndTime))
.constructor(DICOMStudyDateAndTime::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DICOMStudyDateAndTime").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(DICOM_PATIENT_ID_FIELD,
DICOM_ACCESSION_NUMBER_FIELD, DICOM_STUDY_ID_FIELD, DICOM_STUDY_INSTANCE_UID_FIELD, DICOM_SERIES_INSTANCE_UID_FIELD,
CREATED_AT_FIELD, UPDATED_AT_FIELD, DICOM_STUDY_DATE_AND_TIME_FIELD));
private static final Map> SDK_NAME_TO_FIELD = Collections
.unmodifiableMap(new HashMap>() {
{
put("DICOMPatientId", DICOM_PATIENT_ID_FIELD);
put("DICOMAccessionNumber", DICOM_ACCESSION_NUMBER_FIELD);
put("DICOMStudyId", DICOM_STUDY_ID_FIELD);
put("DICOMStudyInstanceUID", DICOM_STUDY_INSTANCE_UID_FIELD);
put("DICOMSeriesInstanceUID", DICOM_SERIES_INSTANCE_UID_FIELD);
put("createdAt", CREATED_AT_FIELD);
put("updatedAt", UPDATED_AT_FIELD);
put("DICOMStudyDateAndTime", DICOM_STUDY_DATE_AND_TIME_FIELD);
}
});
private static final long serialVersionUID = 1L;
private final String dicomPatientId;
private final String dicomAccessionNumber;
private final String dicomStudyId;
private final String dicomStudyInstanceUID;
private final String dicomSeriesInstanceUID;
private final Instant createdAt;
private final Instant updatedAt;
private final DICOMStudyDateAndTime dicomStudyDateAndTime;
private final Type type;
private SearchByAttributeValue(BuilderImpl builder) {
this.dicomPatientId = builder.dicomPatientId;
this.dicomAccessionNumber = builder.dicomAccessionNumber;
this.dicomStudyId = builder.dicomStudyId;
this.dicomStudyInstanceUID = builder.dicomStudyInstanceUID;
this.dicomSeriesInstanceUID = builder.dicomSeriesInstanceUID;
this.createdAt = builder.createdAt;
this.updatedAt = builder.updatedAt;
this.dicomStudyDateAndTime = builder.dicomStudyDateAndTime;
this.type = builder.type;
}
/**
*
* The patient ID input for search.
*
*
* @return The patient ID input for search.
*/
public final String dicomPatientId() {
return dicomPatientId;
}
/**
*
* The DICOM accession number for search.
*
*
* @return The DICOM accession number for search.
*/
public final String dicomAccessionNumber() {
return dicomAccessionNumber;
}
/**
*
* The DICOM study ID for search.
*
*
* @return The DICOM study ID for search.
*/
public final String dicomStudyId() {
return dicomStudyId;
}
/**
*
* The DICOM study instance UID for search.
*
*
* @return The DICOM study instance UID for search.
*/
public final String dicomStudyInstanceUID() {
return dicomStudyInstanceUID;
}
/**
*
* The Series Instance UID input for search.
*
*
* @return The Series Instance UID input for search.
*/
public final String dicomSeriesInstanceUID() {
return dicomSeriesInstanceUID;
}
/**
*
* The created at time of the image set provided for search.
*
*
* @return The created at time of the image set provided for search.
*/
public final Instant createdAt() {
return createdAt;
}
/**
*
* The timestamp input for search.
*
*
* @return The timestamp input for search.
*/
public final Instant updatedAt() {
return updatedAt;
}
/**
*
* The aggregated structure containing DICOM study date and study time for search.
*
*
* @return The aggregated structure containing DICOM study date and study time for search.
*/
public final DICOMStudyDateAndTime dicomStudyDateAndTime() {
return dicomStudyDateAndTime;
}
@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(dicomPatientId());
hashCode = 31 * hashCode + Objects.hashCode(dicomAccessionNumber());
hashCode = 31 * hashCode + Objects.hashCode(dicomStudyId());
hashCode = 31 * hashCode + Objects.hashCode(dicomStudyInstanceUID());
hashCode = 31 * hashCode + Objects.hashCode(dicomSeriesInstanceUID());
hashCode = 31 * hashCode + Objects.hashCode(createdAt());
hashCode = 31 * hashCode + Objects.hashCode(updatedAt());
hashCode = 31 * hashCode + Objects.hashCode(dicomStudyDateAndTime());
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 SearchByAttributeValue)) {
return false;
}
SearchByAttributeValue other = (SearchByAttributeValue) obj;
return Objects.equals(dicomPatientId(), other.dicomPatientId())
&& Objects.equals(dicomAccessionNumber(), other.dicomAccessionNumber())
&& Objects.equals(dicomStudyId(), other.dicomStudyId())
&& Objects.equals(dicomStudyInstanceUID(), other.dicomStudyInstanceUID())
&& Objects.equals(dicomSeriesInstanceUID(), other.dicomSeriesInstanceUID())
&& Objects.equals(createdAt(), other.createdAt()) && Objects.equals(updatedAt(), other.updatedAt())
&& Objects.equals(dicomStudyDateAndTime(), other.dicomStudyDateAndTime());
}
/**
* 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("SearchByAttributeValue")
.add("DICOMPatientId", dicomPatientId() == null ? null : "*** Sensitive Data Redacted ***")
.add("DICOMAccessionNumber", dicomAccessionNumber() == null ? null : "*** Sensitive Data Redacted ***")
.add("DICOMStudyId", dicomStudyId() == null ? null : "*** Sensitive Data Redacted ***")
.add("DICOMStudyInstanceUID", dicomStudyInstanceUID() == null ? null : "*** Sensitive Data Redacted ***")
.add("DICOMSeriesInstanceUID", dicomSeriesInstanceUID() == null ? null : "*** Sensitive Data Redacted ***")
.add("CreatedAt", createdAt()).add("UpdatedAt", updatedAt())
.add("DICOMStudyDateAndTime", dicomStudyDateAndTime()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "DICOMPatientId":
return Optional.ofNullable(clazz.cast(dicomPatientId()));
case "DICOMAccessionNumber":
return Optional.ofNullable(clazz.cast(dicomAccessionNumber()));
case "DICOMStudyId":
return Optional.ofNullable(clazz.cast(dicomStudyId()));
case "DICOMStudyInstanceUID":
return Optional.ofNullable(clazz.cast(dicomStudyInstanceUID()));
case "DICOMSeriesInstanceUID":
return Optional.ofNullable(clazz.cast(dicomSeriesInstanceUID()));
case "createdAt":
return Optional.ofNullable(clazz.cast(createdAt()));
case "updatedAt":
return Optional.ofNullable(clazz.cast(updatedAt()));
case "DICOMStudyDateAndTime":
return Optional.ofNullable(clazz.cast(dicomStudyDateAndTime()));
default:
return Optional.empty();
}
}
/**
* Create an instance of this class with {@link #dicomPatientId()} initialized to the given value.
*
*
* The patient ID input for search.
*
*
* @param dicomPatientId
* The patient ID input for search.
*/
public static SearchByAttributeValue fromDicomPatientId(String dicomPatientId) {
return builder().dicomPatientId(dicomPatientId).build();
}
/**
* Create an instance of this class with {@link #dicomAccessionNumber()} initialized to the given value.
*
*
* The DICOM accession number for search.
*
*
* @param dicomAccessionNumber
* The DICOM accession number for search.
*/
public static SearchByAttributeValue fromDicomAccessionNumber(String dicomAccessionNumber) {
return builder().dicomAccessionNumber(dicomAccessionNumber).build();
}
/**
* Create an instance of this class with {@link #dicomStudyId()} initialized to the given value.
*
*
* The DICOM study ID for search.
*
*
* @param dicomStudyId
* The DICOM study ID for search.
*/
public static SearchByAttributeValue fromDicomStudyId(String dicomStudyId) {
return builder().dicomStudyId(dicomStudyId).build();
}
/**
* Create an instance of this class with {@link #dicomStudyInstanceUID()} initialized to the given value.
*
*
* The DICOM study instance UID for search.
*
*
* @param dicomStudyInstanceUID
* The DICOM study instance UID for search.
*/
public static SearchByAttributeValue fromDicomStudyInstanceUID(String dicomStudyInstanceUID) {
return builder().dicomStudyInstanceUID(dicomStudyInstanceUID).build();
}
/**
* Create an instance of this class with {@link #dicomSeriesInstanceUID()} initialized to the given value.
*
*
* The Series Instance UID input for search.
*
*
* @param dicomSeriesInstanceUID
* The Series Instance UID input for search.
*/
public static SearchByAttributeValue fromDicomSeriesInstanceUID(String dicomSeriesInstanceUID) {
return builder().dicomSeriesInstanceUID(dicomSeriesInstanceUID).build();
}
/**
* Create an instance of this class with {@link #createdAt()} initialized to the given value.
*
*
* The created at time of the image set provided for search.
*
*
* @param createdAt
* The created at time of the image set provided for search.
*/
public static SearchByAttributeValue fromCreatedAt(Instant createdAt) {
return builder().createdAt(createdAt).build();
}
/**
* Create an instance of this class with {@link #updatedAt()} initialized to the given value.
*
*
* The timestamp input for search.
*
*
* @param updatedAt
* The timestamp input for search.
*/
public static SearchByAttributeValue fromUpdatedAt(Instant updatedAt) {
return builder().updatedAt(updatedAt).build();
}
/**
* Create an instance of this class with {@link #dicomStudyDateAndTime()} initialized to the given value.
*
*
* The aggregated structure containing DICOM study date and study time for search.
*
*
* @param dicomStudyDateAndTime
* The aggregated structure containing DICOM study date and study time for search.
*/
public static SearchByAttributeValue fromDicomStudyDateAndTime(DICOMStudyDateAndTime dicomStudyDateAndTime) {
return builder().dicomStudyDateAndTime(dicomStudyDateAndTime).build();
}
/**
* Create an instance of this class with {@link #dicomStudyDateAndTime()} initialized to the given value.
*
*
* The aggregated structure containing DICOM study date and study time for search.
*
*
* @param dicomStudyDateAndTime
* The aggregated structure containing DICOM study date and study time for search.
*/
public static SearchByAttributeValue fromDicomStudyDateAndTime(Consumer dicomStudyDateAndTime) {
DICOMStudyDateAndTime.Builder builder = DICOMStudyDateAndTime.builder();
dicomStudyDateAndTime.accept(builder);
return fromDicomStudyDateAndTime(builder.build());
}
/**
* Retrieve an enum value representing which member of this object is populated.
*
* When this class is returned in a service response, this will be {@link Type#UNKNOWN_TO_SDK_VERSION} if the
* service returned a member that is only known to a newer SDK version.
*
* When this class is created directly in your code, this will be {@link Type#UNKNOWN_TO_SDK_VERSION} if zero
* members are set, and {@code null} if more than one member is set.
*/
public Type type() {
return type;
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
@Override
public final Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
private static Function