File Coverage

blib/lib/SBOM/CycloneDX/PatentAssertion.pm
Criterion Covered Total %
statement 32 41 78.0
branch 0 10 0.0
condition n/a
subroutine 11 12 91.6
pod 1 1 100.0
total 44 64 68.7


line stmt bran cond sub pod time code
1             package SBOM::CycloneDX::PatentAssertion;
2              
3 1     1   1869 use 5.010001;
  1         6  
4 1     1   9 use strict;
  1         3  
  1         30  
5 1     1   5 use warnings;
  1         4  
  1         96  
6 1     1   8 use utf8;
  1         4  
  1         11  
7              
8 1     1   54 use SBOM::CycloneDX::BomRef;
  1         5  
  1         39  
9 1     1   8 use SBOM::CycloneDX::Enum;
  1         3  
  1         69  
10 1     1   30 use SBOM::CycloneDX::List;
  1         4  
  1         44  
11              
12 1     1   9 use Types::Standard qw(Str InstanceOf Enum);
  1         2  
  1         12  
13 1     1   2477 use Types::TypeTiny qw(ArrayLike);
  1         41  
  1         11  
14              
15 1     1   709 use Moo;
  1         3  
  1         13  
16 1     1   628 use namespace::autoclean;
  1         3  
  1         19  
17              
18             extends 'SBOM::CycloneDX::Base';
19              
20             has bom_ref => (
21             is => 'rw',
22             isa => InstanceOf ['SBOM::CycloneDX::BomRef'],
23             coerce => sub { ref($_[0]) ? $_[0] : SBOM::CycloneDX::BomRef->new($_[0]) }
24             );
25              
26             has assertion_type => (is => 'rw', isa => Enum [SBOM::CycloneDX::Enum->values('PATENT_ASSERTION_TYPE')], required => 1);
27              
28             has patent_refs => (
29             is => 'rw',
30             isa => ArrayLike [Str | InstanceOf ['SBOM::CycloneDX::BomRef']],
31             default => sub { SBOM::CycloneDX::List->new }
32             );
33              
34             has asserter => (
35             is => 'rw',
36             isa => (
37             InstanceOf ['SBOM::CycloneDX::OrganizationalContact'] | InstanceOf ['SBOM::CycloneDX::OrganizationalEntity']
38             | InstanceOf ['SBOM::CycloneDX::BomRef']
39             ),
40             required => 1
41             );
42              
43             has notes => (is => 'rw', isa => Str);
44              
45             sub TO_JSON {
46              
47 0     0 1   my $self = shift;
48              
49 0           my $json = {};
50              
51 0 0         $json->{'bom-ref'} = $self->bom_ref if ($self->bom_ref);
52 0 0         $json->{assertionType} = $self->assertion_type if ($self->assertion_type);
53 0 0         $json->{patentRefs} = $self->patent_refs if (@{$self->patent_refs});
  0            
54 0 0         $json->{asserter} = $self->asserter if ($self->asserter);
55 0 0         $json->{notes} = $self->notes if ($self->notes);
56              
57 0           return $json;
58              
59             }
60              
61             1;
62              
63             =encoding utf-8
64              
65             =head1 NAME
66              
67             SBOM::CycloneDX::PatentAssertion - Patent Assertion
68              
69             =head1 SYNOPSIS
70              
71             SBOM::CycloneDX::PatentAssertion->new();
72              
73              
74             =head1 DESCRIPTION
75              
76             L An assertion linking a patent or patent
77             family to this component or service.
78              
79             =head2 METHODS
80              
81             L inherits all methods from L
82             and implements the following new ones.
83              
84             =over
85              
86             =item SBOM::CycloneDX::PatentAssertion->new( %PARAMS )
87              
88             Properties:
89              
90             =over
91              
92             =item * C, One of a L, L or L object.
93              
94             =item * C, The type of assertion being made about the patent
95             or patent family. Examples include ownership, licensing, and standards
96             inclusion.
97              
98             See L.
99              
100             =item * C, A reference to the patent or patent family object within
101             the BOM. This must match the L of a L or C L
102             object.
103              
104             =item * C, Additional notes or clarifications regarding the assertion,
105             if necessary. For example, geographical restrictions, duration, or
106             limitations of a license.
107              
108             =item * C, A list of BOM references (C) linking to
109             patents or patent families associated with this assertion.
110              
111             =back
112              
113             =item $patent_assertion->asserter
114              
115             =item $patent_assertion->assertion_type
116              
117             =item $patent_assertion->bom_ref
118              
119             =item $patent_assertion->notes
120              
121             =item $patent_assertion->patent_refs
122              
123             =back
124              
125              
126             =head1 SUPPORT
127              
128             =head2 Bugs / Feature Requests
129              
130             Please report any bugs or feature requests through the issue tracker
131             at L.
132             You will be notified automatically of any progress on your issue.
133              
134             =head2 Source Code
135              
136             This is open source software. The code repository is available for
137             public review and contribution under the terms of the license.
138              
139             L
140              
141             git clone https://github.com/giterlizzi/perl-SBOM-CycloneDX.git
142              
143              
144             =head1 AUTHOR
145              
146             =over 4
147              
148             =item * Giuseppe Di Terlizzi
149              
150             =back
151              
152              
153             =head1 LICENSE AND COPYRIGHT
154              
155             This software is copyright (c) 2025-2026 by Giuseppe Di Terlizzi.
156              
157             This is free software; you can redistribute it and/or modify it under
158             the same terms as the Perl 5 programming language system itself.
159              
160             =cut