1 /**
2  * @copyright
3  * ====================================================================
4  *    Licensed to the Apache Software Foundation (ASF) under one
5  *    or more contributor license agreements.  See the NOTICE file
6  *    distributed with this work for additional information
7  *    regarding copyright ownership.  The ASF licenses this file
8  *    to you under the Apache License, Version 2.0 (the
9  *    "License"); you may not use this file except in compliance
10  *    with the License.  You may obtain a copy of the License at
11  *
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  *
14  *    Unless required by applicable law or agreed to in writing,
15  *    software distributed under the License is distributed on an
16  *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17  *    KIND, either express or implied.  See the License for the
18  *    specific language governing permissions and limitations
19  *    under the License.
20  * ====================================================================
21  * @endcopyright
22  */
23 
24 package org.tigris.subversion.javahl;
25 
26 /**
27  * The description of a merge conflict, encountered during
28  * merge/update/switch operations.
29  *
30  * @since 1.6
31  */
32 public class ConflictVersion
33 {
34     private String reposURL;
35     private long pegRevision;
36     private String pathInRepos;
37 
38     /**
39      * @see NodeKind
40      */
41     private int nodeKind;
42 
43     /** This constructor should only be called from JNI code. */
ConflictVersion(String reposURL, long pegRevision, String pathInRepos, int nodeKind)44     ConflictVersion(String reposURL, long pegRevision, String pathInRepos,
45                     int nodeKind)
46     {
47         this.reposURL = reposURL;
48         this.pegRevision = pegRevision;
49         this.pathInRepos = pathInRepos;
50         this.nodeKind = nodeKind;
51     }
52 
53     /**
54      * A backward-compat constructor.
55      */
ConflictVersion(org.apache.subversion.javahl.types.ConflictVersion aVer)56     public ConflictVersion(org.apache.subversion.javahl.types.ConflictVersion aVer)
57     {
58         this(aVer.getReposURL(), aVer.getPegRevision(), aVer.getPathInRepos(),
59              NodeKind.fromApache(aVer.getNodeKind()));
60     }
61 
getReposURL()62     public String getReposURL()
63     {
64         return reposURL;
65     }
66 
getPegRevision()67     public long getPegRevision()
68     {
69         return pegRevision;
70     }
71 
getPathInRepos()72     public String getPathInRepos()
73     {
74         return pathInRepos;
75     }
76 
77     /**
78      * @see NodeKind
79      */
getNodeKind()80     public int getNodeKind()
81     {
82         return nodeKind;
83     }
84 
toString()85     public String toString() {
86         return "(" + NodeKind.getNodeKindName(nodeKind) + ") " + reposURL +
87         "/" + pathInRepos + "@" + pegRevision;
88     }
89 }
90