com.perforce.p4java.impl.generic.core
Class ChangelistSummary

java.lang.Object
  extended by com.perforce.p4java.impl.generic.core.ServerResource
      extended by com.perforce.p4java.impl.generic.core.ChangelistSummary
All Implemented Interfaces:
IChangelistSummary, IServerResource
Direct Known Subclasses:
Changelist

public class ChangelistSummary
extends ServerResource
implements IChangelistSummary

Default implementation of the IChangelistSummary interface.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.perforce.p4java.core.IChangelistSummary
IChangelistSummary.Visibility
 
Field Summary
protected static String CHANGE_KEY
           
protected static String CLIENT_KEY
           
protected  String clientId
           
protected  Date date
           
protected static String DATE_FORMAT
           
protected static String DATE_KEY
           
protected  String description
           
protected static String DESCRIPTION_KEY
           
protected  int id
           
protected static String JOBS_KEY
           
protected static String NEW_KEY
           
protected  boolean shelved
           
protected  ChangelistStatus status
           
protected static String STATUS_KEY
           
protected static String USER_KEY
           
protected  String username
           
protected  IChangelistSummary.Visibility visibility
           
 
Fields inherited from class com.perforce.p4java.impl.generic.core.ServerResource
refreshable, server, updateable
 
Constructor Summary
ChangelistSummary()
          Default constructor -- sets all fields to false or null, id to IChangelist.UNKNOWN, and calls the default ServerResource constructor.
ChangelistSummary(boolean complete, boolean completable, boolean refreshable, boolean updateable, IServer server)
          Explicit-value pass-through constructor for the ServerResource fields.
ChangelistSummary(IChangelistSummary summary)
          Construct a new ChangelistSummary from the passed-in summary.
ChangelistSummary(int id, String clientId, String username, ChangelistStatus status, Date date, String description, boolean shelved)
          Explicit-value constructor; calls the default ServerResource constructor.
ChangelistSummary(Map<String,Object> map, boolean summaryOnly)
          Convenience constructor, equivalent to this(map, summaryOnly, null).
ChangelistSummary(Map<String,Object> map, boolean summaryOnly, IServer server)
          Construct a ChangelistSummary from a suitable map returned from the Perforce server.
 
Method Summary
 String getClientId()
          Get the ID of the Perforce client workspace associated with this changelist.
 Date getDate()
          Get the date the changelist was created or last updated.
 String getDescription()
          Return the description associated with this changelist.
 int getId()
          Return the Perforce changelist's ID.
 ChangelistStatus getStatus()
          Get the status of this changelist, if known.
 String getUsername()
          Get the user name of the user associated with this changelist.
 IChangelistSummary.Visibility getVisibility()
          Get the visibility associated with this changelist.
 boolean isShelved()
          Does this changelist contain at least one shelved file? This only applies to changelists whose IChangelistSummary.getStatus() is ChangelistStatus.PENDING and that have been returned as IChangelistSummary objects.
 void setClientId(String clientId)
          Set the client ID.
 void setDate(Date date)
          Set the changelist date.
 String setDescription(String description)
          Set the description string for this changelist.
 void setId(int id)
          Set the changelist ID.
 void setShelved(boolean shelved)
          Set the shelved status of of this changelist (see isShelved()).
 void setStatus(ChangelistStatus status)
          Set the changelist status.
 void setUsername(String username)
          Set the changelist owner ID.
 void setVisibility(IChangelistSummary.Visibility visibility)
          Set the visibility associated with this changelist.
 
Methods inherited from class com.perforce.p4java.impl.generic.core.ServerResource
canRefresh, canUpdate, complete, refresh, setRefreshable, setServer, update, update, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHANGE_KEY

protected static final String CHANGE_KEY
See Also:
Constant Field Values

NEW_KEY

protected static final String NEW_KEY
See Also:
Constant Field Values

CLIENT_KEY

protected static final String CLIENT_KEY
See Also:
Constant Field Values

USER_KEY

protected static final String USER_KEY
See Also:
Constant Field Values

STATUS_KEY

protected static final String STATUS_KEY
See Also:
Constant Field Values

DATE_KEY

protected static final String DATE_KEY
See Also:
Constant Field Values

DESCRIPTION_KEY

protected static final String DESCRIPTION_KEY
See Also:
Constant Field Values

JOBS_KEY

protected static final String JOBS_KEY
See Also:
Constant Field Values

DATE_FORMAT

protected static final String DATE_FORMAT
See Also:
Constant Field Values

id

protected int id

clientId

protected String clientId

username

protected String username

status

protected ChangelistStatus status

date

protected Date date

description

protected String description

shelved

protected boolean shelved

visibility

protected IChangelistSummary.Visibility visibility
Constructor Detail

ChangelistSummary

public ChangelistSummary()
Default constructor -- sets all fields to false or null, id to IChangelist.UNKNOWN, and calls the default ServerResource constructor.


ChangelistSummary

public ChangelistSummary(boolean complete,
                         boolean completable,
                         boolean refreshable,
                         boolean updateable,
                         IServer server)
Explicit-value pass-through constructor for the ServerResource fields. Usually used by IChangelistSummary extensions.


ChangelistSummary

public ChangelistSummary(int id,
                         String clientId,
                         String username,
                         ChangelistStatus status,
                         Date date,
                         String description,
                         boolean shelved)
Explicit-value constructor; calls the default ServerResource constructor.


ChangelistSummary

public ChangelistSummary(IChangelistSummary summary)
Construct a new ChangelistSummary from the passed-in summary. If summary is null, this is equivalent to calling the default constructor.


ChangelistSummary

public ChangelistSummary(Map<String,Object> map,
                         boolean summaryOnly)
Convenience constructor, equivalent to this(map, summaryOnly, null).


