1 /* 2 * Copyright (c) 2002-2016, Mairie de Paris 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 9 * 1. Redistributions of source code must retain the above copyright notice 10 * and the following disclaimer. 11 * 12 * 2. Redistributions in binary form must reproduce the above copyright notice 13 * and the following disclaimer in the documentation and/or other materials 14 * provided with the distribution. 15 * 16 * 3. Neither the name of 'Mairie de Paris' nor 'Lutece' nor the names of its 17 * contributors may be used to endorse or promote products derived from 18 * this software without specific prior written permission. 19 * 20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 24 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30 * POSSIBILITY OF SUCH DAMAGE. 31 * 32 * License 1.0 33 */ 34 package fr.paris.lutece.plugins.avatarserver.business; 35 36 import org.hibernate.validator.constraints.Email; 37 import org.hibernate.validator.constraints.NotEmpty; 38 39 import javax.validation.constraints.Size; 40 41 /** 42 * This is the business class for the object Avatar 43 */ 44 public class Avatar 45 { 46 // Variables declarations 47 private byte [ ] _byValue; 48 private String _strMimeType; 49 private String _strHash; 50 private int _nIdAvatar; 51 52 // @NotEmpty( message = "#i18n{avatarserver.validation.avatar.Email.notEmpty}" ) 53 @NotEmpty( message = "#i18n{portal.validation.message.notEmpty}" ) 54 // @Size( max = 255 , message = "#i18n{avatarserver.validation.avatar.Email.size}" ) 55 @Size( max = 255, message = "#i18n{portal.validation.message.sizeMax}" ) 56 @Email( message = "#i18n{portal.validation.message.email}" ) 57 private String _strEmail; 58 59 /** 60 * Returns the IdAvatar 61 * 62 * @return The IdAvatar 63 */ 64 public int getId( ) 65 { 66 return _nIdAvatar; 67 } 68 69 /** 70 * Sets the IdAvatar 71 * 72 * @param nIdAvatar 73 * The IdAvatar 74 */ 75 public void setId( int nIdAvatar ) 76 { 77 _nIdAvatar = nIdAvatar; 78 } 79 80 /** 81 * Returns the Email 82 * 83 * @return The Email 84 */ 85 public String getEmail( ) 86 { 87 return _strEmail; 88 } 89 90 /** 91 * Sets the Email 92 * 93 * @param strEmail 94 * The Email 95 */ 96 public void setEmail( String strEmail ) 97 { 98 _strEmail = strEmail; 99 } 100 101 /** 102 * get the icon file value 103 * 104 * @return the icon file value 105 */ 106 public byte [ ] getValue( ) 107 { 108 return _byValue; 109 } 110 111 /** 112 * set the icon file value 113 * 114 * @param value 115 * the file value 116 */ 117 public void setValue( byte [ ] value ) 118 { 119 _byValue = value; 120 } 121 122 /** 123 * the icon mime type 124 * 125 * @return the icon mime type 126 */ 127 public String getMimeType( ) 128 { 129 return _strMimeType; 130 } 131 132 /** 133 * set the icon mime type 134 * 135 * @param mimeType 136 * the icon mime type 137 */ 138 public void setMimeType( String mimeType ) 139 { 140 _strMimeType = mimeType; 141 } 142 143 /** 144 * the hash 145 * 146 * @return the hash 147 */ 148 public String getHash( ) 149 { 150 return _strHash; 151 } 152 153 /** 154 * set the hash 155 * 156 * @param hash 157 * the hash 158 */ 159 public void setHash( String hash ) 160 { 161 _strHash = hash; 162 } 163 }