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