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 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            @Override
031            public Dimensions getScreenSize() {
032                    return getScreenResolution();
033            }
034    
035            @Override
036            public String toString() {
037                    StringBundler sb = new StringBundler(23);
038    
039                    sb.append("{brand=");
040                    sb.append(getBrand());
041                    sb.append(", browser=");
042                    sb.append(getBrowser());
043                    sb.append(", browserVersion=");
044                    sb.append(getBrowserVersion());
045                    sb.append(", capabilities=");
046                    sb.append(getCapabilities());
047                    sb.append(", model=");
048                    sb.append(getModel());
049                    sb.append(", os=");
050                    sb.append(getOS());
051                    sb.append(", osVersion=");
052                    sb.append(getOSVersion());
053                    sb.append(", pointingMethod=");
054                    sb.append(getPointingMethod());
055                    sb.append(", qwertyKeyboard=");
056                    sb.append(hasQwertyKeyboard());
057                    sb.append(", screenPhysicalSize=");
058                    sb.append(getScreenPhysicalSize());
059                    sb.append(", screenResolution=");
060                    sb.append(getScreenResolution());
061                    sb.append(", tablet=");
062                    sb.append(isTablet());
063                    sb.append("}");
064    
065                    return sb.toString();
066            }
067    
068    }