Package com.iizix.urn.user
Class UserProfileImageURN
- java.lang.Object
- com.iizix.urn.URN
- com.iizix.urn.user.UserProfileImageURN
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
public class UserProfileImageURN extends URN implements java.lang.Cloneable, java.io.Serializable
User Profile Image Uniform Resource Naming (URN) instance class, holding various User Profile Image of the requested type.User Profile Image URN's are encoded in IIZI as:
urn:iz-pimg:type:id=userIDorurn:iz-pimg:type:name=userNameThe
typeis the image type are the{@link UserProfileImageURNType#name()}, i.e. one of the Strings- Uploaded
- CroppedUploaded
- Large
- Thumbnail
The
userIDis a {code long} value unique to the user ID in question, theuserNameis a UTF-8 encoded string.- Author:
- Christopher Mindus
- See Also:
UserProfileImageURNType, Serialized Form
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static IUserProfileImageRequestcreateRequest()Creates an uninitialized profile image request.booleanequals(java.lang.Object obj)Checks if two instances are equal.static UserProfileImageURNfromUserID(UserProfileImageURNType type, long id)Creates a User Profile String URN using a possible cached instance of the user information.static UserProfileImageURNfromUserName(UserProfileImageURNType type, java.lang.String userName)Creates a User Profile String URN using a possible cached instance of the user information.java.lang.StringgetParamString()Gets the parameter string for theURN.toString()method.java.lang.StringgetURL()Gets the URL of this as a data URL in UTF-8 encoded data.inthashCode()Hash code of this instance.static voidsetUserProfileImageURNProvider(IUserProfileImageURNProvider provider)Assigns the User Profile Image URN provider.Methods inherited from class com.iizix.urn.URN
asURNResource, from, getImageTarget, getURNString, isImageTargetSupported, isURNResource, toString
Method Detail
setUserProfileImageURNProvider
public static void setUserProfileImageURNProvider(IUserProfileImageURNProvider provider)
Assigns the User Profile Image URN provider. This is an IIZI internal method. This method cannot only be called from the server and should not be called elsewhere.- Throws:
java.lang.NullPointerException- Ifproviderisnull.java.lang.IllegalStateException- If called twice or outside the server.
createRequest
public static IUserProfileImageRequest createRequest()
Creates an uninitialized profile image request.- Returns:
- The uninitialized request.
- Throws:
java.lang.NullPointerException- If the User Profile Image URN provider is not initialized.
fromUserID
public static UserProfileImageURN fromUserID(UserProfileImageURNType type, long id)
Creates a User Profile String URN using a possible cached instance of the user information.- Parameters:
type- The type.id- Thelonguser ID.- Throws:
java.lang.NullPointerException- Iftypeisnull.java.lang.IllegalArgumentException- If theidis zero.
fromUserName
public static UserProfileImageURN fromUserName(UserProfileImageURNType type, java.lang.String userName)
Creates a User Profile String URN using a possible cached instance of the user information.- Parameters:
type- The type.userName- The User Name.- Throws:
java.lang.NullPointerException- IftypeoruserNameisnull.
getURL
public java.lang.String getURL()
Gets the URL of this as a data URL in UTF-8 encoded data.
getParamString
public java.lang.String getParamString()
Gets the parameter string for theURN.toString()method.- Specified by:
getParamStringin classURN- Returns:
- The parameter string, always
non-null, formatted as"type:name=UserName"or"type:id=UserID"whereQueryis the queried enum string.
hashCode
public int hashCode()
Hash code of this instance.