001/* 002 * SPDX-FileCopyrightText: none 003 * SPDX-License-Identifier: CC0-1.0 004 */ 005 006package gov.nist.secauto.oscal.lib.model.metadata; 007 008import gov.nist.secauto.oscal.lib.model.BackMatter.Resource; 009 010import java.util.List; 011import java.util.UUID; 012 013import edu.umd.cs.findbugs.annotations.NonNull; 014 015public abstract class AbstractBackMatter implements IBackMatter { 016 017 @Override 018 public Resource getResourceByUuid(@NonNull UUID uuid) { 019 List<Resource> resources = getResources(); 020 021 Resource retval = null; 022 if (resources != null) { 023 retval = resources.stream() 024 .filter(resource -> { 025 return uuid.equals(resource.getUuid()); 026 }).findFirst() 027 .orElse(null); 028 } 029 return retval; 030 } 031 032}