View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements. See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache license, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License. You may obtain a copy of the License at
8    *
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the license for the specific language governing permissions and
15   * limitations under the license.
16   */
17  package org.apache.logging.log4j.catalog.api;
18  
19  import java.io.Serializable;
20  import java.util.List;
21  
22  import static org.apache.logging.log4j.catalog.api.constant.Constants.DEFAULT_CATALOG;
23  
24  
25  /**
26   * Definition of a Product.
27   */
28  public class Product implements Serializable {
29  
30      private static final long serialVersionUID = -736368842796386523L;
31      private Long id;
32      private String name;
33      private String displayName;
34      private String description;
35      private String catalogId;
36      private List<String> events;
37  
38      /**
39       * Set default values.
40       */
41      public Product() {
42          catalogId = DEFAULT_CATALOG;
43      }
44      
45      /**
46       * Return the id of the Product.
47       * @return the Product's id.
48       */
49      public Long getId() {
50          return id;
51      }
52  
53      /**
54       * Set the id of the Product.
55       * @param id the Product's id.
56       */
57      public void setId(Long id) {
58          this.id = id;
59      }
60  
61      /**
62       * Returns the name of the product.
63       * @return the name of the product.
64       */
65      public String getName() {
66          return name;
67      }
68  
69      /**
70       * Set the name of the product.
71       * @param name the name of the product.
72       * @return this Product.
73       */
74      public Product setName(String name) {
75          this.name = name;
76          return this;
77      }
78  
79      /**
80       * Returns the name used when displaying the product.
81       * @return the display name of the product.
82       */
83      public String getDisplayName() {
84          return displayName;
85      }
86  
87      /**
88       * Set the name to be displayed for this product.
89       * @param name the display name for the product.
90       * @return this Product.
91       */
92      public Product setDisplayName(String name) {
93          this.displayName = name;
94          return this;
95      }
96  
97      /**
98       * Return the product description.
99       * @return the description of the product.
100      */
101     public String getDescription() {
102         return description;
103     }
104 
105     /**
106      * Set the description of the product.
107      * @param description the description of the product.
108      * @return this Product.
109      */
110     public Product setDescription(String description) {
111         this.description = description;
112         return this;
113     }
114 
115     /**
116      * Get the Catalog Id this Product is associated with.
117      * @return the catalog id or null.
118      */
119     public String getCatalogId() {
120         return catalogId;
121     }
122 
123     /**
124      * Set the catalog id this Product is associated with.
125      * @param catalogId The catalog id or null.
126      */
127     public void setCatalogId(String catalogId) {
128         this.catalogId = catalogId;
129     }
130 
131     /**
132      * Returns the List of Event names associated with this product.
133      * @return the List of Events.
134      */
135     public List<String> getEvents() {
136         return events;
137     }
138 
139     /**
140      * Sets the List of Event names for this product.
141      * @param events the List of Events.
142      * @return this Product.
143      */
144     public Product setEvents(List<String> events) {
145         this.events = events;
146         return this;
147     }
148 
149 }