1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package org.xwiki.lesscss.internal.skin

File FSSkinReference.java

 

Coverage histogram

../../../../../img/srcFileCovDistChart9.png
38% of files have more coverage

Code metrics

2
9
6
1
75
35
7
0.78
1.5
6
1.17

Classes

Class Line # Actions
FSSkinReference 28 9 0% 7 2
0.8823529588.2%
 

Contributing tests

This file is covered by 13 tests. .

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 org.xwiki.lesscss.internal.skin;
21   
22    /**
23    * A specialized implementation of {@link SkinReference} for any skin stored in the filesystem.
24    *
25    * @version $Id: ea05b8ecc439bd1efb47866c45793b39bad6d92e $
26    * @since 6.4M2
27    */
 
28    public class FSSkinReference implements SkinReference
29    {
30    private String skinName;
31   
32    /**
33    * Construct a new reference to a filesystem skin.
34    * @param skinName name of the skin on the filesystem
35    */
 
36  2211 toggle public FSSkinReference(String skinName)
37    {
38  2211 this.skinName = skinName;
39    }
40   
41    /**
42    * @return the name of the skin on the filesystem
43    */
 
44  1 toggle public String getSkinName()
45    {
46  1 return skinName;
47    }
48   
 
49  47 toggle @Override
50    public boolean equals(Object o) {
51  47 if (o instanceof FSSkinReference) {
52  47 FSSkinReference fsSkinReference = (FSSkinReference) o;
53  47 return skinName.equals(fsSkinReference.skinName);
54    }
55  0 return false;
56    }
57   
 
58  149 toggle @Override
59    public int hashCode() {
60  149 return skinName.hashCode();
61    }
62   
 
63  4397 toggle @Override
64    public String serialize()
65    {
66  4397 return String.format("SkinFS[%s]", skinName);
67    }
68   
 
69  1 toggle @Override
70    public String toString()
71    {
72  1 return serialize();
73    }
74   
75    }