Package com.iizix.urn.user
Interface IUserProfileImageRequest
- All Superinterfaces:
- Cloneable
- All Known Implementing Classes:
- UserProfileImageRequest
The request class for a User Profile Image.
The implementing class is NOT thread-safe when building the request, but is once the profile image is being retrieved. This is done by design to keep garbage collection down.
- Author:
- Christopher Mindus
- Method SummaryModifier and TypeMethodDescription- appSessionGyro- (IAppSessionGyro appGyro) Assigns the App Session Gyro to use.- circle()Specifies that a circle should be used, if the- widthand- heightare equal, otherwise it will become an ellipse.- circle- (int size) Specifies that a circle should be used in the set logical pixel size.- clientSessionGyro- (IClientSessionGyro clientGyro) Assigns the Client Session Gyro to use.- clone()Clones the instance.- corners- (int corners) The corner size of the image in pixels with DPR = 1.0d.- createDefault- (boolean doCreateDefault) Returns if creation of a default user profile image if none is found for a user ID or user Name should be performed or not.Assigns the App Session Gyro to use.Assigns the current Client Session Gyro to use.- booleanReturns if creation of a default user profile image if none is found for a user ID or user Name should be performed or not.- DRPs- (double[] dprs) Sets the DRP's to use.Gets the application session gyro.Gets the client session gyro.- intGets the corner size of the image in pixels with DPR = 1.0d.- double[]- getDPRs()Gets the DPR's requested.- intThe height requested of the image, always greater than zero.- intGets the image quality.- longGets the user ID.Gets the user name.- int- getWidth()Gets the width requested of the image, always greater than zero.- boolean- isCircle()Checks if it's a circle or oval (in case of different- widthand- height)- quality- (int quality) Sets the image quality.- size- (int size) Specifies the size of the image.- size- (int width, int height) Specifies the size of the image.- user- (long userID) Specifies the user to use.Specifies the user name.
- Method Details- cloneIUserProfileImageRequest clone()Clones the instance.- Returns:
- A new UserProfileImageRequest cloned instance.
 
- currentClientSessionGyroIUserProfileImageRequest currentClientSessionGyro()Assigns the current Client Session Gyro to use. The current thread is used to get it, and will also set the App Session Gyro if not already set.- Returns:
- The UserProfileImageRequest "this" instance.
- Throws:
- NotFoundException- If current- clientGyrois not found.
 
- currentAppSessionGyroIUserProfileImageRequest currentAppSessionGyro()Assigns the App Session Gyro to use. If this method is not called, an attempt to locate the current App Session Gyro from the current thread might be done. The user ID or user Name will be initialized from this app session if not set to another value.- Returns:
- The UserProfileImageRequest "this" instance.
- Throws:
- NotFoundException- If- appGyrois not found.
 
- appSessionGyroAssigns the App Session Gyro to use. If this method is not called, an attempt to locate the current App Session Gyro from the current thread might be done. The user ID or user Name will be initialized from this app session if not set to another value.- Parameters:
- appGyro- The application session gyro to use.
- Returns:
- The UserProfileImageRequest "this" instance.
- Throws:
- NullPointerException- If- appGyrois- null.
 
- clientSessionGyroAssigns the Client Session Gyro to use. If this method is not called, an attempt to locate the current Client Session Gyro from the current thread might be done. Setting the- clientGyrowill enable the DPR's to be read for the current client session.- Parameters:
- clientGyro- The client session gyro to use.
- Returns:
- The UserProfileImageRequest "this" instance.
 
- userSpecifies the user to use.- If an existing - userNamehas been set, this call will reset it to- null.- Parameters:
- userID- Requested user ID, or a negative value to use the current user, determined from the current Client or Application session.
- Returns:
- The UserProfileImageRequest "this" instance.
- Throws:
- NotFoundException- If the user ID is not found.
- IllegalArgumentException- If the user ID is invalid (zero or negative value).
 
- userSpecifies the user name.- Parameters:
- userName- The user name.
- Throws:
- NotFoundException- If the user name is not found.
- NullPointerException- If- userNameis- null.
 
- sizeSpecifies the size of the image.- Parameters:
- size- The size of width in logical pixels in the range of 16 to 400.
- Returns:
- The UserProfileImageRequest "this" instance.
- Throws:
- IllegalArgumentException- If- sizeis not in the range of 16 to 400.
 
