1 /*
2  * This file is part of libbluray
3  * Copyright (C) 2010  William Hahne
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library. If not, see
17  * <http://www.gnu.org/licenses/>.
18  */
19 
20 package org.dvb.user;
21 
22 public final class GeneralPreference extends Preference {
GeneralPreference(String name)23     public GeneralPreference(String name) throws IllegalArgumentException {
24         super(name, (String)null);
25         if (!isGeneralPreference(name))
26             throw new IllegalArgumentException();
27     }
28 
isGeneralPreference(String name)29     protected static boolean isGeneralPreference(String name) {
30         for (int i = 0; i < GENERAL_PREFERENCES.length; i++)
31             if (name.equals(GENERAL_PREFERENCES[i]))
32                 return true;
33         return false;
34     }
35 
36     private static final String[] GENERAL_PREFERENCES = {
37         // DVB GEM
38         "User Language", "Parental Rating", "User Name", "User Address", "User @", "Country Code", "Default Font Size",
39         // BD-ROM
40         "User Language Audio", "User Language Subtitles" };
41 }
42