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 * A Catalog Category. 26 */ 27 public class Category implements Serializable { 28 29 private static final long serialVersionUID = 5776108323599073407L; 30 private Long id; 31 private String name; 32 private String displayName; 33 private String description; 34 private String catalogId; 35 private List<String> events; 36 37 /** 38 * Set default values; 39 */ 40 public Category() { 41 catalogId = DEFAULT_CATALOG; 42 } 43 44 /** 45 * Return the id of the Category. 46 * @return the Category's id. 47 */ 48 public Long getId() { 49 return id; 50 } 51 52 /** 53 * Set the id of the Category. 54 * @param id the id of the Category. 55 */ 56 public void setId(Long id) { 57 this.id = id; 58 } 59 60 /** 61 * Gets the value of the name property. 62 * 63 * @return possible object is 64 * {@link String } 65 */ 66 public String getName() { 67 return name; 68 } 69 70 /** 71 * Sets the value of the name property. 72 * 73 * @param value allowed object is 74 * {@link String } 75 * @return this Category. 76 */ 77 public Category setName(String value) { 78 this.name = value; 79 return this; 80 } 81 82 /** 83 * Returns the name used when displaying the category. 84 * @return the display name of the category. 85 */ 86 public String getDisplayName() { 87 return displayName; 88 } 89 90 /** 91 * Set the name to be displayed for this category. 92 * @param name the display name for the category. 93 * @return this Category. 94 */ 95 public Category setDisplayName(String name) { 96 this.displayName = name; 97 return this; 98 } 99 100 /** 101 * Gets the value of the description property. 102 * 103 * @return possible object is 104 * {@link String } 105 */ 106 public String getDescription() { 107 return description; 108 } 109 110 /** 111 * Sets the value of the description property. 112 * 113 * @param value The description of the category. 114 * @return this Category. 115 */ 116 public Category setDescription(String value) { 117 this.description = value; 118 return this; 119 } 120 121 /** 122 * Get the Catalog Id this Category is associated with. 123 * @return the catalog id or null. 124 */ 125 public String getCatalogId() { 126 return catalogId; 127 } 128 129 /** 130 * Set the catalog id this Category is associated with. 131 * @param catalogId The catalog id or null. 132 */ 133 public void setCatalogId(String catalogId) { 134 this.catalogId = catalogId; 135 } 136 137 /** 138 * Return the List of Event names. 139 * @return the List of Event names or null. 140 */ 141 public List<String> getEvents() { 142 return events; 143 } 144 145 /** 146 * Sets the List of Event names. 147 * @param events the List of Events. 148 */ 149 public Category setEvents(List<String> events) { 150 this.events = events; 151 return this; 152 } 153 }