Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 193925 Details for
Bug 343602
[identity] add support for retrieving Gravatar information
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Gravatar model class
patch1.txt (text/plain), 2.84 KB, created by
Kevin Sawicki
on 2011-04-22 12:49:39 EDT
(
hide
)
Description:
Gravatar model class
Filename:
MIME Type:
Creator:
Kevin Sawicki
Created:
2011-04-22 12:49:39 EDT
Size:
2.84 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylyn.commons.identity >Index: src/org/eclipse/mylyn/commons/identity/gravatar/Gravatar.java >=================================================================== >RCS file: src/org/eclipse/mylyn/commons/identity/gravatar/Gravatar.java >diff -N src/org/eclipse/mylyn/commons/identity/gravatar/Gravatar.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylyn/commons/identity/gravatar/Gravatar.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,109 @@ >+/******************************************************************************* >+ * Copyright (c) 2011 GitHub Inc. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Kevin Sawicki (GitHub Inc.) - initial API and implementation >+ *******************************************************************************/ >+ >+package org.eclipse.mylyn.commons.identity.gravatar; >+ >+import java.io.Serializable; >+ >+import org.eclipse.core.runtime.Assert; >+ >+/** >+ * Gravatar class containing id and image data. >+ * >+ * @author Kevin Sawicki (kevin@github.com) >+ */ >+public class Gravatar implements Serializable { >+ >+ /** >+ * serialVersionUID >+ */ >+ private static final long serialVersionUID = 7303486086217698261L; >+ >+ private final String id; >+ >+ private final long updateTime; >+ >+ private final byte[] bytes; >+ >+ /** >+ * Create gravatar >+ * >+ * @param id >+ * @param updateTime >+ * @param bytes >+ */ >+ public Gravatar(String id, long updateTime, byte[] bytes) { >+ Assert.isNotNull(id, "Id cannot be null"); //$NON-NLS-1$ >+ Assert.isNotNull(bytes, "Bytes cannot be null"); //$NON-NLS-1$ >+ this.id = id; >+ this.updateTime = updateTime; >+ this.bytes = bytes; >+ } >+ >+ /** >+ * @see java.lang.Object#hashCode() >+ */ >+ @Override >+ public int hashCode() { >+ return this.id.hashCode(); >+ } >+ >+ /** >+ * @see java.lang.Object#equals(java.lang.Object) >+ */ >+ @Override >+ public boolean equals(Object obj) { >+ if (obj == this) { >+ return true; >+ } else if (obj instanceof Gravatar) { >+ return getId().equals(((Gravatar) obj).getId()); >+ } >+ return false; >+ } >+ >+ /** >+ * Get gravatar image as byte array >+ * >+ * @return non-null byte array >+ */ >+ public byte[] getBytes() { >+ byte[] copy = new byte[this.bytes.length]; >+ System.arraycopy(this.bytes, 0, copy, 0, copy.length); >+ return copy; >+ } >+ >+ /** >+ * @see java.lang.Object#toString() >+ */ >+ @Override >+ public String toString() { >+ return this.id; >+ } >+ >+ /** >+ * Get gravatar id >+ * >+ * @return id >+ */ >+ public String getId() { >+ return this.id; >+ } >+ >+ /** >+ * Get time gravatar was loaded >+ * >+ * @return update time >+ */ >+ public long getUpdateTime() { >+ return this.updateTime; >+ } >+ >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
steffen.pingel
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 343602
:
193920
|
193921
|
193922
|
193923
|
193924
| 193925 |
193926
|
193927
|
193928
|
193940
|
195674