Package org.eclipse.jgit.lib
Class PersonIdent
- java.lang.Object
-
- org.eclipse.jgit.lib.PersonIdent
-
- All Implemented Interfaces:
java.io.Serializable
public class PersonIdent extends java.lang.Object implements java.io.Serializable
A combination of a person identity and time in Git. Git combines Name + email + time + time zone to specify who wrote or committed something.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PersonIdent(java.lang.String aName, java.lang.String aEmailAddress)
Construct a newPersonIdent
with current time.PersonIdent(java.lang.String aName, java.lang.String aEmailAddress, long aWhen, int aTZ)
Construct aPersonIdent
PersonIdent(java.lang.String aName, java.lang.String aEmailAddress, java.util.Date aWhen, java.util.TimeZone aTZ)
Construct a PersonIdent from simple dataPersonIdent(PersonIdent pi)
Copy aPersonIdent
.PersonIdent(PersonIdent pi, long aWhen, int aTZ)
Copy a PersonIdent, but alter the clone's time stampPersonIdent(PersonIdent pi, java.util.Date aWhen)
Copy aPersonIdent
, but alter the clone's time stampPersonIdent(PersonIdent pi, java.util.Date when, java.util.TimeZone tz)
Copy a PersonIdent, but alter the clone's time stampPersonIdent(Repository repo)
Creates new PersonIdent from config info in repository, with current time.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
java.lang.String
getEmailAddress()
java.lang.String
getName()
java.util.TimeZone
getTimeZone()
int
getTimeZoneOffset()
java.util.Date
getWhen()
int
hashCode()
java.lang.String
toExternalString()
Format for Git storage.java.lang.String
toString()
-
-
-
Constructor Detail
-
PersonIdent
public PersonIdent(Repository repo)
Creates new PersonIdent from config info in repository, with current time. This new PersonIdent gets the info from the default committer as available from the configuration.- Parameters:
repo
-
-
PersonIdent
public PersonIdent(PersonIdent pi)
Copy aPersonIdent
.- Parameters:
pi
- OriginalPersonIdent
-
PersonIdent
public PersonIdent(java.lang.String aName, java.lang.String aEmailAddress)
Construct a newPersonIdent
with current time.- Parameters:
aName
-aEmailAddress
-
-
PersonIdent
public PersonIdent(PersonIdent pi, java.util.Date when, java.util.TimeZone tz)
Copy a PersonIdent, but alter the clone's time stamp- Parameters:
pi
- originalPersonIdent
when
- local timetz
- time zone
-
PersonIdent
public PersonIdent(PersonIdent pi, java.util.Date aWhen)
Copy aPersonIdent
, but alter the clone's time stamp- Parameters:
pi
- originalPersonIdent
aWhen
- local time
-
PersonIdent
public PersonIdent(java.lang.String aName, java.lang.String aEmailAddress, java.util.Date aWhen, java.util.TimeZone aTZ)
Construct a PersonIdent from simple data- Parameters:
aName
-aEmailAddress
-aWhen
- local time stampaTZ
- time zone
-
PersonIdent
public PersonIdent(PersonIdent pi, long aWhen, int aTZ)
Copy a PersonIdent, but alter the clone's time stamp- Parameters:
pi
- originalPersonIdent
aWhen
- local time stampaTZ
- time zone
-
PersonIdent
public PersonIdent(java.lang.String aName, java.lang.String aEmailAddress, long aWhen, int aTZ)
Construct aPersonIdent
- Parameters:
aName
-aEmailAddress
-aWhen
- local time stampaTZ
- time zone
-
-
Method Detail
-
getName
public java.lang.String getName()
- Returns:
- Name of person
-
getEmailAddress
public java.lang.String getEmailAddress()
- Returns:
- email address of person
-
getWhen
public java.util.Date getWhen()
- Returns:
- timestamp
-
getTimeZone
public java.util.TimeZone getTimeZone()
- Returns:
- this person's declared time zone; null if time zone is unknown.
-
getTimeZoneOffset
public int getTimeZoneOffset()
- Returns:
- this person's declared time zone as minutes east of UTC. If the timezone is to the west of UTC it is negative.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
toExternalString
public java.lang.String toExternalString()
Format for Git storage.- Returns:
- a string in the git author format
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-