Class ChangelistSummary
- java.lang.Object
-
- com.perforce.p4java.impl.generic.core.ServerResource
-
- 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
Fields Modifier and Type Field Description protected java.lang.StringchangelistStreamprotected java.lang.StringclientIdprotected java.util.Datedateprotected static java.lang.StringDATE_FORMATprotected java.lang.Stringdescriptionprotected intidprotected booleanshelvedprotected ChangelistStatusstatusprotected java.lang.Stringusernameprotected IChangelistSummary.Visibilityvisibility-
Fields inherited from class com.perforce.p4java.impl.generic.core.ServerResource
refreshable, server, updateable
-
-
Constructor Summary
Constructors Constructor Description 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(int id, java.lang.String clientId, java.lang.String username, ChangelistStatus status, java.util.Date date, java.lang.String description, boolean shelved)Explicit-value constructor; calls the default ServerResource constructor.ChangelistSummary(IChangelistSummary summary)Construct a new ChangelistSummary from the passed-in summary.ChangelistSummary(java.util.Map<java.lang.String,java.lang.Object> map, boolean summaryOnly)Convenience constructor, equivalent to this(map, summaryOnly, null).ChangelistSummary(java.util.Map<java.lang.String,java.lang.Object> map, boolean summaryOnly, IServer server)Construct a ChangelistSummary from a suitable map returned from the Perforce server.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetChangelistStream()// * @see com.perforce.p4java.core.IChangelistSummary#getChangelistStream()java.lang.StringgetClientId()Get the ID of the Perforce client workspace associated with this changelist.java.util.DategetDate()Get the date the changelist was created or last updated.java.lang.StringgetDescription()Return the description associated with this changelist.intgetId()Return the Perforce changelist's ID.ChangelistStatusgetStatus()Get the status of this changelist, if known.java.lang.StringgetUsername()Get the user name of the user associated with this changelist.IChangelistSummary.VisibilitygetVisibility()Get the visibility associated with this changelist.booleanisShelved()Does this changelist contain at least one shelved file? This only applies to changelists whoseIChangelistSummary.getStatus()isChangelistStatus.PENDINGand that have been returned as IChangelistSummary objects.voidsetClientId(java.lang.String clientId)Set the client ID.voidsetDate(java.util.Date date)Set the changelist date.java.lang.StringsetDescription(java.lang.String description)Set the description string for this changelist.voidsetId(int id)Set the changelist ID.voidsetShelved(boolean shelved)Set the shelved status of of this changelist (see isShelved()).voidsetStatus(ChangelistStatus status)Set the changelist status.voidsetUsername(java.lang.String username)Set the changelist owner ID.voidsetVisibility(IChangelistSummary.Visibility visibility)Set the visibility associated with this changelist.-
Methods inherited from class com.perforce.p4java.impl.generic.core.ServerResource
canRefresh, canUpdate, clearRawFields, complete, getRawField, getRawFields, hasRawField, parseDate, refresh, setRawField, setRawFields, setRefreshable, setServer, toDateString, update, update, update
-
-
-
-
Field Detail
-
DATE_FORMAT
protected static final java.lang.String DATE_FORMAT
- See Also:
- Constant Field Values
-
id
protected int id
-
clientId
protected java.lang.String clientId
-
username
protected java.lang.String username
-
status
protected ChangelistStatus status
-
date
protected java.util.Date date
-
description
protected java.lang.String description
-
shelved
protected boolean shelved
-
visibility
protected IChangelistSummary.Visibility visibility
-
changelistStream
protected java.lang.String changelistStream
-
-
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.- Parameters:
complete- completecompletable- completablerefreshable- refreshableupdateable- updateableserver- server
-
ChangelistSummary
public ChangelistSummary(int id, java.lang.String clientId, java.lang.String username, ChangelistStatus status, java.util.Date date, java.lang.String description, boolean shelved)Explicit-value constructor; calls the default ServerResource constructor.- Parameters:
id- idclientId- clientusername- user namestatus- statusdate- datedescription- descriptionshelved- shelved
-
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.- Parameters:
summary- summary object
-
ChangelistSummary
public ChangelistSummary(java.util.Map<java.lang.String,java.lang.Object> map, boolean summaryOnly)Convenience constructor, equivalent to this(map, summaryOnly, null).- Parameters:
map- spec mapsummaryOnly- summary only
-
ChangelistSummary
public ChangelistSummary(java.util.Map<java.lang.String,java.lang.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.
- Parameters:
map- spec mapsummaryOnly- summary onlyserver- server
-
-
Method Detail
-
getId
public int getId()
Description copied from interface:IChangelistSummaryReturn the Perforce changelist's ID.- Specified by:
getIdin interfaceIChangelistSummary- 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:IChangelistSummarySet the changelist ID. Will not cause the associated changelist to be updated on the Perforce server without a suitable update being performed.- Specified by:
setIdin interfaceIChangelistSummary- Parameters:
id- new changelist ID.- See Also:
IChangelistSummary.setId(int)
-
getClientId
public java.lang.String getClientId()
Description copied from interface:IChangelistSummaryGet the ID of the Perforce client workspace associated with this changelist.- Specified by:
getClientIdin interfaceIChangelistSummary- Returns:
- the ID of the client associated with this changelist, or null if not known.
- See Also:
IChangelistSummary.getClientId()
-
setClientId
public void setClientId(java.lang.String clientId)
Description copied from interface:IChangelistSummarySet the client ID. Will not cause the associated changelist to be updated on the Perforce server without a suitable update being performed.- Specified by:
setClientIdin interfaceIChangelistSummary- Parameters:
clientId- new client ID.- See Also:
IChangelistSummary.setClientId(java.lang.String)
-
getUsername
public java.lang.String getUsername()
Description copied from interface:IChangelistSummaryGet the user name of the user associated with this changelist.- Specified by:
getUsernamein interfaceIChangelistSummary- 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(java.lang.String username)
Description copied from interface:IChangelistSummarySet 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:
setUsernamein interfaceIChangelistSummary- Parameters:
username- new owner's user name.- See Also:
IChangelistSummary.setUsername(java.lang.String)
-
getStatus
public ChangelistStatus getStatus()
Description copied from interface:IChangelistSummaryGet the status of this changelist, if known.- Specified by:
getStatusin interfaceIChangelistSummary- Returns:
- IChangelistStatus status, or null if not known.
- See Also:
IChangelistSummary.getStatus()
-
setStatus
public void setStatus(ChangelistStatus status)
Description copied from interface:IChangelistSummarySet the changelist status. Will not cause the associated changelist to be updated on the Perforce server without a suitable update being performed.- Specified by:
setStatusin interfaceIChangelistSummary- Parameters:
status- status
-
getDate
public java.util.Date getDate()
Description copied from interface:IChangelistSummaryGet the date the changelist was created or last updated.- Specified by:
getDatein interfaceIChangelistSummary- Returns:
- the date the changelist was created or last updated, or null if unknown.
- See Also:
IChangelistSummary.getDate()
-
setDate
public void setDate(java.util.Date date)
Description copied from interface:IChangelistSummarySet the changelist date. Will not cause the associated changelist to be updated on the Perforce server without a suitable update being performed.- Specified by:
setDatein interfaceIChangelistSummary- Parameters:
date- new changelist date- See Also:
IChangelistSummary.setDate(java.util.Date)
-
getDescription
public java.lang.String getDescription()
Description copied from interface:IChangelistSummaryReturn the description associated with this changelist.- Specified by:
getDescriptionin interfaceIChangelistSummary- Returns:
- textual changelist description, or null if no such description.
- See Also:
IChangelistSummary.getDescription()
-
setDescription
public java.lang.String setDescription(java.lang.String description)
Description copied from interface:IChangelistSummarySet the description string for this changelist.- Specified by:
setDescriptionin interfaceIChangelistSummary- 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:IChangelistSummaryDoes this changelist contain at least one shelved file? This only applies to changelists whoseIChangelistSummary.getStatus()isChangelistStatus.PENDINGand that have been returned as IChangelistSummary objects. The value here is unreliable for full IChangelist objects returned from getChangelist, etc.- Specified by:
isShelvedin interfaceIChangelistSummary- Returns:
- - true if changelist contains shelved files, false otherwise
- See Also:
IChangelistSummary.isShelved()
-
setShelved
public void setShelved(boolean shelved)
Description copied from interface:IChangelistSummarySet the shelved status of of this changelist (see isShelved()).- Specified by:
setShelvedin interfaceIChangelistSummary- Parameters:
shelved- new shelved value.- See Also:
IChangelistSummary.setShelved(boolean)
-
getVisibility
public IChangelistSummary.Visibility getVisibility()
Description copied from interface:IChangelistSummaryGet the visibility associated with this changelist. May be null if no visibility is associated with this changelist.- Specified by:
getVisibilityin interfaceIChangelistSummary- Returns:
- possibly-null visibility.
- See Also:
IChangelistSummary.getVisibility()
-
setVisibility
public void setVisibility(IChangelistSummary.Visibility visibility)
Description copied from interface:IChangelistSummarySet the visibility associated with this changelist.- Specified by:
setVisibilityin interfaceIChangelistSummary- Parameters:
visibility- visability- See Also:
IChangelistSummary.setVisibility(com.perforce.p4java.core.IChangelistSummary.Visibility)
-
getChangelistStream
public java.lang.String getChangelistStream()
// * @see com.perforce.p4java.core.IChangelistSummary#getChangelistStream()- Specified by:
getChangelistStreamin interfaceIChangelistSummary- Returns:
- Stream path, or null if no such description.
-
-