001    /**
002     * Copyright (c) 2000-2013 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            @Override
028            public String toString() {
029                    StringBundler sb = new StringBundler(23);
030    
031                    sb.append("{brand=");
032                    sb.append(getBrand());
033                    sb.append(", browser=");
034                    sb.append(getBrowser());
035                    sb.append(", browserVersion=");
036                    sb.append(getBrowserVersion());
037                    sb.append(", capabilities=");
038                    sb.append(getCapabilities());
039                    sb.append(", model=");
040                    sb.append(getModel());
041                    sb.append(", os=");
042                    sb.append(getOS());
043                    sb.append(", osVersion=");
044                    sb.append(getOSVersion());
045                    sb.append(", pointingMethod=");
046                    sb.append(getPointingMethod());
047                    sb.append(", qwertyKeyboard=");
048                    sb.append(hasQwertyKeyboard());
049                    sb.append(", screenSize=");
050                    sb.append(getScreenSize());
051                    sb.append(", tablet=");
052                    sb.append(isTablet());
053                    sb.append("}");
054    
055                    return sb.toString();
056            }
057    
058    }