1. Project Clover database mar. janv. 20 2026 12:32:22 CET
  2. Package org.devacfr.maven.skins.reflow.model

File SideNavMenuItem.java

 

Coverage histogram

../../../../../../img/srcFileCovDistChart6.png
71% of files have more coverage

Code metrics

2
22
15
1
181
68
16
0,73
1,47
15
1,07

Classes

Class Line # Actions
SideNavMenuItem 27 22 0% 16 19
0.5128205451,3%
 

Contributing tests

This file is covered by 12 tests. .

Source view

1    /*
2    * Copyright 2012-2025 Christophe Friederich
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.apache.org/licenses/LICENSE-2.0
9    *
10    * Unless required by applicable law or agreed to in writing, software
11    * distributed under the License is distributed on an "AS IS" BASIS,
12    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13    * See the License for the specific language governing permissions and
14    * limitations under the License.
15    */
16    package org.devacfr.maven.skins.reflow.model;
17   
18    import java.util.Collections;
19    import java.util.List;
20    import javax.annotation.Nonnull;
21    import org.apache.commons.lang3.builder.ToStringBuilder;
22   
23    /**
24    * @author Christophe Friederich
25    * @since 2.0
26    */
 
27    public class SideNavMenuItem {
28   
29    /** */
30    private String name;
31   
32    /** */
33    private String href;
34   
35    /** */
36    private String icon;
37   
38    /** */
39    private String slugName;
40   
41    /** */
42    private List<SideNavMenuItem> items;
43   
44    /** */
45    private String parent;
46   
47    /**
48    * Default constructor.
49    */
 
50  36 toggle public SideNavMenuItem() {
51    }
52   
53    /**
54    * @return Returns the name of item menu.
55    */
 
56  0 toggle public String getName() {
57  0 return name;
58    }
59   
60    /**
61    * @param name
62    * the name of item menu
63    * @return Returns the fluent instance.
64    */
 
65  36 toggle public SideNavMenuItem withName(final String name) {
66  36 this.name = name;
67  36 return this;
68    }
69   
70    /**
71    * @return Returns the name of parent page.
72    */
 
73  1 toggle public String getParent() {
74  1 return parent;
75    }
76   
77    /***
78    * @param parent
79    * the name of parent page
80    * @return Returns the fluent instance.
81    */
 
82  36 toggle public SideNavMenuItem withParent(final String parent) {
83  36 this.parent = parent;
84  36 return this;
85    }
86   
87    /**
88    * @return Returns the link associated to this item menu.
89    */
 
90  0 toggle public String getHref() {
91  0 return href;
92    }
93   
94    /**
95    * @param href
96    * the link to use.
97    * @return Returns the fluent instance.
98    */
 
99  36 toggle public SideNavMenuItem withHref(final String href) {
100  36 this.href = href;
101  36 return this;
102    }
103   
104    /**
105    * @return Returns the {@link String} representing the slugged link associate to this menu item.
106    */
 
107  37 toggle public String getSlugName() {
108  37 return slugName;
109    }
110   
111    /**
112    * @param slugName
113    * the slugged name.
114    * @return Returns the fluent instance.
115    */
 
116  36 toggle public SideNavMenuItem withSlugName(final String slugName) {
117  36 this.slugName = slugName;
118  36 return this;
119    }
120   
121    /**
122    * @return Returns the icon to use.
123    */
 
124  0 toggle public String getIcon() {
125  0 return icon;
126    }
127   
128    /**
129    * Sets the icon associate to.
130    *
131    * @param icon
132    * the icon to use.
133    * @return Returns the fluent instance.
134    */
 
135  36 toggle public SideNavMenuItem withIcon(final String icon) {
136  36 this.icon = icon;
137  36 return this;
138    }
139   
140    /**
141    * Gets the indicating whether has items.
142    *
143    * @return Returns {@code true} if has items, otherwise {@code false}.
144    */
 
145  0 toggle public boolean isHasItems() {
146  0 return items != null && !items.isEmpty();
147    }
148   
149    /**
150    * Gets the list of items.
151    *
152    * @return Returns a {@link List} representing the items.
153    */
 
154  0 toggle @Nonnull
155    public List<SideNavMenuItem> getItems() {
156  0 if (items == null) {
157  0 return Collections.emptyList();
158    }
159  0 return items;
160    }
161   
162    /**
163    * Sets the items associate.
164    *
165    * @param items
166    * the list of items.
167    * @return Returns the fluent instance.
168    */
 
169  0 toggle public SideNavMenuItem withItems(final List<SideNavMenuItem> items) {
170  0 this.items = items;
171  0 return this;
172    }
173   
174    /**
175    * {@inheritDoc}
176    */
 
177  0 toggle @Override
178    public String toString() {
179  0 return ToStringBuilder.reflectionToString(this);
180    }
181    }