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 com.liferay.portal.kernel.util.StringBundler;
018    
019    /**
020     * Abstract class containing common methods for all devices
021     *
022     * @author Milen Dyankov
023     * @author Michael C. Han
024     */
025    public abstract class AbstractDevice implements Device {
026    
027            /**
028             * @deprecated As of 6.2.0, replaced by {@link #getScreenResolution()}
029             */
030            @Deprecated
031            @Override
032            public Dimensions getScreenSize() {
033                    return getScreenResolution();
034            }
035    
036            @Override
037            public String toString() {
038                    StringBundler sb = new StringBundler(25);
039    
040                    sb.append("{brand=");
041                    sb.append(getBrand());
042                    sb.append(", browser=");
043                    sb.append(getBrowser());
044                    sb.append(", browserVersion=");
045                    sb.append(getBrowserVersion());
046                    sb.append(", capabilities=");
047                    sb.append(getCapabilities());
048                    sb.append(", model=");
049                    sb.append(getModel());
050                    sb.append(", os=");
051                    sb.append(getOS());
052                    sb.append(", osVersion=");
053                    sb.append(getOSVersion());
054                    sb.append(", pointingMethod=");
055                    sb.append(getPointingMethod());
056                    sb.append(", qwertyKeyboard=");
057                    sb.append(hasQwertyKeyboard());
058                    sb.append(", screenPhysicalSize=");
059                    sb.append(getScreenPhysicalSize());
060                    sb.append(", screenResolution=");
061                    sb.append(getScreenResolution());
062                    sb.append(", tablet=");
063                    sb.append(isTablet());
064                    sb.append("}");
065    
066                    return sb.toString();
067            }
068    
069    }