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()
Get email address of person
|
String |
getName()
Get name of person
|
TimeZone |
getTimeZone()
Get this person's declared time zone
|
static TimeZone |
getTimeZone(int tzOffset)
Get timezone object for the given offset.
|
int |
getTimeZoneOffset()
Get this person's declared time zone as minutes east of UTC.
|
Date |
getWhen()
Get timestamp
|
int |
hashCode() |
String |
toExternalString()
Format for Git storage.
|
String |
toString() |
public PersonIdent(Repository repo)
repo
- a Repository
object.public PersonIdent(PersonIdent pi)
PersonIdent
.pi
- Original PersonIdent
public PersonIdent(String aName, String aEmailAddress)
PersonIdent
with current
time.public PersonIdent(String aName, String aEmailAddress, ProposedTimestamp when)
PersonIdent
with current
time.aName
- a String
object.aEmailAddress
- a String
object.when
- a ProposedTimestamp
object.public PersonIdent(PersonIdent pi, Date when, TimeZone tz)
pi
- original PersonIdent
when
- local timetz
- time zonepublic PersonIdent(PersonIdent pi, Date aWhen)
PersonIdent
, but alter the clone's
time stamppi
- original PersonIdent
aWhen
- local timepublic PersonIdent(String aName, String aEmailAddress, Date aWhen, TimeZone aTZ)
public PersonIdent(PersonIdent pi, long aWhen, int aTZ)
pi
- original PersonIdent
aWhen
- 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.
public 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()
Hashcode is based only on the email address and timestamp.
public String toExternalString()
Copyright © 2018 Eclipse JGit Project. All rights reserved.