1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package org.xwiki.logging.marker

File TranslationMarker.java

 

Coverage histogram

../../../../img/srcFileCovDistChart10.png
0% of files have more coverage

Code metrics

2
9
5
1
94
36
6
0.67
1.8
5
1.2

Classes

Class Line # Actions
TranslationMarker 30 9 0% 6 0
1.0100%
 

Contributing tests

This file is covered by 203 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.logging.marker;
21   
22    import org.slf4j.Marker;
23   
24    /**
25    * Allows associating a translation key to a log.
26    *
27    * @version $Id: 0c5b04a971c18973c90f30b13b89fb92e3d2ae92 $
28    * @since 5.4M1
29    */
 
30    public class TranslationMarker extends AbstractContainerMarker
31    {
32    /**
33    * The marker name.
34    */
35    public static final String NAME = "xwiki.translation";
36   
37    /**
38    * Serialization id.
39    */
40    private static final long serialVersionUID = 1L;
41   
42    /**
43    * @see #getTranslationKey()
44    */
45    private String translationKey;
46   
47    /**
48    * @param translationKey the translation key to associate to the log
49    */
 
50  223078 toggle public TranslationMarker(String translationKey)
51    {
52  223088 super(NAME);
53   
54  223067 this.translationKey = translationKey;
55    }
56   
57    /**
58    * @param translationKey the translation key to associate to the log
59    * @param references the other associated markers
60    */
 
61  744 toggle public TranslationMarker(String translationKey, Marker... references)
62    {
63  744 super(translationKey, references);
64   
65  744 this.translationKey = translationKey;
66    }
67   
68    /**
69    * @return the translation key associate to the log
70    */
 
71  5 toggle public String getTranslationKey()
72    {
73  5 return this.translationKey;
74    }
75   
76    // Object
77   
 
78  5 toggle @Override
79    public int hashCode()
80    {
81  5 return this.translationKey.hashCode();
82    }
83   
 
84  4803 toggle @Override
85    public boolean equals(Object other)
86    {
87  4803 if (this == other) {
88  1 return true;
89    }
90   
91  4802 return other instanceof TranslationMarker
92    && this.translationKey.equals(((TranslationMarker) other).getTranslationKey());
93    }
94    }