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    import java.io.Serializable;
022    
023    /**
024     * @author Michael C. Han
025     */
026    @ProviderType
027    public class Dimensions implements Serializable {
028    
029            public static final Dimensions UNKNOWN = new Dimensions(-1, -1);
030    
031            public Dimensions(float height, float width) {
032                    _height = height;
033                    _width = width;
034            }
035    
036            public float getHeight() {
037                    return _height;
038            }
039    
040            public float getWidth() {
041                    return _width;
042            }
043    
044            @Override
045            public String toString() {
046                    StringBundler sb = new StringBundler(5);
047    
048                    sb.append("{height=");
049                    sb.append(_height);
050                    sb.append(", width=");
051                    sb.append(_width);
052                    sb.append("}");
053    
054                    return sb.toString();
055            }
056    
057            private final float _height;
058            private final float _width;
059    
060    }