1 /* 2 * Copyright (c) 2002-2018, Mairie de Paris 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 9 * 1. Redistributions of source code must retain the above copyright notice 10 * and the following disclaimer. 11 * 12 * 2. Redistributions in binary form must reproduce the above copyright notice 13 * and the following disclaimer in the documentation and/or other materials 14 * provided with the distribution. 15 * 16 * 3. Neither the name of 'Mairie de Paris' nor 'Lutece' nor the names of its 17 * contributors may be used to endorse or promote products derived from 18 * this software without specific prior written permission. 19 * 20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 24 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30 * POSSIBILITY OF SUCH DAMAGE. 31 * 32 * License 1.0 33 */ 34 package fr.paris.lutece.plugins.forms.modules.breadcrumbaccordion.business; 35 36 import java.util.ArrayList; 37 import java.util.List; 38 39 /** 40 * This class represents a configuration for a breadcrumb accordion 41 * 42 */ 43 public class BreadcrumbAccordionConfig 44 { 45 46 private int _nIdForm; 47 private String _strFormTitle; 48 private final List<BreadcrumbAccordionConfigItem> _listBreadcrumbAccordionConfigItem; 49 50 /** 51 * Constructor 52 * 53 * @param nIdForm 54 * the id form 55 * @param listBreadcrumbAccordionConfigItem 56 * the list of breadcrumb accordion config items 57 */ 58 public BreadcrumbAccordionConfig( int nIdForm, List<BreadcrumbAccordionConfigItem> listBreadcrumbAccordionConfigItem ) 59 { 60 _nIdForm = nIdForm; 61 _listBreadcrumbAccordionConfigItem = listBreadcrumbAccordionConfigItem; 62 } 63 64 /** 65 * Constructor 66 */ 67 public BreadcrumbAccordionConfig( ) 68 { 69 _nIdForm = 0; 70 _listBreadcrumbAccordionConfigItem = new ArrayList<>( ); 71 } 72 73 /** 74 * Gives the id form 75 * 76 * @return the id form 77 */ 78 public int getIdForm( ) 79 { 80 return _nIdForm; 81 } 82 83 /** 84 * Sets the id form 85 * 86 * @param nIdForm 87 * the id form to set 88 */ 89 public void setIdForm( int nIdForm ) 90 { 91 _nIdForm = nIdForm; 92 } 93 94 /** 95 * Gives the list of breadcrumb accordion config items 96 * 97 * @return the list of breadcrumb accordion config items 98 */ 99 public List<BreadcrumbAccordionConfigItem> getItems( ) 100 { 101 return _listBreadcrumbAccordionConfigItem; 102 } 103 104 /** 105 * Adds a breadcrumb accordion config item 106 * 107 * @param breadcrumbAccordionConfigItem 108 * the breadcrumb accordion config item to add 109 */ 110 public void add( BreadcrumbAccordionConfigItem breadcrumbAccordionConfigItem ) 111 { 112 _listBreadcrumbAccordionConfigItem.add( breadcrumbAccordionConfigItem ); 113 } 114 115 /** 116 * Gives the form title 117 * 118 * @return the form title 119 */ 120 public String getFormTitle( ) 121 { 122 return _strFormTitle; 123 } 124 125 /** 126 * Sets the form title 127 * 128 * @param strFormTitle 129 * the form title to set 130 */ 131 public void setFormTitle( String strFormTitle ) 132 { 133 _strFormTitle = strFormTitle; 134 } 135 136 }