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

File AbstractWrappingObject.java

 

Coverage histogram

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

Code metrics

0
5
5
1
71
28
5
1
1
5
1

Classes

Class Line # Actions
AbstractWrappingObject 29 5 0% 5 0
1.0100%
 

Contributing tests

This file is covered by 22 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.script.wrap;
21   
22    /**
23    * Wrap an Object.
24    *
25    * @param <T> the type of the wrapped object
26    * @version $Id: a0e67cae0fbf14ae871d68e78f513d58a1334f21 $
27    * @since 4.0M1
28    */
 
29    public abstract class AbstractWrappingObject<T>
30    {
31    /**
32    * @see #getWrapped()
33    */
34    private T wrapped;
35   
36    /**
37    * @param wrapped the wrapped object
38    */
 
39  8350 toggle public AbstractWrappingObject(T wrapped)
40    {
41  8350 this.wrapped = wrapped;
42    }
43   
44    /**
45    * @return the wrapped object
46    */
 
47  21714 toggle protected T getWrapped()
48    {
49  21713 return this.wrapped;
50    }
51   
52    // Object
53   
 
54  617 toggle @Override
55    public int hashCode()
56    {
57  617 return getWrapped().hashCode();
58    }
59   
 
60  33 toggle @Override
61    public boolean equals(Object obj)
62    {
63  33 return getWrapped().equals(obj);
64    }
65   
 
66  6300 toggle @Override
67    public String toString()
68    {
69  6300 return getWrapped().toString();
70    }
71    }