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