summaryrefslogtreecommitdiffstats
path: root/common-parameters/src/main/java/org/onap/policy/common/parameters/annotations/Max.java
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2019-06-07 10:20:20 -0400
committerJim Hahn <jrh3@att.com>2019-06-07 10:20:20 -0400
commite671e9fa5d09ec696cb24aeefaf10ddbc7c705d7 (patch)
tree11b6367c23d8b689c5120e0d1779f6e23616df3c /common-parameters/src/main/java/org/onap/policy/common/parameters/annotations/Max.java
parentc657a28325092a721f2d8d9bb7991ae88d2b237e (diff)
Add @Max annotation to paramater validation code
Change-Id: I928eeb6bf52cb9e825db456278ce8bff449c692c Issue-ID: POLICY-1762 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'common-parameters/src/main/java/org/onap/policy/common/parameters/annotations/Max.java')
-rw-r--r--common-parameters/src/main/java/org/onap/policy/common/parameters/annotations/Max.java39
1 files changed, 39 insertions, 0 deletions
diff --git a/common-parameters/src/main/java/org/onap/policy/common/parameters/annotations/Max.java b/common-parameters/src/main/java/org/onap/policy/common/parameters/annotations/Max.java
new file mode 100644
index 00000000..1d8fd90f
--- /dev/null
+++ b/common-parameters/src/main/java/org/onap/policy/common/parameters/annotations/Max.java
@@ -0,0 +1,39 @@
+/*
+ * ============LICENSE_START=======================================================
+ * ONAP
+ * ================================================================================
+ * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.policy.common.parameters.annotations;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+@Retention(RUNTIME)
+@Target(FIELD)
+public @interface Max {
+
+ /**
+ * The maximum value allowed.
+ *
+ * @return the maximum value allowed
+ */
+ long value();
+}