File Coverage

blib/lib/Siebel/Srvrmgr/Types.pm
Criterion Covered Total %
statement 12 12 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 16 16 100.0


line stmt bran cond sub pod time code
1             package Siebel::Srvrmgr::Types;
2              
3 35     35   185 use warnings;
  35         66  
  35         1075  
4 35     35   175 use strict;
  35         64  
  35         813  
5 35     35   189 use Moose::Util::TypeConstraints;
  35         103  
  35         1455  
6              
7             =pod
8              
9             =head1 NAME
10              
11             Siebel::Srvrmgr::Types - definition of types restrictions for Siebel::Srvrmgr
12              
13             =head1 SYNOPSIS
14              
15             use Siebel::Srvrmgr::Types;
16              
17             =head1 DESCRIPTION
18              
19             This module defines types restrictions for L<Siebel::Srvrmgr> classes usage based on L<Moose::Util::TypeConstraints>.
20              
21             =head1 EXPORTS
22              
23             Nothing. Just use the module is enough to have types restrictions definitions.
24              
25             =cut
26              
27             =head2 NotNullStr
28              
29             A subtype of 'Str' but do not accept undefined or empty strings.
30              
31             =cut
32              
33             subtype 'NotNullStr', as 'Str',
34             where { ( defined($_) ) and ( $_ ne '' ) },
35             message { 'This attribute value must be a defined, non-empty string' };
36              
37             =head2 Chr
38              
39             A subtype of 'Str' but for a single character only.
40              
41             =cut
42              
43             subtype 'Chr', as 'Str',
44             where { ( defined($_) ) and ( $_ ne '' ) and ( length($_) == 1 ) },
45             message { 'This attribute value must be a defined, non-empty string with a single character' };
46              
47             =head2 OutputTabularType
48              
49             A subtype of 'Str' that must be defined and equal to "fixed" or "delimited".
50              
51             =cut
52              
53             subtype 'OutputTabularType', as 'Str',
54             where { ( ( defined($_) ) and ( ( $_ eq 'fixed' ) or ( $_ eq 'delimited' ) ) ) },
55             message { 'This attribute value must be a defined, non-empty string equal "fixed" or "delimited"' };
56              
57             =head2 CheckCompsComp
58              
59             Definition of type for instances of L<Siebel::Srvrmgr::Daemon::Action::Check::Component> class.
60              
61             =cut
62              
63             role_type 'CheckCompsComp',
64             { role => 'Siebel::Srvrmgr::Daemon::Action::Check::Component' };
65              
66 35     35   85247 no Moose::Util::TypeConstraints;
  35         86  
  35         209  
67              
68             =head1 AUTHOR
69              
70             Alceu Rodrigues de Freitas Junior, E<lt>arfreitas@cpan.orgE<gt>
71              
72             =head1 COPYRIGHT AND LICENSE
73              
74             This software is copyright (c) 2013 of Alceu Rodrigues de Freitas Junior, E<lt>arfreitas@cpan.orgE<gt>
75              
76             This file is part of Siebel Monitoring Tools.
77              
78             Siebel Monitoring Tools is free software: you can redistribute it and/or modify
79             it under the terms of the GNU General Public License as published by
80             the Free Software Foundation, either version 3 of the License, or
81             (at your option) any later version.
82              
83             Siebel Monitoring Tools is distributed in the hope that it will be useful,
84             but WITHOUT ANY WARRANTY; without even the implied warranty of
85             MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
86             GNU General Public License for more details.
87              
88             You should have received a copy of the GNU General Public License
89             along with Siebel Monitoring Tools. If not, see <http://www.gnu.org/licenses/>.
90              
91             =cut
92              
93             1;