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

com.exactpro.sf.scriptrunner.StatusDescription Maven / Gradle / Ivy

There is a newer version: 3.4.260
Show newest version
/******************************************************************************
 * Copyright 2009-2018 Exactpro (Exactpro Systems Limited)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License 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 com.exactpro.sf.scriptrunner;

import java.util.Collections;
import java.util.Set;

import com.exactpro.sf.util.BugDescription;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

public class StatusDescription
{
	private final StatusType status;

	private final String description;

	@JsonIgnore
	private final Throwable cause;

	@JsonIgnore
	private final boolean updateTestCaseStatus;

	@JsonIgnore
    private final Set knownBugs;

	@JsonCreator
	public StatusDescription(@JsonProperty("status") StatusType status, @JsonProperty("description") String description)
	{
        this(status, description, true, null);
	}

    public StatusDescription(StatusType status, String description, boolean updateTestCaseStatus) {
        this(status, description, updateTestCaseStatus, null);
    }

    public StatusDescription(StatusType status, String description, Set knownBugs) {
        this(status, description, null, true, knownBugs);
    }

	public StatusDescription(StatusType status, String description, Throwable cause)
	{
        this(status, description, cause, true, null);
	}

    public StatusDescription(StatusType status, String description, Throwable cause, Set knownBugs) {
        this(status, description, cause, true, knownBugs);
    }

    public StatusDescription(StatusType status, String description, Throwable cause, boolean updateTestCaseStatus) {
        this(status, description, cause, updateTestCaseStatus, null);
    }

    public StatusDescription(StatusType status, String description, boolean updateTestCaseStatus, Set knownBugs)
	{
		this.status = status;

		this.description = description;

		this.cause = null;

		this.updateTestCaseStatus = updateTestCaseStatus;

        this.knownBugs = knownBugs == null ? Collections.emptySet() : Collections.unmodifiableSet(knownBugs);
	}

    public StatusDescription(StatusType status, String description, Throwable cause, boolean updateTestCaseStatus, Set knownBugs)
	{
		this.status = status;

		this.description = description;

		this.cause = cause;

		this.updateTestCaseStatus = updateTestCaseStatus;

        this.knownBugs = knownBugs == null ? Collections.emptySet() : Collections.unmodifiableSet(knownBugs);
	}

	public StatusType getStatus() {
		return status;
	}

	public String getDescription() {
		return description;
	}

	public Throwable getCause() {
		return cause;
	}

	public boolean isUpdateTestCaseStatus() {
		return updateTestCaseStatus;
	}

    public Set getKnownBugs() {
        return knownBugs;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy