org.eclipse.jgit.lib

## Class PersonIdent

- java.lang.Object
- - org.eclipse.jgit.lib.PersonIdent

All Implemented Interfaces:
  Serializable

    public class PersonIdent
    extends Object
    implements 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 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`

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `equals(Object o)`
`String` `getEmailAddress()`
`String` `getName()`
`TimeZone` `getTimeZone()`
`int` `getTimeZoneOffset()`
`Date` `getWhen()`
`int` `hashCode()`
`String` `toExternalString()` Format for Git storage.
`String` `toString()`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### 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 a `PersonIdent`.

Parameters:
  `pi` - Original `PersonIdent`

#### PersonIdent

    public PersonIdent(String aName,
                       String aEmailAddress)

Construct a new `PersonIdent` with current time.

Parameters:
  `aName` -
  `aEmailAddress` -

#### PersonIdent

    public PersonIdent(PersonIdent pi,
                       Date when,
                       TimeZone tz)

Copy a PersonIdent, but alter the clone's time stamp

Parameters:
  `pi` - original `PersonIdent`
  `when` - local time
  `tz` - time zone

#### PersonIdent

    public PersonIdent(PersonIdent pi,
                       Date aWhen)

Copy a `PersonIdent`, but alter the clone's time stamp

Parameters:
  `pi` - original `PersonIdent`
  `aWhen` - local time

#### PersonIdent

    public PersonIdent(String aName,
                       String aEmailAddress,
                       Date aWhen,
                       TimeZone aTZ)

Construct a PersonIdent from simple data

Parameters:
  `aName` -
  `aEmailAddress` -
  `aWhen` - local time stamp
  `aTZ` - time zone

#### PersonIdent

    public PersonIdent(PersonIdent pi,
                       long aWhen,
                       int aTZ)

Copy a PersonIdent, but alter the clone's time stamp

Parameters:
  `pi` - original `PersonIdent`
  `aWhen` - local time stamp
  `aTZ` - time zone

#### PersonIdent

    public PersonIdent(String aName,
                       String aEmailAddress,
                       long aWhen,
                       int aTZ)

Construct a `PersonIdent`

Parameters:
  `aName` -
  `aEmailAddress` -
  `aWhen` - local time stamp
  `aTZ` - time zone

### Method Detail

#### getName

    public String getName()

Returns:
  Name of person

#### getEmailAddress

    public String getEmailAddress()

Returns:
  email address of person

#### getWhen

    public Date getWhen()

Returns:
  timestamp

#### getTimeZone

    public 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 class `Object`

#### equals

    public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

#### toExternalString

    public String toExternalString()

Format for Git storage.

Returns:
  a string in the git author format

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`