001    /**
002     * Copyright (c) 2000-present 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.Map;
019    import java.util.Set;
020    
021    /**
022     * Class represents unknown device
023     *
024     * @author Milen Dyankov
025     * @author Michael C. Han
026     */
027    public class NoKnownDevices implements KnownDevices {
028    
029            public static NoKnownDevices getInstance() {
030                    return _instance;
031            }
032    
033            @Override
034            public Set<VersionableName> getBrands() {
035                    return _unknownVersionableNames;
036            }
037    
038            @Override
039            public Set<VersionableName> getBrowsers() {
040                    return _unknownVersionableNames;
041            }
042    
043            @Override
044            public Map<Capability, Set<String>> getDeviceIds() {
045                    return Collections.emptyMap();
046            }
047    
048            @Override
049            public Set<VersionableName> getOperatingSystems() {
050                    return _unknownVersionableNames;
051            }
052    
053            @Override
054            public Set<String> getPointingMethods() {
055                    return _pointingMethods;
056            }
057    
058            @Override
059            public void reload() {
060            }
061    
062            private NoKnownDevices() {
063            }
064    
065            private static final NoKnownDevices _instance = new NoKnownDevices();
066    
067            private final Set<String> _pointingMethods = Collections.singleton(
068                    VersionableName.UNKNOWN.getName());
069            private final Set<VersionableName> _unknownVersionableNames =
070                    Collections.singleton(VersionableName.UNKNOWN);
071    
072    }