001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.kernel.mobile.device;
016    
017    import java.util.Collections;
018    import java.util.HashSet;
019    import java.util.Map;
020    import java.util.Set;
021    
022    /**
023     * Class represents unknown device
024     *
025     * @author Milen Dyankov
026     * @author Michael C. Han
027     */
028    public class NoKnownDevices implements KnownDevices {
029    
030            public static NoKnownDevices getInstance() {
031                    return _instance;
032            }
033    
034            public Set<VersionableName> getBrands() {
035                    return _brands;
036            }
037    
038            public Set<VersionableName> getBrowsers() {
039                    return _browsers;
040            }
041    
042            public Map<Capability, Set<String>> getDeviceIds() {
043                    return Collections.emptyMap();
044            }
045    
046            public Set<VersionableName> getOperatingSystems() {
047                    return _operatingSystems;
048            }
049    
050            public Set<String> getPointingMethods() {
051                    return _pointingMethods;
052            }
053    
054            public void reload() {
055            }
056    
057            private NoKnownDevices() {
058                    _brands.add(VersionableName.UNKNOWN);
059    
060                    _brands = Collections.unmodifiableSet(_brands);
061    
062                    _browsers.add(VersionableName.UNKNOWN);
063    
064                    _browsers = Collections.unmodifiableSet(_browsers);
065    
066                    _operatingSystems.add(VersionableName.UNKNOWN);
067    
068                    _operatingSystems = Collections.unmodifiableSet(_operatingSystems);
069    
070                    _pointingMethods.add(VersionableName.UNKNOWN.getName());
071    
072                    _pointingMethods = Collections.unmodifiableSet(_pointingMethods);
073            }
074    
075            private static NoKnownDevices _instance = new NoKnownDevices();
076    
077            private Set<VersionableName> _brands = new HashSet<VersionableName>();
078            private Set<VersionableName> _browsers = new HashSet<VersionableName>();
079            private Set<VersionableName> _operatingSystems =
080                    new HashSet<VersionableName>();
081            private Set<String> _pointingMethods = new HashSet<String>();
082    
083    }