| 1 | package SBOM::CycloneDX::PatentAssertion; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use 5.010001; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 1 | ▶ | use utf8; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 1 | ▶ | use SBOM::CycloneDX::BomRef; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 1 | ▶ | use SBOM::CycloneDX::Enum; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 1 | ▶ | use SBOM::CycloneDX::List; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | 1 | ▶ | use Types::Standard qw(Str InstanceOf Enum); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | 1 | ▶ | use Types::TypeTiny qw(ArrayLike); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | |||||||||||
| 15 | 1 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 16 | 1 | ▶ | use namespace::autoclean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 17 | |||||||||||
| 18 | 1 | extends 'SBOM::CycloneDX::Base'; | |||||||||
| 19 | |||||||||||
| 20 | has bom_ref => ( | ||||||||||
| 21 | is => 'rw', | ||||||||||
| 22 | isa => InstanceOf ['SBOM::CycloneDX::BomRef'], | ||||||||||
| 23 | 0 | ▶ | coerce => sub { ref($_[0]) ? $_[0] : SBOM::CycloneDX::BomRef->new($_[0]) } | ||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
| |||||||||||
| 24 | 1 | ); | |||||||||
| 25 | |||||||||||
| 26 | 1 | 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 | 0 | ▶ | default => sub { SBOM::CycloneDX::List->new } | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 32 | 1 | ); | |||||||||
| 33 | |||||||||||
| 34 | 1 | 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 | 1 | has notes => (is => 'rw', isa => Str); | |||||||||
| 44 | |||||||||||
| 45 | 0 | ▶ | sub TO_JSON { | ||||||||
|
Subroutine
TO_JSON: not called CC=6 SCAR=37.4
Pod
documented
| |||||||||||
| 46 | |||||||||||
| 47 | 0 | my $self = shift; | |||||||||
| 48 | |||||||||||
| 49 | 0 | my $json = {}; | |||||||||
| 50 | |||||||||||
| 51 | 0 | ▶ | $json->{'bom-ref'} = $self->bom_ref if ($self->bom_ref); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 52 | 0 | ▶ | $json->{assertionType} = $self->assertion_type if ($self->assertion_type); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 53 | 0 | ▶ | $json->{patentRefs} = $self->patent_refs if (@{$self->patent_refs}); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 54 | 0 | ▶ | $json->{asserter} = $self->asserter if ($self->asserter); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 55 | 0 | ▶ | $json->{notes} = $self->notes if ($self->notes); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 56 | |||||||||||
| 57 | 0 | return $json; | |||||||||
| 58 | |||||||||||
| 59 | } | ||||||||||
| 60 | |||||||||||
| 61 | 1 | 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<SBOM::CycloneDX::PatentAssertion> An assertion linking a patent or patent | ||||||||||
| 77 | family to this component or service. | ||||||||||
| 78 | |||||||||||
| 79 | =head2 METHODS | ||||||||||
| 80 | |||||||||||
| 81 | L<SBOM::CycloneDX::PatentAssertion> inherits all methods from L<SBOM::CycloneDX::Base> | ||||||||||
| 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<asserter>, One of a L<SBOM::CycloneDX::OrganizationalEntity>, L<SBOM::CycloneDX::OrganizationalContact> or L<SBOM::CycloneDX::BomRef> object. | ||||||||||
| 93 | |||||||||||
| 94 | =item * C<assertion_type>, 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<SBOM::CycloneDX::Enum::PatentAssertionType>. | ||||||||||
| 99 | |||||||||||
| 100 | =item * C<bom_ref>, A reference to the patent or patent family object within | ||||||||||
| 101 | the BOM. This must match the L<SBOM::CycloneDX::BomRef> of a L<SBOM::CycloneDX::Patent> or C L<SBOM::CycloneDX::PatentFamily> | ||||||||||
| 102 | object. | ||||||||||
| 103 | |||||||||||
| 104 | =item * C<notes>, 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<patent_refs>, A list of BOM references (C<bom-ref>) 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<https://github.com/giterlizzi/perl-SBOM-CycloneDX/issues>. | ||||||||||
| 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<https://github.com/giterlizzi/perl-SBOM-CycloneDX> | ||||||||||
| 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 <gdt@cpan.org> | ||||||||||
| 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 | ||||||||||