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.String
changelistStream
protected java.lang.String
clientId
protected java.util.Date
date
protected static java.lang.String
DATE_FORMAT
protected java.lang.String
description
protected int
id
protected boolean
shelved
protected ChangelistStatus
status
protected java.lang.String
username
protected IChangelistSummary.Visibility
visibility
-
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.String
getChangelistStream()
// * @see com.perforce.p4java.core.IChangelistSummary#getChangelistStream()java.lang.String
getClientId()
Get the ID of the Perforce client workspace associated with this changelist.java.util.Date
getDate()
Get the date the changelist was created or last updated.java.lang.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.java.lang.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 whoseIChangelistSummary.getStatus()
isChangelistStatus.PENDING
and that have been returned as IChangelistSummary objects.void
setClientId(java.lang.String clientId)
Set the client ID.void
setDate(java.util.Date date)
Set the changelist date.java.lang.String
setDescription(java.lang.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(java.lang.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, 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:IChangelistSummary
Return the Perforce changelist's ID.- Specified by:
getId
in 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: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 interfaceIChangelistSummary
- Parameters:
id
- new changelist ID.- See Also:
IChangelistSummary.setId(int)
-
getClientId
public java.lang.String getClientId()
Description copied from interface:IChangelistSummary
Get the ID of the Perforce client workspace associated with this changelist.- Specified by:
getClientId
in 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: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 interfaceIChangelistSummary
- Parameters:
clientId
- new client ID.- See Also:
IChangelistSummary.setClientId(java.lang.String)
-
getUsername
public java.lang.String getUsername()
Description copied from interface:IChangelistSummary
Get the user name of the user associated with this changelist.- Specified by:
getUsername
in 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: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 interfaceIChangelistSummary
- 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 interfaceIChangelistSummary
- 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 interfaceIChangelistSummary
- Parameters:
status
- status
-
getDate
public java.util.Date getDate()
Description copied from interface:IChangelistSummary
Get the date the changelist was created or last updated.- Specified by:
getDate
in 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: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 interfaceIChangelistSummary
- Parameters:
date
- new changelist date- See Also:
IChangelistSummary.setDate(java.util.Date)
-
getDescription
public java.lang.String getDescription()
Description copied from interface:IChangelistSummary
Return the description associated with this changelist.- Specified by:
getDescription
in 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:IChangelistSummary
Set the description string for this changelist.- Specified by:
setDescription
in 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:IChangelistSummary
Does this changelist contain at least one shelved file? This only applies to changelists whoseIChangelistSummary.getStatus()
isChangelistStatus.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 interfaceIChangelistSummary
- 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 interfaceIChangelistSummary
- 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 interfaceIChangelistSummary
- Returns:
- possibly-null visibility.
- See Also:
IChangelistSummary.getVisibility()
-
setVisibility
public void setVisibility(IChangelistSummary.Visibility visibility)
Description copied from interface:IChangelistSummary
Set the visibility associated with this changelist.- Specified by:
setVisibility
in 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:
getChangelistStream
in interfaceIChangelistSummary
- Returns:
- Stream path, or null if no such description.
-
-