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.servlet.taglib.ui;
016    
017    import com.liferay.portal.kernel.util.StringPool;
018    
019    /**
020     * @author Sergio Gonz??lez
021     * @author Roberto D??az
022     */
023    public class ImageSelector {
024    
025            public ImageSelector() {
026                    this(
027                            null, StringPool.BLANK, StringPool.BLANK, StringPool.BLANK,
028                            StringPool.BLANK);
029            }
030    
031            public ImageSelector(
032                    byte[] imageBytes, String imageTitle, String imageMimeType,
033                    String imageCropRegion) {
034    
035                    this(
036                            imageBytes, imageTitle, imageMimeType, imageCropRegion,
037                            StringPool.BLANK);
038            }
039    
040            public ImageSelector(String imageURL) {
041                    this(
042                            null, StringPool.BLANK, StringPool.BLANK, StringPool.BLANK,
043                            imageURL);
044            }
045    
046            public byte[] getImageBytes() {
047                    return _imageBytes;
048            }
049    
050            public String getImageCropRegion() {
051                    return _imageCropRegion;
052            }
053    
054            public String getImageMimeType() {
055                    return _imageMimeType;
056            }
057    
058            public String getImageTitle() {
059                    return _imageTitle;
060            }
061    
062            public String getImageURL() {
063                    return _imageURL;
064            }
065    
066            private ImageSelector(
067                    byte[] imageBytes, String imageTitle, String imageMimeType,
068                    String imageCropRegion, String imageURL) {
069    
070                    _imageBytes = imageBytes;
071                    _imageTitle = imageTitle;
072                    _imageMimeType = imageMimeType;
073                    _imageCropRegion = imageCropRegion;
074                    _imageURL = imageURL;
075            }
076    
077            private final byte[] _imageBytes;
078            private final String _imageCropRegion;
079            private final String _imageMimeType;
080            private final String _imageTitle;
081            private final String _imageURL;
082    
083    }