001/* 002 * SPDX-FileCopyrightText: none 003 * SPDX-License-Identifier: CC0-1.0 004 */ 005 006package gov.nist.secauto.oscal.lib.model.control.catalog; 007 008import gov.nist.secauto.metaschema.core.util.CollectionUtil; 009import gov.nist.secauto.metaschema.core.util.ObjectUtils; 010import gov.nist.secauto.oscal.lib.model.AbstractOscalInstance; 011import gov.nist.secauto.oscal.lib.model.control.AbstractParameter; 012 013import java.util.stream.Stream; 014 015import edu.umd.cs.findbugs.annotations.NonNull; 016 017public abstract class AbstractCatalog 018 extends AbstractOscalInstance 019 implements ICatalog { 020 021 @NonNull 022 @Override 023 public Stream<String> getReferencedParameterIds() { 024 // get parameters referenced by the control's parameters 025 return ObjectUtils.notNull( 026 CollectionUtil.listOrEmpty(getParams()).stream() 027 .flatMap(ObjectUtils::filterNull) 028 .flatMap(AbstractParameter::getParameterReferences) 029 .distinct()); 030 } 031}