View Javadoc
1   /*******************************************************************************
2    *   Gisgraphy Project 
3    * 
4    *   This library is free software; you can redistribute it and/or
5    *   modify it under the terms of the GNU Lesser General Public
6    *   License as published by the Free Software Foundation; either
7    *   version 2.1 of the License, or (at your option) any later version.
8    * 
9    *   This library is distributed in the hope that it will be useful,
10   *   but WITHOUT ANY WARRANTY; without even the implied warranty of
11   *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12   *   Lesser General Public License for more details.
13   * 
14   *   You should have received a copy of the GNU Lesser General Public
15   *   License along with this library; if not, write to the Free Software
16   *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
17   * 
18   *  Copyright 2008  Gisgraphy project 
19   *  David Masclet <davidmasclet@gisgraphy.com>
20   *  
21   *  
22   *******************************************************************************/
23  /**
24   *
25   */
26  package com.gisgraphy.domain.repository;
27  
28  import com.gisgraphy.domain.geoloc.entity.Language;
29  
30  /**
31   * Interface of data access object for {@link Language}
32   * 
33   * @author <a href="mailto:david.masclet@gisgraphy.com">David Masclet</a>
34   */
35  public interface ILanguageDao extends IDao<Language, Long> {
36      /**
37       * Find by ISO 639 Alpha 2 (2-letter) code
38       * 
39       * @param iso639Alpha2Code
40       *                The ISO 639 Alpha 2 (2-letter) code
41       * @return The language or null if not found
42       */
43      public Language getByIso639Alpha2Code(String iso639Alpha2Code);
44  
45      /**
46       * Find by ISO 639 Alpha 3 (3-letter) code
47       * 
48       * @param iso639Alpha3Code
49       *                ISO 639 Alpha 3 (3-letter) code
50       * @return The Language or null if not found
51       */
52      public Language getByIso639Alpha3Code(String iso639Alpha3Code);
53  
54      /**
55       * @param iso639LanguageCode
56       *                The alpha-2 or 3 language code
57       * @return the language according the length of the specified
58       *         iso639LanguageCode
59       * @throws an
60       *                 illegalArgumentException if the code is null or the
61       *                 length is not 2 or three
62       */
63      public Language getByIso639Code(String iso639LanguageCode);
64  
65  }