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

com.sap.cloud.security.ams.dcl.client.dcn.TestCase Maven / Gradle / Ivy

The newest version!
/************************************************************************
 * © 2019-2024 SAP SE or an SAP affiliate company. All rights reserved. *
 ************************************************************************/
package com.sap.cloud.security.ams.dcl.client.dcn;

import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.function.Consumer;

import com.sap.cloud.security.ams.dcl.client.annotation.Beta;
import com.sap.cloud.security.ams.dcl.client.el.QualifiedName;

@Beta
public class TestCase implements Annotated {

    private QualifiedName qualifiedName;

    private List testAssertions;

    private Map annotations;

    private transient Object userData; // NOSONAR

    public QualifiedName qualifiedName() {
        return qualifiedName;
    }

    public TestCase qualifiedName(QualifiedName qualifiedName) {
        this.qualifiedName = qualifiedName;
        return this;
    }

    public List testAssertions() {
        return testAssertions;
    }

    public TestCase testAssertions(List testAssertions) {
        this.testAssertions = testAssertions;
        return this;
    }

    @Override
    public Map annotations() {
        return annotations; // NOSONAR
    }

    @Override
    public TestCase annotations(Map annotations) {
        this.annotations = annotations; // NOSONAR
        return this;
    }

    /**
     * Gets the custom user data. This data is not stored or loaded (i.e transient). The value is not take into account for hashCode() or
     * equals(Object other).
     * 
     * @return user data
     */
    public Object userData() {
        return userData;
    }

    /**
     * Sets the user data. This data is not stored or loaded (i.e transient). The value is not take into account for hashCode() or equals(Object
     * other).
     * 
     * @param userData
     *            custom user data
     * @return this
     */
    public TestCase userData(Object userData) {
        this.userData = userData;
        return this;
    }

    public TestCase apply(Consumer consumer) {
        consumer.accept(this);
        return this;
    }

    //

    @Override
    public String toString() {
        return "TestCase [qualifiedName=" + qualifiedName
                + ", testAssertions=" + testAssertions
                + ", annotations=" + annotations
                + "]";
    }

    @Override
    public int hashCode() {
        return Objects.hash(qualifiedName, testAssertions, annotations);
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        TestCase other = (TestCase) obj;
        return Objects.equals(qualifiedName, other.qualifiedName)
                && Objects.equals(testAssertions, other.testAssertions)
                && Objects.equals(annotations, other.annotations);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy