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    
022    /**
023     * Class represents unknown device
024     *
025     * @author Milen Dyankov
026     */
027    @ProviderType
028    public class UnknownDevice extends AbstractDevice {
029    
030            public static UnknownDevice getInstance() {
031                    return _instance;
032            }
033    
034            @Override
035            public String getBrand() {
036                    return VersionableName.UNKNOWN.getName();
037            }
038    
039            @Override
040            public String getBrowser() {
041                    return VersionableName.UNKNOWN.getName();
042            }
043    
044            @Override
045            public String getBrowserVersion() {
046                    return VersionableName.UNKNOWN.getName();
047            }
048    
049            /**
050             * @deprecated As of 7.0.0, with no direct replacement
051             */
052            @Deprecated
053            @Override
054            public Map<String, Capability> getCapabilities() {
055                    return Collections.emptyMap();
056            }
057    
058            /**
059             * @deprecated As of 7.0.0, with no direct replacement
060             */
061            @Deprecated
062            @Override
063            public String getCapability(String name) {
064                    return null;
065            }
066    
067            @Override
068            public String getModel() {
069                    return VersionableName.UNKNOWN.getName();
070            }
071    
072            @Override
073            public String getOS() {
074                    return VersionableName.UNKNOWN.getName();
075            }
076    
077            @Override
078            public String getOSVersion() {
079                    return VersionableName.UNKNOWN.getName();
080            }
081    
082            @Override
083            public String getPointingMethod() {
084                    return VersionableName.UNKNOWN.getName();
085            }
086    
087            @Override
088            public Dimensions getScreenPhysicalSize() {
089                    return Dimensions.UNKNOWN;
090            }
091    
092            @Override
093            public Dimensions getScreenResolution() {
094                    return Dimensions.UNKNOWN;
095            }
096    
097            @Override
098            public boolean hasQwertyKeyboard() {
099                    return true;
100            }
101    
102            @Override
103            public boolean isTablet() {
104                    return false;
105            }
106    
107            private UnknownDevice() {
108            }
109    
110            private static final UnknownDevice _instance = new UnknownDevice();
111    
112    }