[PORTAL-16 PORTAL-18] Widget ms; staging
[portal.git] / ecomp-portal-BE-common / src / main / java / org / openecomp / portalapp / portal / transport / FieldsValidator.java
index ab51b7b..fee83b2 100644 (file)
-/*-\r
- * ================================================================================\r
- * ECOMP Portal\r
- * ================================================================================\r
- * Copyright (C) 2017 AT&T Intellectual Property\r
- * ================================================================================\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- * \r
- *      http://www.apache.org/licenses/LICENSE-2.0\r
- * \r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- * ================================================================================\r
- */\r
-package org.openecomp.portalapp.portal.transport;\r
-\r
-import java.util.ArrayList;\r
-import java.util.List;\r
-\r
-import javax.servlet.http.HttpServletResponse;\r
-\r
-public class FieldsValidator {\r
-\r
-       public Long httpStatusCode = new Long(HttpServletResponse.SC_OK);\r
-\r
-       public Long errorCode;\r
-\r
-       public class FieldName {\r
-\r
-               public String name;\r
-\r
-               public FieldName(String name) {\r
-                       this.name = name;\r
-               }\r
-\r
-               public String getName() {\r
-                       return name;\r
-               }\r
-\r
-               public void setName(String name) {\r
-                       this.name = name;\r
-               }\r
-\r
-       }\r
-       \r
-\r
-       public List<FieldName> fields = new ArrayList<FieldName>();\r
-\r
-       public void addProblematicFieldName(String name) {\r
-               fields.add(new FieldName(name));\r
-       }\r
-\r
-       public Long getHttpStatusCode() {\r
-               return httpStatusCode;\r
-       }\r
-\r
-       public void setHttpStatusCode(Long httpStatusCode) {\r
-               this.httpStatusCode = httpStatusCode;\r
-       }\r
-\r
-       public Long getErrorCode() {\r
-               return errorCode;\r
-       }\r
-\r
-       public void setErrorCode(Long errorCode) {\r
-               this.errorCode = errorCode;\r
-       }\r
-\r
-       public List<FieldName> getFields() {\r
-               return fields;\r
-       }\r
-\r
-       public void setFields(List<FieldName> fields) {\r
-               this.fields = fields;\r
-       }\r
-\r
-       @Override\r
-       public String toString() {\r
-               return "FieldsValidator [httpStatusCode=" + httpStatusCode + ", errorCode=" + errorCode + ", fields=" + fields\r
-                               + "]";\r
-       }\r
-\r
-       @Override\r
-       public int hashCode() {\r
-               final int prime = 31;\r
-               int result = 1;\r
-               result = prime * result + ((errorCode == null) ? 0 : errorCode.hashCode());\r
-               result = prime * result + ((fields == null) ? 0 : fields.hashCode());\r
-               result = prime * result + ((httpStatusCode == null) ? 0 : httpStatusCode.hashCode());\r
-               return result;\r
-       }\r
-\r
-       @Override\r
-       public boolean equals(Object obj) {\r
-               if (this == obj)\r
-                       return true;\r
-               if (obj == null)\r
-                       return false;\r
-               if (getClass() != obj.getClass())\r
-                       return false;\r
-               FieldsValidator other = (FieldsValidator) obj;\r
-               if (errorCode == null) {\r
-                       if (other.errorCode != null)\r
-                               return false;\r
-               } else if (!errorCode.equals(other.errorCode))\r
-                       return false;\r
-               if (fields == null) {\r
-                       if (other.fields != null)\r
-                               return false;\r
-               } else if (!fields.equals(other.fields))\r
-                       return false;\r
-               if (httpStatusCode == null) {\r
-                       if (other.httpStatusCode != null)\r
-                               return false;\r
-               } else if (!httpStatusCode.equals(other.httpStatusCode))\r
-                       return false;\r
-               return true;\r
-       }\r
-\r
-}\r
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * 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.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.transport;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.servlet.http.HttpServletResponse;
+
+public class FieldsValidator {
+
+       public Long httpStatusCode = new Long(HttpServletResponse.SC_OK);
+
+       public Long errorCode;
+
+       public class FieldName {
+
+               public String name;
+
+               public FieldName(String name) {
+                       this.name = name;
+               }
+
+               public String getName() {
+                       return name;
+               }
+
+               public void setName(String name) {
+                       this.name = name;
+               }
+
+       }
+       
+
+       public List<FieldName> fields = new ArrayList<FieldName>();
+
+       public void addProblematicFieldName(String name) {
+               fields.add(new FieldName(name));
+       }
+
+       public Long getHttpStatusCode() {
+               return httpStatusCode;
+       }
+
+       public void setHttpStatusCode(Long httpStatusCode) {
+               this.httpStatusCode = httpStatusCode;
+       }
+
+       public Long getErrorCode() {
+               return errorCode;
+       }
+
+       public void setErrorCode(Long errorCode) {
+               this.errorCode = errorCode;
+       }
+
+       public List<FieldName> getFields() {
+               return fields;
+       }
+
+       public void setFields(List<FieldName> fields) {
+               this.fields = fields;
+       }
+
+       @Override
+       public String toString() {
+               return "FieldsValidator [httpStatusCode=" + httpStatusCode + ", errorCode=" + errorCode + ", fields=" + fields
+                               + "]";
+       }
+
+       @Override
+       public int hashCode() {
+               final int prime = 31;
+               int result = 1;
+               result = prime * result + ((errorCode == null) ? 0 : errorCode.hashCode());
+               result = prime * result + ((fields == null) ? 0 : fields.hashCode());
+               result = prime * result + ((httpStatusCode == null) ? 0 : httpStatusCode.hashCode());
+               return result;
+       }
+
+       @Override
+       public boolean equals(Object obj) {
+               if (this == obj)
+                       return true;
+               if (obj == null)
+                       return false;
+               if (getClass() != obj.getClass())
+                       return false;
+               FieldsValidator other = (FieldsValidator) obj;
+               if (errorCode == null) {
+                       if (other.errorCode != null)
+                               return false;
+               } else if (!errorCode.equals(other.errorCode))
+                       return false;
+               if (fields == null) {
+                       if (other.fields != null)
+                               return false;
+               } else if (!fields.equals(other.fields))
+                       return false;
+               if (httpStatusCode == null) {
+                       if (other.httpStatusCode != null)
+                               return false;
+               } else if (!httpStatusCode.equals(other.httpStatusCode))
+                       return false;
+               return true;
+       }
+
+}