1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package com.xpn.xwiki.doc

File XWikiLink.java

 

Coverage histogram

../../../../img/srcFileCovDistChart7.png
64% of files have more coverage

Code metrics

0
14
11
1
101
57
11
0.79
1.27
11
1

Classes

Class Line # Actions
24 14 0% 11 9
0.6464%
 

Contributing tests

No tests hitting this source file were found.

Source view

1    /*
2    * See the NOTICE file distributed with this work for additional
3    * information regarding copyright ownership.
4    *
5    * This is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU Lesser General Public License as
7    * published by the Free Software Foundation; either version 2.1 of
8    * the License, or (at your option) any later version.
9    *
10    * This software is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13    * Lesser General Public License for more details.
14    *
15    * You should have received a copy of the GNU Lesser General Public
16    * License along with this software; if not, write to the Free
17    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19    */
20    package com.xpn.xwiki.doc;
21   
22    import java.io.Serializable;
23   
 
24    public class XWikiLink implements Serializable
25    {
26    private long docId;
27   
28    private String link;
29   
30    private String fullName;
31   
 
32  490 toggle public XWikiLink()
33    {
34  490 this.setDocId(0);
35    }
36   
 
37  0 toggle public XWikiLink(long docId)
38    {
39  0 this.setDocId(docId);
40    }
41   
 
42  0 toggle public XWikiLink(long docId, String link, String fullName)
43    {
44  0 this.setDocId(docId);
45  0 this.setLink(link);
46  0 this.setFullName(fullName);
47    }
48   
49    /**
50    * @return the id of the document containing the link
51    */
 
52  1510 toggle public long getDocId()
53    {
54  1510 return this.docId;
55    }
56   
 
57  980 toggle public void setDocId(long docId)
58    {
59  980 this.docId = docId;
60    }
61   
 
62  980 toggle public void setLink(String link)
63    {
64  980 this.link = link;
65    }
66   
67    /**
68    * @return the serialized document reference of the link target (compact form without the wiki part if it matches
69    * the current wiki)
70    */
 
71  1470 toggle public String getLink()
72    {
73  1470 return this.link;
74    }
75   
76    /**
77    * @return the serialized reference of the document which contains the link (without the wiki part)
78    */
 
79  980 toggle public String getFullName()
80    {
81  980 return this.fullName;
82    }
83   
 
84  490 toggle public void setFullName(String fullName)
85    {
86  490 this.fullName = fullName;
87    }
88   
 
89  0 toggle @Override
90    public boolean equals(Object obj)
91    {
92  0 XWikiLink objlink = (XWikiLink) obj;
93  0 return (objlink.getDocId() == getDocId() && objlink.getLink().equals(getLink()));
94    }
95   
 
96  530 toggle @Override
97    public int hashCode()
98    {
99  530 return ("" + getDocId() + this.link).hashCode();
100    }
101    }