ChangelistSummary

public ChangelistSummary(Map<String,Object> map,
                         boolean summaryOnly,
                         IServer server)
Construct a ChangelistSummary from a suitable map returned from the Perforce server. If map is null, this is equivalent to calling the default constructor; otherwise, if summaryOnly is true, the map is assumed to come from a "p4 changes" command and processed accordingly, with the superclass ServerResource fields set accordingly; otherwise the map is assumed to come from a full changelist command and the superclass fields are also set appropriately for the full changelist. The server parameter is ignored for summaryOnly objects.

Note that map keys returned from the Perforce server are sometimes different for summary fields and full fields, so you have to be clear about where the map came from to get accurate results.

Method Detail

getId

public int getId()
Description copied from interface: IChangelistSummary
Return the Perforce changelist's ID.

Specified by:
getId in interface IChangelistSummary
Returns:
changelist ID, or UNKNOWN if unknown or not yet allocated.
See Also:
IChangelistSummary.getId()

setId

public void setId(int id)
Description copied from interface: IChangelistSummary
Set the changelist ID. Will not cause the associated changelist to be updated on the Perforce server without a suitable update being performed.

Specified by:
setId in interface IChangelistSummary
Parameters:
id - new changelist ID.
See Also:
IChangelistSummary.setId(int)

getClientId

public String getClientId()
Description copied from interface: IChangelistSummary
Get the ID of the Perforce client workspace associated with this changelist.

Specified by:
getClientId in interface IChangelistSummary
Returns:
the ID of the client associated with this changelist, or null if not known.
See Also:
IChangelistSummary.getClientId()

setClientId

public void setClientId(String clientId)
Description copied from interface: IChangelistSummary
Set the client ID. Will not cause the associated changelist to be updated on the Perforce server without a suitable update being performed.

Specified by:
setClientId in interface IChangelistSummary
Parameters:
clientId - new client ID.
See Also:
IChangelistSummary.setClientId(java.lang.String)

getUsername

public String getUsername()
Description copied from interface: IChangelistSummary
Get the user name of the user associated with this changelist.

Specified by:
getUsername in interface IChangelistSummary
Returns:
the user name of the user associated with this changelist, or null if no such name exists or can be determined.
See Also:
IChangelistSummary.getUsername()

setUsername

public void setUsername(String username)
Description copied from interface: IChangelistSummary
Set the changelist owner ID. Will not cause the associated changelist to be updated on the Perforce server without a suitable update being performed.

Specified by:
setUsername in interface IChangelistSummary
Parameters:
username - new owner's user name.
See Also:
IChangelistSummary.setUsername(java.lang.String)

getStatus

public ChangelistStatus getStatus()
Description copied from interface: IChangelistSummary
Get the status of this changelist, if known.

Specified by:
getStatus in interface IChangelistSummary
Returns:
IChangelistStatus status, or null if not known.
See Also:
IChangelistSummary.getStatus()

setStatus

public void setStatus(ChangelistStatus status)
Description copied from interface: IChangelistSummary
Set the changelist status. Will not cause the associated changelist to be updated on the Perforce server without a suitable update being performed.

Specified by:
setStatus in interface IChangelistSummary

getDate

public Date getDate()
Description copied from interface: IChangelistSummary
Get the date the changelist was created or last updated.

Specified by:
getDate in interface IChangelistSummary
Returns:
the date the changelist was created or last updated, or null if unknown.
See Also:
IChangelistSummary.getDate()

setDate

public void setDate(Date date)
Description copied from interface: IChangelistSummary
Set the changelist date. Will not cause the associated changelist to be updated on the Perforce server without a suitable update being performed.

Specified by:
setDate in interface IChangelistSummary
Parameters:
date - new changelist date
See Also:
IChangelistSummary.setDate(java.util.Date)

getDescription

public String getDescription()
Description copied from interface: IChangelistSummary
Return the description associated with this changelist.

Specified by:
getDescription in interface IChangelistSummary
Returns:
textual changelist description, or null if no such description.
See Also:
IChangelistSummary.getDescription()

setDescription

public String setDescription(String description)
Description copied from interface: IChangelistSummary
Set the description string for this changelist.

Specified by:
setDescription in interface IChangelistSummary
Parameters:
description - non-null new description string.
Returns:
the old description string.
See Also:
IChangelistSummary.setDescription(java.lang.String)

isShelved

public boolean isShelved()
Description copied from interface: IChangelistSummary
Does this changelist contain at least one shelved file? This only applies to changelists whose IChangelistSummary.getStatus() is ChangelistStatus.PENDING and that have been returned as IChangelistSummary objects. The value here is unreliable for full IChangelist objects returned from getChangelist, etc.

Specified by:
isShelved in interface IChangelistSummary
Returns:
- true if changelist contains shelved files, false otherwise
See Also:
IChangelistSummary.isShelved()

setShelved

public void setShelved(boolean shelved)
Description copied from interface: IChangelistSummary
Set the shelved status of of this changelist (see isShelved()).

Specified by:
setShelved in interface IChangelistSummary
Parameters:
shelved - new shelved value.
See Also:
IChangelistSummary.setShelved(boolean)

getVisibility

public IChangelistSummary.Visibility getVisibility()
Description copied from interface: IChangelistSummary
Get the visibility associated with this changelist. May be null if no visibility is associated with this changelist.

Specified by:
getVisibility in interface IChangelistSummary
Returns:
possibly-null visibility.

setVisibility

public void setVisibility(IChangelistSummary.Visibility visibility)
Description copied from interface: IChangelistSummary
Set the visibility associated with this changelist.

Specified by:
setVisibility in interface IChangelistSummary


Copyright © 2015 Perforce Software. All Rights Reserved.