Class BranchSpec

    • Field Detail

      • DEFAULT_DESCRIPTION

        public static final java.lang.String DEFAULT_DESCRIPTION
        Default description for use in newBranchSpec method when no explicit description is given.
        See Also:
        Constant Field Values
    • Constructor Detail

      • BranchSpec

        public BranchSpec()
        Default constructor. All fields set to null or false.
      • BranchSpec

        public BranchSpec​(java.lang.String name,
                          java.lang.String ownerName,
                          java.lang.String description,
                          boolean locked,
                          java.util.Date accessed,
                          java.util.Date updated,
                          ViewMap<IBranchMapping> branchView)
        Construct a new BranchSpec from explicit field values.
        Parameters:
        name - name
        ownerName - owner
        description - description
        locked - if locked
        accessed - date
        updated - date
        branchView - view mapping
      • BranchSpec

        public BranchSpec​(java.util.Map<java.lang.String,​java.lang.Object> map,
                          IServer server)
        Construct a BranchSpec from a map passed back from the Perforce server in response to a getBranchSpec command.
        Parameters:
        map - spec map
        server - server
      • BranchSpec

        public BranchSpec​(IBranchSpecSummary summary)
                   throws ConnectionException,
                          RequestException,
                          AccessException
        Construct a new BranchSpec from the passed-in summary branch spec. If the summary is null, this is equivalent to calling the default BranchSpec constructor; otherwise after name initialization a refresh() is done on the new (empty) BranchSpec.
        Parameters:
        summary - summary object
        Throws:
        ConnectionException - if the Perforce server is unreachable or is not connected.
        RequestException - if the Perforce server encounters an error during its processing of the request
        AccessException - if the Perforce server denies access to the caller
    • Method Detail

      • newBranchSpec

        public static BranchSpec newBranchSpec​(IOptionsServer server,
                                               java.lang.String name,
                                               java.lang.String description,
                                               java.lang.String[] branches)
        Simple factory / convenience method for creating a new local BranchSpec object with defult values.
        Parameters:
        server - non-null server to be associated with the new branch spec.
        name - non-null branch spec name.
        description - if not null, used as the new branc spec's description field; if null, uses the BranchSpec.DEFAULT_DESCRIPTION field.
        branches - if not null, use this as the list of branch spec paths, in the order given, and according to the format in MapEntry.parseViewMappingString; unlike many other core object factory methods, this one does not default if null.
        Returns:
        new local BranchSpec object.
      • update

        public void update()
                    throws ConnectionException,
                           RequestException,
                           AccessException
        Description copied from interface: IServerResource
        Update the Perforce server object associated with the underlying P4Java object, if possible. The semantics of server updates are generally object-specific and will be spelled out for each participating object.

        The results of calling this method on objects whose canUpdate method returns false are undefined (but will generally result in a UnimplementedError being thrown).

        Specified by:
        update in interface IServerResource
        Overrides:
        update in class ServerResource
        Throws:
        ConnectionException - if the Perforce server is unreachable or is not connected.
        RequestException - if the Perforce server encounters an error during its processing of the request
        AccessException - if the Perforce server denies access to the caller
        See Also:
        ServerResource.update()