{"id":219,"date":"2012-02-28T11:28:42","date_gmt":"2012-02-28T11:28:42","guid":{"rendered":"http:\/\/www.lexicalscope.com\/blog\/?p=219"},"modified":"2012-02-28T17:58:03","modified_gmt":"2012-02-28T17:58:03","slug":"jewelcli-constrained-multivalued-option","status":"publish","type":"post","link":"https:\/\/www.lexicalscope.com\/blog\/2012\/02\/28\/jewelcli-constrained-multivalued-option\/","title":{"rendered":"JewelCli Constrained Multivalued Option"},"content":{"rendered":"<p>A new feature in <a href=\"http:\/\/repo1.maven.org\/maven2\/com\/lexicalscope\/jewelcli\/jewelcli\/0.8.1\/jewelcli-0.8.1.jar\" title=\"JewelCli 0.8.1 jar\">JewelCli 0.8.1<\/a> is the ability to constrain the multiplicity of multivalued options. If the arguments given by the user do not match the constraints an appropriate <code>ArgumentValidationException<\/code> is thrown.<\/p>\n<h3>Minimum<\/h3>\n<pre lang=\"java\">\r\npublic interface ListWithMinimumOfOne {\r\n    @Option(minimum = 1) List<String> getMyOption();\r\n}\r\n<\/pre>\n<h3>Maximum<\/h3>\n<pre lang=\"java\">\r\npublic interface ListWithMaximumOfFour {\r\n    @Option(maximum = 4) List<String> getMyOption();\r\n}\r\n<\/pre>\n<h3>Exact Count<\/h3>\n<pre lang=\"java\">\r\npublic interface ListWithExactlyThree {\r\n    @Option(exactly = 3) List<String> getMyOption();\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>A new feature in JewelCli 0.8.1 is the ability to constrain the multiplicity of multivalued options. If the arguments given by the user do not match the constraints an appropriate ArgumentValidationException is thrown. Minimum public interface ListWithMinimumOfOne { @Option(minimum = &hellip; <a href=\"https:\/\/www.lexicalscope.com\/blog\/2012\/02\/28\/jewelcli-constrained-multivalued-option\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[11,7],"tags":[],"class_list":["post-219","post","type-post","status-publish","format-standard","hentry","category-jewelcli","category-software-projects"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p2e3P7-3x","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.lexicalscope.com\/blog\/wp-json\/wp\/v2\/posts\/219","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lexicalscope.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lexicalscope.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lexicalscope.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lexicalscope.com\/blog\/wp-json\/wp\/v2\/comments?post=219"}],"version-history":[{"count":5,"href":"https:\/\/www.lexicalscope.com\/blog\/wp-json\/wp\/v2\/posts\/219\/revisions"}],"predecessor-version":[{"id":229,"href":"https:\/\/www.lexicalscope.com\/blog\/wp-json\/wp\/v2\/posts\/219\/revisions\/229"}],"wp:attachment":[{"href":"https:\/\/www.lexicalscope.com\/blog\/wp-json\/wp\/v2\/media?parent=219"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lexicalscope.com\/blog\/wp-json\/wp\/v2\/categories?post=219"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lexicalscope.com\/blog\/wp-json\/wp\/v2\/tags?post=219"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}