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

software.amazon.awssdk.services.iotdeviceadvisor.model.TestCaseScenario Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Iot Device Advisor module holds the client classes that are used for communicating with Iot Device Advisor.

There is a newer version: 2.29.15
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.iotdeviceadvisor.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;

/**
 * 

* Provides test case scenario. *

*/ @Generated("software.amazon.awssdk:codegen") public final class TestCaseScenario implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField TEST_CASE_SCENARIO_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("testCaseScenarioId").getter(getter(TestCaseScenario::testCaseScenarioId)) .setter(setter(Builder::testCaseScenarioId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("testCaseScenarioId").build()) .build(); private static final SdkField TEST_CASE_SCENARIO_TYPE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("testCaseScenarioType").getter(getter(TestCaseScenario::testCaseScenarioTypeAsString)) .setter(setter(Builder::testCaseScenarioType)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("testCaseScenarioType").build()) .build(); private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("status") .getter(getter(TestCaseScenario::statusAsString)).setter(setter(Builder::status)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("status").build()).build(); private static final SdkField FAILURE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("failure") .getter(getter(TestCaseScenario::failure)).setter(setter(Builder::failure)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("failure").build()).build(); private static final SdkField SYSTEM_MESSAGE_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("systemMessage").getter(getter(TestCaseScenario::systemMessage)).setter(setter(Builder::systemMessage)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("systemMessage").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(TEST_CASE_SCENARIO_ID_FIELD, TEST_CASE_SCENARIO_TYPE_FIELD, STATUS_FIELD, FAILURE_FIELD, SYSTEM_MESSAGE_FIELD)); private static final long serialVersionUID = 1L; private final String testCaseScenarioId; private final String testCaseScenarioType; private final String status; private final String failure; private final String systemMessage; private TestCaseScenario(BuilderImpl builder) { this.testCaseScenarioId = builder.testCaseScenarioId; this.testCaseScenarioType = builder.testCaseScenarioType; this.status = builder.status; this.failure = builder.failure; this.systemMessage = builder.systemMessage; } /** *

* Provides test case scenario ID. *

* * @return Provides test case scenario ID. */ public final String testCaseScenarioId() { return testCaseScenarioId; } /** *

* Provides test case scenario type. Type is one of the following: *

*
    *
  • *

    * Advanced *

    *
  • *
  • *

    * Basic *

    *
  • *
*

* If the service returns an enum value that is not available in the current SDK version, * {@link #testCaseScenarioType} will return {@link TestCaseScenarioType#UNKNOWN_TO_SDK_VERSION}. The raw value * returned by the service is available from {@link #testCaseScenarioTypeAsString}. *

* * @return Provides test case scenario type. Type is one of the following:

*
    *
  • *

    * Advanced *

    *
  • *
  • *

    * Basic *

    *
  • * @see TestCaseScenarioType */ public final TestCaseScenarioType testCaseScenarioType() { return TestCaseScenarioType.fromValue(testCaseScenarioType); } /** *

    * Provides test case scenario type. Type is one of the following: *

    *
      *
    • *

      * Advanced *

      *
    • *
    • *

      * Basic *

      *
    • *
    *

    * If the service returns an enum value that is not available in the current SDK version, * {@link #testCaseScenarioType} will return {@link TestCaseScenarioType#UNKNOWN_TO_SDK_VERSION}. The raw value * returned by the service is available from {@link #testCaseScenarioTypeAsString}. *

    * * @return Provides test case scenario type. Type is one of the following:

    *
      *
    • *

      * Advanced *

      *
    • *
    • *

      * Basic *

      *
    • * @see TestCaseScenarioType */ public final String testCaseScenarioTypeAsString() { return testCaseScenarioType; } /** *

      * Provides the test case scenario status. Status is one of the following: *

      *
        *
      • *

        * PASS: Test passed. *

        *
      • *
      • *

        * FAIL: Test failed. *

        *
      • *
      • *

        * PENDING: Test has not started running but is scheduled. *

        *
      • *
      • *

        * RUNNING: Test is running. *

        *
      • *
      • *

        * STOPPING: Test is performing cleanup steps. You will see this status only if you stop a suite run. *

        *
      • *
      • *

        * STOPPED Test is stopped. You will see this status only if you stop a suite run. *

        *
      • *
      • *

        * PASS_WITH_WARNINGS: Test passed with warnings. *

        *
      • *
      • *

        * ERORR: Test faced an error when running due to an internal issue. *

        *
      • *
      *

      * If the service returns an enum value that is not available in the current SDK version, {@link #status} will * return {@link TestCaseScenarioStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #statusAsString}. *

      * * @return Provides the test case scenario status. Status is one of the following:

      *
        *
      • *

        * PASS: Test passed. *

        *
      • *
      • *

        * FAIL: Test failed. *

        *
      • *
      • *

        * PENDING: Test has not started running but is scheduled. *

        *
      • *
      • *

        * RUNNING: Test is running. *

        *
      • *
      • *

        * STOPPING: Test is performing cleanup steps. You will see this status only if you stop a * suite run. *

        *
      • *
      • *

        * STOPPED Test is stopped. You will see this status only if you stop a suite run. *

        *
      • *
      • *

        * PASS_WITH_WARNINGS: Test passed with warnings. *

        *
      • *
      • *

        * ERORR: Test faced an error when running due to an internal issue. *

        *
      • * @see TestCaseScenarioStatus */ public final TestCaseScenarioStatus status() { return TestCaseScenarioStatus.fromValue(status); } /** *

        * Provides the test case scenario status. Status is one of the following: *

        *
          *
        • *

          * PASS: Test passed. *

          *
        • *
        • *

          * FAIL: Test failed. *

          *
        • *
        • *

          * PENDING: Test has not started running but is scheduled. *

          *
        • *
        • *

          * RUNNING: Test is running. *

          *
        • *
        • *

          * STOPPING: Test is performing cleanup steps. You will see this status only if you stop a suite run. *

          *
        • *
        • *

          * STOPPED Test is stopped. You will see this status only if you stop a suite run. *

          *
        • *
        • *

          * PASS_WITH_WARNINGS: Test passed with warnings. *

          *
        • *
        • *

          * ERORR: Test faced an error when running due to an internal issue. *

          *
        • *
        *

        * If the service returns an enum value that is not available in the current SDK version, {@link #status} will * return {@link TestCaseScenarioStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available * from {@link #statusAsString}. *

        * * @return Provides the test case scenario status. Status is one of the following:

        *
          *
        • *

          * PASS: Test passed. *

          *
        • *
        • *

          * FAIL: Test failed. *

          *
        • *
        • *

          * PENDING: Test has not started running but is scheduled. *

          *
        • *
        • *

          * RUNNING: Test is running. *

          *
        • *
        • *

          * STOPPING: Test is performing cleanup steps. You will see this status only if you stop a * suite run. *

          *
        • *
        • *

          * STOPPED Test is stopped. You will see this status only if you stop a suite run. *

          *
        • *
        • *

          * PASS_WITH_WARNINGS: Test passed with warnings. *

          *
        • *
        • *

          * ERORR: Test faced an error when running due to an internal issue. *

          *
        • * @see TestCaseScenarioStatus */ public final String statusAsString() { return status; } /** *

          * Provides test case scenario failure result. *

          * * @return Provides test case scenario failure result. */ public final String failure() { return failure; } /** *

          * Provides test case scenario system messages if any. *

          * * @return Provides test case scenario system messages if any. */ public final String systemMessage() { return systemMessage; } @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(testCaseScenarioId()); hashCode = 31 * hashCode + Objects.hashCode(testCaseScenarioTypeAsString()); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); hashCode = 31 * hashCode + Objects.hashCode(failure()); hashCode = 31 * hashCode + Objects.hashCode(systemMessage()); 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 TestCaseScenario)) { return false; } TestCaseScenario other = (TestCaseScenario) obj; return Objects.equals(testCaseScenarioId(), other.testCaseScenarioId()) && Objects.equals(testCaseScenarioTypeAsString(), other.testCaseScenarioTypeAsString()) && Objects.equals(statusAsString(), other.statusAsString()) && Objects.equals(failure(), other.failure()) && Objects.equals(systemMessage(), other.systemMessage()); } /** * 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("TestCaseScenario").add("TestCaseScenarioId", testCaseScenarioId()) .add("TestCaseScenarioType", testCaseScenarioTypeAsString()).add("Status", statusAsString()) .add("Failure", failure()).add("SystemMessage", systemMessage()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "testCaseScenarioId": return Optional.ofNullable(clazz.cast(testCaseScenarioId())); case "testCaseScenarioType": return Optional.ofNullable(clazz.cast(testCaseScenarioTypeAsString())); case "status": return Optional.ofNullable(clazz.cast(statusAsString())); case "failure": return Optional.ofNullable(clazz.cast(failure())); case "systemMessage": return Optional.ofNullable(clazz.cast(systemMessage())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((TestCaseScenario) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

          * Provides test case scenario ID. *

          * * @param testCaseScenarioId * Provides test case scenario ID. * @return Returns a reference to this object so that method calls can be chained together. */ Builder testCaseScenarioId(String testCaseScenarioId); /** *

          * Provides test case scenario type. Type is one of the following: *

          *
            *
          • *

            * Advanced *

            *
          • *
          • *

            * Basic *

            *
          • *
          * * @param testCaseScenarioType * Provides test case scenario type. Type is one of the following:

          *
            *
          • *

            * Advanced *

            *
          • *
          • *

            * Basic *

            *
          • * @see TestCaseScenarioType * @return Returns a reference to this object so that method calls can be chained together. * @see TestCaseScenarioType */ Builder testCaseScenarioType(String testCaseScenarioType); /** *

            * Provides test case scenario type. Type is one of the following: *

            *
              *
            • *

              * Advanced *

              *
            • *
            • *

              * Basic *

              *
            • *
            * * @param testCaseScenarioType * Provides test case scenario type. Type is one of the following:

            *
              *
            • *

              * Advanced *

              *
            • *
            • *

              * Basic *

              *
            • * @see TestCaseScenarioType * @return Returns a reference to this object so that method calls can be chained together. * @see TestCaseScenarioType */ Builder testCaseScenarioType(TestCaseScenarioType testCaseScenarioType); /** *

              * Provides the test case scenario status. Status is one of the following: *

              *
                *
              • *

                * PASS: Test passed. *

                *
              • *
              • *

                * FAIL: Test failed. *

                *
              • *
              • *

                * PENDING: Test has not started running but is scheduled. *

                *
              • *
              • *

                * RUNNING: Test is running. *

                *
              • *
              • *

                * STOPPING: Test is performing cleanup steps. You will see this status only if you stop a suite * run. *

                *
              • *
              • *

                * STOPPED Test is stopped. You will see this status only if you stop a suite run. *

                *
              • *
              • *

                * PASS_WITH_WARNINGS: Test passed with warnings. *

                *
              • *
              • *

                * ERORR: Test faced an error when running due to an internal issue. *

                *
              • *
              * * @param status * Provides the test case scenario status. Status is one of the following:

              *
                *
              • *

                * PASS: Test passed. *

                *
              • *
              • *

                * FAIL: Test failed. *

                *
              • *
              • *

                * PENDING: Test has not started running but is scheduled. *

                *
              • *
              • *

                * RUNNING: Test is running. *

                *
              • *
              • *

                * STOPPING: Test is performing cleanup steps. You will see this status only if you stop a * suite run. *

                *
              • *
              • *

                * STOPPED Test is stopped. You will see this status only if you stop a suite run. *

                *
              • *
              • *

                * PASS_WITH_WARNINGS: Test passed with warnings. *

                *
              • *
              • *

                * ERORR: Test faced an error when running due to an internal issue. *

                *
              • * @see TestCaseScenarioStatus * @return Returns a reference to this object so that method calls can be chained together. * @see TestCaseScenarioStatus */ Builder status(String status); /** *

                * Provides the test case scenario status. Status is one of the following: *

                *
                  *
                • *

                  * PASS: Test passed. *

                  *
                • *
                • *

                  * FAIL: Test failed. *

                  *
                • *
                • *

                  * PENDING: Test has not started running but is scheduled. *

                  *
                • *
                • *

                  * RUNNING: Test is running. *

                  *
                • *
                • *

                  * STOPPING: Test is performing cleanup steps. You will see this status only if you stop a suite * run. *

                  *
                • *
                • *

                  * STOPPED Test is stopped. You will see this status only if you stop a suite run. *

                  *
                • *
                • *

                  * PASS_WITH_WARNINGS: Test passed with warnings. *

                  *
                • *
                • *

                  * ERORR: Test faced an error when running due to an internal issue. *

                  *
                • *
                * * @param status * Provides the test case scenario status. Status is one of the following:

                *
                  *
                • *

                  * PASS: Test passed. *

                  *
                • *
                • *

                  * FAIL: Test failed. *

                  *
                • *
                • *

                  * PENDING: Test has not started running but is scheduled. *

                  *
                • *
                • *

                  * RUNNING: Test is running. *

                  *
                • *
                • *

                  * STOPPING: Test is performing cleanup steps. You will see this status only if you stop a * suite run. *

                  *
                • *
                • *

                  * STOPPED Test is stopped. You will see this status only if you stop a suite run. *

                  *
                • *
                • *

                  * PASS_WITH_WARNINGS: Test passed with warnings. *

                  *
                • *
                • *

                  * ERORR: Test faced an error when running due to an internal issue. *

                  *
                • * @see TestCaseScenarioStatus * @return Returns a reference to this object so that method calls can be chained together. * @see TestCaseScenarioStatus */ Builder status(TestCaseScenarioStatus status); /** *

                  * Provides test case scenario failure result. *

                  * * @param failure * Provides test case scenario failure result. * @return Returns a reference to this object so that method calls can be chained together. */ Builder failure(String failure); /** *

                  * Provides test case scenario system messages if any. *

                  * * @param systemMessage * Provides test case scenario system messages if any. * @return Returns a reference to this object so that method calls can be chained together. */ Builder systemMessage(String systemMessage); } static final class BuilderImpl implements Builder { private String testCaseScenarioId; private String testCaseScenarioType; private String status; private String failure; private String systemMessage; private BuilderImpl() { } private BuilderImpl(TestCaseScenario model) { testCaseScenarioId(model.testCaseScenarioId); testCaseScenarioType(model.testCaseScenarioType); status(model.status); failure(model.failure); systemMessage(model.systemMessage); } public final String getTestCaseScenarioId() { return testCaseScenarioId; } public final void setTestCaseScenarioId(String testCaseScenarioId) { this.testCaseScenarioId = testCaseScenarioId; } @Override public final Builder testCaseScenarioId(String testCaseScenarioId) { this.testCaseScenarioId = testCaseScenarioId; return this; } public final String getTestCaseScenarioType() { return testCaseScenarioType; } public final void setTestCaseScenarioType(String testCaseScenarioType) { this.testCaseScenarioType = testCaseScenarioType; } @Override public final Builder testCaseScenarioType(String testCaseScenarioType) { this.testCaseScenarioType = testCaseScenarioType; return this; } @Override public final Builder testCaseScenarioType(TestCaseScenarioType testCaseScenarioType) { this.testCaseScenarioType(testCaseScenarioType == null ? null : testCaseScenarioType.toString()); return this; } public final String getStatus() { return status; } public final void setStatus(String status) { this.status = status; } @Override public final Builder status(String status) { this.status = status; return this; } @Override public final Builder status(TestCaseScenarioStatus status) { this.status(status == null ? null : status.toString()); return this; } public final String getFailure() { return failure; } public final void setFailure(String failure) { this.failure = failure; } @Override public final Builder failure(String failure) { this.failure = failure; return this; } public final String getSystemMessage() { return systemMessage; } public final void setSystemMessage(String systemMessage) { this.systemMessage = systemMessage; } @Override public final Builder systemMessage(String systemMessage) { this.systemMessage = systemMessage; return this; } @Override public TestCaseScenario build() { return new TestCaseScenario(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy