[PORTAL-7] Rebase
[portal.git] / ecomp-portal-BE-common / src / main / java / org / openecomp / portalapp / portal / ecomp / model / AppCatalogItem.java
diff --git a/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/ecomp/model/AppCatalogItem.java b/ecomp-portal-BE-common/src/main/java/org/openecomp/portalapp/portal/ecomp/model/AppCatalogItem.java
new file mode 100644 (file)
index 0000000..ec20b4f
--- /dev/null
@@ -0,0 +1,249 @@
+/*-\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.ecomp.model;\r
+\r
+import javax.persistence.Entity;\r
+import javax.persistence.Id;\r
+\r
+import org.openecomp.portalsdk.core.domain.support.DomainVo;\r
+import com.fasterxml.jackson.annotation.JsonInclude;\r
+\r
+/**\r
+ * This model of an application catalog entry has some EPApp fields plus\r
+ * additional fields to indicate access(ible) and select(ed) statuses.\r
+ */\r
+@Entity\r
+@JsonInclude(JsonInclude.Include.NON_NULL)\r
+public class AppCatalogItem extends DomainVo {\r
+\r
+       private static final long serialVersionUID = 6619663784935017846L;\r
+\r
+       @Id\r
+       private Long id;\r
+       private String name;\r
+       private String imageUrl;\r
+       private String description;\r
+       private String notes;\r
+       private String url;\r
+       private String alternateUrl;\r
+       private Boolean restricted;\r
+       private Boolean open;\r
+       private Boolean access;\r
+       private Boolean select;\r
+       private Boolean pending;\r
+\r
+       public Long getId() {\r
+               return id;\r
+       }\r
+\r
+       public void setId(Long id) {\r
+               this.id = id;\r
+       }\r
+\r
+       public String getName() {\r
+               return name;\r
+       }\r
+\r
+       public void setName(String name) {\r
+               this.name = name;\r
+       }\r
+\r
+       public String getImageUrl() {\r
+               return imageUrl;\r
+       }\r
+\r
+       public void setImageUrl(String imageUrl) {\r
+               this.imageUrl = imageUrl;\r
+       }\r
+\r
+       public String getDescription() {\r
+               return description;\r
+       }\r
+\r
+       public void setDescription(String description) {\r
+               this.description = description;\r
+       }\r
+\r
+       public String getNotes() {\r
+               return notes;\r
+       }\r
+\r
+       public void setNotes(String notes) {\r
+               this.notes = notes;\r
+       }\r
+\r
+       public String getUrl() {\r
+               return url;\r
+       }\r
+\r
+       public void setUrl(String url) {\r
+               this.url = url;\r
+       }\r
+\r
+       public String getAlternateUrl() {\r
+               return alternateUrl;\r
+       }\r
+\r
+       public void setAlternateUrl(String alternateUrl) {\r
+               this.alternateUrl = alternateUrl;\r
+       }\r
+\r
+       public Boolean getRestricted() {\r
+               return restricted;\r
+       }\r
+\r
+       public void setRestricted(Boolean restricted) {\r
+               this.restricted = restricted;\r
+       }\r
+\r
+       public Boolean getOpen() {\r
+               return open;\r
+       }\r
+\r
+       public void setOpen(Boolean open) {\r
+               this.open = open;\r
+       }\r
+\r
+       public Boolean getAccess() {\r
+               return access;\r
+       }\r
+\r
+       public void setAccess(Boolean access) {\r
+               this.access = access;\r
+       }\r
+\r
+       public Boolean getSelect() {\r
+               return select;\r
+       }\r
+\r
+       public void setSelect(Boolean select) {\r
+               this.select = select;\r
+       }\r
+\r
+       public Boolean getPending() {\r
+               return pending;\r
+       }\r
+\r
+       public void setPending(Boolean pending) {\r
+               this.pending = pending;\r
+       }\r
+\r
+       public static long getSerialversionuid() {\r
+               return serialVersionUID;\r
+       }\r
+\r
+       @Override\r
+       public String toString() {\r
+               return "AppCatalogItem [id=" + id + ", name=" + name + ", access=" + access + ", select=" + select\r
+                               + ", pending=" + pending + "]";\r
+       }\r
+\r
+       @Override\r
+       public int hashCode() {\r
+               final int prime = 31;\r
+               int result = 1;\r
+               result = prime * result + ((access == null) ? 0 : access.hashCode());\r
+               result = prime * result + ((alternateUrl == null) ? 0 : alternateUrl.hashCode());\r
+               result = prime * result + ((description == null) ? 0 : description.hashCode());\r
+               result = prime * result + ((id == null) ? 0 : id.hashCode());\r
+               result = prime * result + ((imageUrl == null) ? 0 : imageUrl.hashCode());\r
+               result = prime * result + ((name == null) ? 0 : name.hashCode());\r
+               result = prime * result + ((notes == null) ? 0 : notes.hashCode());\r
+               result = prime * result + ((open == null) ? 0 : open.hashCode());\r
+               result = prime * result + ((pending == null) ? 0 : pending.hashCode());\r
+               result = prime * result + ((restricted == null) ? 0 : restricted.hashCode());\r
+               result = prime * result + ((select == null) ? 0 : select.hashCode());\r
+               result = prime * result + ((url == null) ? 0 : url.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
+               AppCatalogItem other = (AppCatalogItem) obj;\r
+               if (access == null) {\r
+                       if (other.access != null)\r
+                               return false;\r
+               } else if (!access.equals(other.access))\r
+                       return false;\r
+               if (alternateUrl == null) {\r
+                       if (other.alternateUrl != null)\r
+                               return false;\r
+               } else if (!alternateUrl.equals(other.alternateUrl))\r
+                       return false;\r
+               if (description == null) {\r
+                       if (other.description != null)\r
+                               return false;\r
+               } else if (!description.equals(other.description))\r
+                       return false;\r
+               if (id == null) {\r
+                       if (other.id != null)\r
+                               return false;\r
+               } else if (!id.equals(other.id))\r
+                       return false;\r
+               if (imageUrl == null) {\r
+                       if (other.imageUrl != null)\r
+                               return false;\r
+               } else if (!imageUrl.equals(other.imageUrl))\r
+                       return false;\r
+               if (name == null) {\r
+                       if (other.name != null)\r
+                               return false;\r
+               } else if (!name.equals(other.name))\r
+                       return false;\r
+               if (notes == null) {\r
+                       if (other.notes != null)\r
+                               return false;\r
+               } else if (!notes.equals(other.notes))\r
+                       return false;\r
+               if (open == null) {\r
+                       if (other.open != null)\r
+                               return false;\r
+               } else if (!open.equals(other.open))\r
+                       return false;\r
+               if (pending == null) {\r
+                       if (other.pending != null)\r
+                               return false;\r
+               } else if (!pending.equals(other.pending))\r
+                       return false;\r
+               if (restricted == null) {\r
+                       if (other.restricted != null)\r
+                               return false;\r
+               } else if (!restricted.equals(other.restricted))\r
+                       return false;\r
+               if (select == null) {\r
+                       if (other.select != null)\r
+                               return false;\r
+               } else if (!select.equals(other.select))\r
+                       return false;\r
+               if (url == null) {\r
+                       if (other.url != null)\r
+                               return false;\r
+               } else if (!url.equals(other.url))\r
+                       return false;\r
+               return true;\r
+       }\r
+\r
+}\r