com.atlassian.jira.avatar
Class AvatarImpl

java.lang.Object
  extended by com.atlassian.jira.avatar.AvatarImpl
All Implemented Interfaces:
Avatar

public final class AvatarImpl
extends java.lang.Object
implements Avatar

Immutable implementation.

Since:
v4.0

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.atlassian.jira.avatar.Avatar
Avatar.Type
 
Method Summary
static AvatarImpl createCustomAvatar(java.lang.String fileName, java.lang.String contentType, Avatar.Type avatarType, java.lang.String owner)
          Factory method for creating a custom Avatar to be created by AvatarManager.
static AvatarImpl createSystemAvatar(java.lang.String fileName, java.lang.String contentType, Avatar.Type avatarType)
          Factory method for creating a system Avatar to be created by AvatarManager.
 boolean equals(java.lang.Object o)
           
 Avatar.Type getAvatarType()
          The type of Avatar.
 java.lang.String getContentType()
          The MIME type of the avatar image file.
 java.lang.String getFileName()
          The base filename to the avatar image file.
 java.lang.Long getId()
          The database identifier for the Avatar, may be null if it hasn't yet been stored.
 java.lang.String getOwner()
          A String representation of the identity of the domain object that this avatar is an avatar for! For example, if it is a user avatar, it would be the username (since that is the primary key), for a Project it is the project ID as a String.
 int hashCode()
           
 boolean isSystemAvatar()
          Indicates whether the Avatar is a system-provided one or if users have defined it.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createCustomAvatar

public static AvatarImpl createCustomAvatar(java.lang.String fileName,
                                            java.lang.String contentType,
                                            Avatar.Type avatarType,
                                            java.lang.String owner)
Factory method for creating a custom Avatar to be created by AvatarManager.


createSystemAvatar

public static AvatarImpl createSystemAvatar(java.lang.String fileName,
                                            java.lang.String contentType,
                                            Avatar.Type avatarType)
Factory method for creating a system Avatar to be created by AvatarManager.


getAvatarType

public Avatar.Type getAvatarType()
Description copied from interface: Avatar
The type of Avatar.

Specified by:
getAvatarType in interface Avatar
Returns:
a non null Avatar.Type.

getFileName

public java.lang.String getFileName()
Description copied from interface: Avatar
The base filename to the avatar image file. The actual file name will be modified with the id etc.

Specified by:
getFileName in interface Avatar
Returns:
the non null file name.

getContentType

@NotNull
public java.lang.String getContentType()
Description copied from interface: Avatar
The MIME type of the avatar image file.

Specified by:
getContentType in interface Avatar
Returns:
the non null file name.

getId

public java.lang.Long getId()
Description copied from interface: Avatar
The database identifier for the Avatar, may be null if it hasn't yet been stored.

Specified by:
getId in interface Avatar
Returns:
the database id or null.

getOwner

public java.lang.String getOwner()
Description copied from interface: Avatar
A String representation of the identity of the domain object that this avatar is an avatar for! For example, if it is a user avatar, it would be the username (since that is the primary key), for a Project it is the project ID as a String. The meaning of this should be determined by the Avatar.Type.

Specified by:
getOwner in interface Avatar
Returns:
the owner id must not be null.

isSystemAvatar

public boolean isSystemAvatar()
Description copied from interface: Avatar
Indicates whether the Avatar is a system-provided one or if users have defined it.

Specified by:
isSystemAvatar in interface Avatar
Returns:
true only if the Avatar is a system-provided one.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object


Copyright © 2002-2010 Atlassian. All Rights Reserved.