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

org.conqat.engine.index.shared.FindingsSummaryGroupInfo Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (c) CQSE GmbH
 *
 * 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 org.conqat.engine.index.shared;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * Holds a finding group name along with its number of corresponding findings.
 */
public class FindingsSummaryGroupInfo extends FindingsSummaryCountInfoBase implements Serializable {

	/** Version for serialization */
	private static final long serialVersionUID = 1;

	/** The name of the JSON property name for {@link #groupName}. */
	private static final String GROUP_NAME_PROPERTY = "groupName";

	/** The name of the JSON property name for {@link #count}. */
	private static final String COUNT_PROPERTY = "count";

	/** The name of the JSON property name for {@link #countRed}. */
	private static final String COUNT_RED_PROPERTY = "countRed";

	/** The name of the finding group */
	@JsonProperty(GROUP_NAME_PROPERTY)
	private final String groupName;

	/** The finding typeId infos */
	@JsonProperty("typeIdInfos")
	private final List typeIdInfos = new ArrayList<>();

	/** Constructor */
	@JsonCreator
	public FindingsSummaryGroupInfo(@JsonProperty(GROUP_NAME_PROPERTY) String groupName,
			@JsonProperty(COUNT_PROPERTY) int count, @JsonProperty(COUNT_RED_PROPERTY) int countRed) {
		this.groupName = groupName;
		this.count = count;
		this.countRed = countRed;
	}

	/** Returns the finding group. */
	public String getGroup() {
		return groupName;
	}

	/** Returns the TypeId infos. */
	public List getTypeIdInfos() {
		return typeIdInfos;
	}

	/** Adds the given group info to this category info. */
	public void addTypeIdInfo(FindingsSummaryTypeIdInfo typeIdInfo) {
		this.typeIdInfos.add(typeIdInfo);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy