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.Metadata.Party; 009 010import java.util.List; 011import java.util.UUID; 012 013import edu.umd.cs.findbugs.annotations.NonNull; 014 015public abstract class AbstractMetadata implements IMetadata { 016 017 @Override 018 public Party getPartyByUuid(@NonNull UUID uuid) { 019 List<Party> parties = getParties(); 020 021 Party retval = null; 022 if (parties != null) { 023 retval = parties.stream() 024 .filter(party -> { 025 return uuid.equals(party.getUuid()); 026 }).findFirst() 027 .orElse(null); 028 } 029 return retval; 030 } 031}