public class PersonIdent extends Object implements Serializable
| Constructor and Description |
|---|
PersonIdent(PersonIdent pi)
Copy a
PersonIdent. |
PersonIdent(PersonIdent pi,
Date aWhen)
Copy a
PersonIdent, but alter the clone's time stamp |
PersonIdent(PersonIdent pi,
Date when,
TimeZone tz)
Copy a PersonIdent, but alter the clone's time stamp
|
PersonIdent(PersonIdent pi,
long aWhen,
int aTZ)
Copy a PersonIdent, but alter the clone's time stamp
|
PersonIdent(Repository repo)
Creates new PersonIdent from config info in repository, with current time.
|
PersonIdent(String aName,
String aEmailAddress)
Construct a new
PersonIdent with current time. |
PersonIdent(String aName,
String aEmailAddress,
Date aWhen,
TimeZone aTZ)
Construct a PersonIdent from simple data
|
PersonIdent(String aName,
String aEmailAddress,
long aWhen,
int aTZ)
Construct a
PersonIdent. |
PersonIdent(String aName,
String aEmailAddress,
ProposedTimestamp when)
Construct a new
PersonIdent with current time. |
| Modifier and Type | Method and Description |
|---|---|
static void |
appendSanitized(StringBuilder r,
String str)
Sanitize the given string for use in an identity and append to output.
|
static void |
appendTimezone(StringBuilder r,
int offset)
Format a timezone offset.
|
boolean |
equals(Object o) |
String |
getEmailAddress() |
String |
getName() |
TimeZone |
getTimeZone() |
static TimeZone |
getTimeZone(int tzOffset) |
int |
getTimeZoneOffset() |
Date |
getWhen() |
int |
hashCode()
Hashcode is based only on the email address and timestamp.
|
String |
toExternalString()
Format for Git storage.
|
String |
toString() |
public PersonIdent(Repository repo)
repo - public PersonIdent(PersonIdent pi)
PersonIdent.pi - Original PersonIdentpublic PersonIdent(String aName, String aEmailAddress)
PersonIdent with current time.aName - aEmailAddress - public PersonIdent(String aName, String aEmailAddress, ProposedTimestamp when)
PersonIdent with current time.aName - aEmailAddress - when - public PersonIdent(PersonIdent pi, Date when, TimeZone tz)
pi - original PersonIdentwhen - local timetz - time zonepublic PersonIdent(PersonIdent pi, Date aWhen)
PersonIdent, but alter the clone's time stamppi - original PersonIdentaWhen - local timepublic PersonIdent(String aName, String aEmailAddress, Date aWhen, TimeZone aTZ)
aName - aEmailAddress - aWhen - local time stampaTZ - time zonepublic PersonIdent(PersonIdent pi, long aWhen, int aTZ)
pi - original PersonIdentaWhen - local time stampaTZ - time zonepublic PersonIdent(String aName, String aEmailAddress, long aWhen, int aTZ)
PersonIdent.
Whitespace in the name and email is preserved for the lifetime of this
object, but are trimmed by toExternalString(). This means that
parsing the result of toExternalString() may not return an
equivalent instance.
aName - aEmailAddress - aWhen - local time stampaTZ - time zonepublic static TimeZone getTimeZone(int tzOffset)
tzOffset - timezone offset as in getTimeZoneOffset().public static void appendTimezone(StringBuilder r, int offset)
r - string builder to append to.offset - timezone offset as in getTimeZoneOffset().public static void appendSanitized(StringBuilder r, String str)
Trims whitespace from both ends and special characters \n < > that
interfere with parsing; appends all other characters to the output.
Analogous to the C git function strbuf_addstr_without_crud.
r - string builder to append to.str - input string.public String getName()
public String getEmailAddress()
public Date getWhen()
public TimeZone getTimeZone()
public int getTimeZoneOffset()
public int hashCode()
public String toExternalString()
Copyright © 2017 Eclipse JGit Project. All rights reserved.