Style.java

  1. /*
  2.  * Copyright (c) 2002-2022, City of 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.portal.business.style;

  35. /**
  36.  * This class represents style business objects
  37.  */
  38. public class Style
  39. {
  40.     private static final String EMPTY_STRING = "";
  41.     private int _nId;
  42.     private int _nPortalComponentId;
  43.     private String _strPortletTypeId;
  44.     private String _strDescription;
  45.     private String _strPortletTypeName;
  46.     private String _strPortalComponentName;

  47.     /**
  48.      * Returns the identifier of this style
  49.      *
  50.      * @return the identifier of the style
  51.      */
  52.     public int getId( )
  53.     {
  54.         return _nId;
  55.     }

  56.     /**
  57.      * Sets the identifier of this style with the int value specified in parameter
  58.      *
  59.      * @param nId
  60.      *            the new identifier
  61.      */
  62.     public void setId( int nId )
  63.     {
  64.         _nId = nId;
  65.     }

  66.     /**
  67.      * Returns the identifier of the portlet type of this style
  68.      *
  69.      * @return the identifier of the portlet type style
  70.      */
  71.     public String getPortletTypeId( )
  72.     {
  73.         return _strPortletTypeId;
  74.     }

  75.     /**
  76.      * Sets the identifier of the portlet type of this style with the int value specified in parameter
  77.      *
  78.      * @param strPortletTypeId
  79.      *            the identifier of portlet type of the style
  80.      */
  81.     public void setPortletTypeId( String strPortletTypeId )
  82.     {
  83.         _strPortletTypeId = strPortletTypeId;
  84.     }

  85.     /**
  86.      * Returns the identifier of the portal component of this style
  87.      *
  88.      * @return the identifier of the portal component's style
  89.      */
  90.     public int getPortalComponentId( )
  91.     {
  92.         return _nPortalComponentId;
  93.     }

  94.     /**
  95.      * Sets the identifier of the portal component of this style with the int value specified in parameter
  96.      *
  97.      * @param nPortalComponentId
  98.      *            the identifier of portal component of the style
  99.      */
  100.     public void setPortalComponentId( int nPortalComponentId )
  101.     {
  102.         _nPortalComponentId = nPortalComponentId;
  103.     }

  104.     /**
  105.      * Returns the description of this style
  106.      *
  107.      * @return the description of this style
  108.      */
  109.     public String getDescription( )
  110.     {
  111.         return _strDescription;
  112.     }

  113.     /**
  114.      * Sets the description of this style with the String value specified in parameter or "" otherwise
  115.      *
  116.      * @param strDescription
  117.      *            the identifier of portlet type of the style
  118.      */
  119.     public void setDescription( String strDescription )
  120.     {
  121.         _strDescription = ( strDescription == null ) ? EMPTY_STRING : strDescription;
  122.     }

  123.     /**
  124.      * Returns the portlet type name of this style
  125.      *
  126.      * @return the portlet type name of this style
  127.      */
  128.     public String getPortletTypeName( )
  129.     {
  130.         return _strPortletTypeName;
  131.     }

  132.     /**
  133.      * Sets the portlet type name of this style with the String value specified in parameter
  134.      *
  135.      * @param strPortletTypeName
  136.      *            the new portlet type name
  137.      */
  138.     public void setPortletTypeName( String strPortletTypeName )
  139.     {
  140.         _strPortletTypeName = ( strPortletTypeName == null ) ? EMPTY_STRING : strPortletTypeName;
  141.     }

  142.     /**
  143.      * Returns the portal component name of this style
  144.      *
  145.      * @return the portal component name of this style
  146.      */
  147.     public String getPortalComponentName( )
  148.     {
  149.         return _strPortalComponentName;
  150.     }

  151.     /**
  152.      * Sets the portlet type name of this style with the String value specified in parameter
  153.      *
  154.      * @param strPortalComponentName
  155.      *            the new portlet type name
  156.      */
  157.     public void setPortalComponentName( String strPortalComponentName )
  158.     {
  159.         _strPortalComponentName = ( strPortalComponentName == null ) ? EMPTY_STRING : strPortalComponentName;
  160.     }
  161. }