- sizeSpecifies the size of the image.- Parameters:
- width- The width in logical pixels, must be greater than zero.
- height- The height in logical pixels, must be greater than zero.
- Returns:
- The UserProfileImageRequest "this" instance.
- Throws:
- IllegalArgumentException- If- widthor- heightis not in the range of 16 to 400.
 
- qualitySets the image quality.- Parameters:
- quality- Zero for .PNG format loss-less with transparency support (default value), otherwise a value between 1 (worst possible quality) and 100 (loss-less) in .JPG format.
- Throws:
- IllegalArgumentException- If- qualityis not in the range of 0 to 100.
 
- circleIUserProfileImageRequest circle()Specifies that a circle should be used, if the- widthand- heightare equal, otherwise it will become an ellipse.- Returns:
- The UserProfileImageRequest "this" instance.
 
- circleSpecifies that a circle should be used in the set logical pixel size. The image width and height will be set to the size specified.- Parameters:
- size- The size of width in logical pixels in the range of 16 to 400. The width and height will be set to the specified size.
- Returns:
- The UserProfileImageRequest "this" instance.
- Throws:
- IllegalArgumentException- If- sizeis not in the range of 16 to 400.
 
- cornersThe corner size of the image in pixels with DPR = 1.0d. The corner size is multiplied with the DPR for high resolution images.- A value of - zeroindicates rectangular corners, i.e. no rounding.- A negative value will use the corners of half the - widthand half the- height.- Returns:
- The UserProfileImageRequest "this" instance.
 
- DRPsSets the DRP's to use.- Parameters:
- dprs- The DPR's to use. The first value MUST ALWAYs be 1.0d. Set to- {@link #COMMON_DPRS_EMPTY}if you wish to use the default DPR's values 1.0d, 1.5d, 2.0d, 3.0d and 4.0d. Set to- nullif the array should be build from the Client Session (must be non-null}, otherwise the single DPR 1.0d will be used.
- Throws:
- IllegalArgumentException- If the array is invalid or has invalid values.
 
- createDefaultReturns if creation of a default user profile image if none is found for a user ID or user Name should be performed or not.- Parameters:
- doCreateDefault- The create default flag,- falseby default.
- Returns:
- The UserProfileImageRequest "this" instance.
 
- getAppSessionGyroIAppSessionGyro getAppSessionGyro()Gets the application session gyro.- Returns:
- The App Session Gyro, or nullif not set.
 
- getClientSessionGyroIClientSessionGyro getClientSessionGyro()Gets the client session gyro.- Returns:
- The Client Session Gyro, or nullif not set.
 
- getUserIDlong getUserID()Gets the user ID.- Returns:
- The user ID that has been set, or -1Lif the session is still unauthenticated or not yet set, orzeroif an undefined user "_undef_" is signed in.
 
- getUserNameString getUserName()Gets the user name.- Returns:
- The user name, or nullif unauthenticated or not yet set, or "@undefined" if an undefined user is signed in.
 
- getWidthint getWidth()Gets the width requested of the image, always greater than zero.- Returns:
- The width in logical pixels, zero if not yet set.
 
- getHeightint getHeight()The height requested of the image, always greater than zero.- Returns:
- The height in logical pixels, zero if not yet set.
 
- getQualityint getQuality()Gets the image quality.- Returns:
- The Image quality: zero for .PNG format loss-less with transparency support (default value), otherwise a value between 1 (worst possible quality) and 100 (loss-less) in .JPG format.
 
- getCornersint getCorners()Gets the corner size of the image in pixels with DPR = 1.0d. The corner size is multiplied with the DPR for high resolution images.- Returns:
- The corner logical pixel value, zerofor square corners (or rectangular, i.e. not rounded),-1for circle or oval (in case of differentwidthandheight).A value of zeroindicates rectangular corners, i.e. no rounding.A negative value will use the corners of half the widthand half theheight.
 
- isCircleboolean isCircle()Checks if it's a circle or oval (in case of different- widthand- height)- Returns:
- Flag indicating if a circle or oval image will be the result.
 
- doCreateDefaultboolean doCreateDefault()Returns if creation of a default user profile image if none is found for a user ID or user Name should be performed or not.- Returns:
- The create default flag, falseby default.
 
- getDPRsdouble[] getDPRs()Gets the DPR's requested.- Returns:
- A cloned array of the requested DPR's.