001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
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            @Override
035            public Set<VersionableName> getBrands() {
036                    return _brands;
037            }
038    
039            @Override
040            public Set<VersionableName> getBrowsers() {
041                    return _browsers;
042            }
043    
044            @Override
045            public Map<Capability, Set<String>> getDeviceIds() {
046                    return Collections.emptyMap();
047            }
048    
049            @Override
050            public Set<VersionableName> getOperatingSystems() {
051                    return _operatingSystems;
052            }
053    
054            @Override
055            public Set<String> getPointingMethods() {
056                    return _pointingMethods;
057            }
058    
059            @Override
060            public void reload() {
061            }
062    
063            private NoKnownDevices() {
064                    _brands.add(VersionableName.UNKNOWN);
065    
066                    _brands = Collections.unmodifiableSet(_brands);
067    
068                    _browsers.add(VersionableName.UNKNOWN);
069    
070                    _browsers = Collections.unmodifiableSet(_browsers);
071    
072                    _operatingSystems.add(VersionableName.UNKNOWN);
073    
074                    _operatingSystems = Collections.unmodifiableSet(_operatingSystems);
075    
076                    _pointingMethods.add(VersionableName.UNKNOWN.getName());
077    
078                    _pointingMethods = Collections.unmodifiableSet(_pointingMethods);
079            }
080    
081            private static NoKnownDevices _instance = new NoKnownDevices();
082    
083            private Set<VersionableName> _brands = new HashSet<VersionableName>();
084            private Set<VersionableName> _browsers = new HashSet<VersionableName>();
085            private Set<VersionableName> _operatingSystems =
086                    new HashSet<VersionableName>();
087            private Set<String> _pointingMethods = new HashSet<String>();
088    
089    }