public class Category extends Object implements Serializable
| Constructor and Description |
|---|
Category() |
Category(String name)
Creates a new instance of Category with a given name.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addSubcategory(Subcategory subcategory) |
Object |
clone()
Returns a copy of this category.
|
String |
getName()
Returns the name of the category
|
List<Subcategory> |
getSubcategories()
Returns the list of subcategories under this category
|
Subcategory |
getSubcategory()
Returns the Subcategory object for this category
|
void |
setName(String name)
Sets the name of the category
|
void |
setSubcategories(List<Subcategory> subcategories) |
void |
setSubcategory(Subcategory subcategory)
Sets the Subcategory object for this category
|
String |
toString() |
public Category()
public Category(String name)
name - Name of the category.public String getName()
public void setName(String name)
name - Sets the name of the categorypublic Subcategory getSubcategory()
public List<Subcategory> getSubcategories()
public void setSubcategory(Subcategory subcategory)
subcategory - Sets the Subcategory object for this categorypublic void setSubcategories(List<Subcategory> subcategories)
public void addSubcategory(Subcategory subcategory)
public Object clone()
Copyright © 2021. All rights reserved.