package DecoratorLibrary;
-use MooseX::Types::Moose qw( Str ArrayRef HashRef Int );
+use MooseX::Types::Moose qw( Str ArrayRef HashRef Int Object);
use MooseX::Types
-declare => [qw(
MyArrayRefBase
Jobs
SubOfMyArrayRefInt01
BiggerInt
+ isFive
+ isTen
+ isFifteen
+ TwoEqualArrayRefs
+ VeryBigInt
+ FiveOrTenOrFifteen
+ WierdIntergersArrayRef1
+ WierdIntergersArrayRef2
)];
subtype MyArrayRefBase,
enum Jobs,
(qw/Programming Teaching Banking/);
+subtype isFive,
+ as Int,
+ where { $_ == 5};
+
+subtype isTen,
+ as Int,
+ where { $_ == 10};
+
+subtype isFifteen,
+ as Int,
+ where { $_ == 15};
+
+subtype VeryBigInt,
+ as BiggerInt,
+ where {$_>100};
+
+subtype FiveOrTenOrFifteen,
+ as isFive|isTen|isFifteen;
+
+subtype WierdIntergersArrayRef1,
+ as ArrayRef[FiveOrTenOrFifteen|VeryBigInt];
+
+subtype WierdIntergersArrayRef2,
+ as ArrayRef[FiveOrTenOrFifteen|Object];
1;