Package: NothingType

NothingType

nameinstructionbranchcomplexitylinemethod
NothingType(String)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
equals(Object)
M: 9 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getMessage()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getType()
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
hashCode()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
isAssignableFrom(IType)
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
toString()
M: 11 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2015 Obeo.
3: * All rights reserved. This program and the accompanying materials
4: * are made available under the terms of the Eclipse Public License v1.0
5: * which accompanies this distribution, and is available at
6: * http://www.eclipse.org/legal/epl-v10.html
7: *
8: * Contributors:
9: * Obeo - initial API and implementation
10: *******************************************************************************/
11: package org.eclipse.acceleo.query.validation.type;
12:
13: import org.eclipse.acceleo.query.runtime.impl.Nothing;
14:
15: /**
16: * Nothing validation type. Used when no type can be found.
17: *
18: * @author <a href="mailto:yvan.lussaud@obeo.fr">Yvan Lussaud</a>
19: */
20: public final class NothingType extends AbstractType implements IJavaType {
21:
22:         /**
23:          * The {@link Class}.
24:          */
25:         private final String message;
26:
27:         /**
28:          * Constructor.
29:          *
30:          * @param message
31:          * the message
32:          */
33:         public NothingType(String message) {
34:                 this.message = message;
35:         }
36:
37:         /**
38:          * Gets the message.
39:          *
40:          * @return the message
41:          */
42:         public String getMessage() {
43:                 return message;
44:         }
45:
46:         /**
47:          * {@inheritDoc}
48:          *
49:          * @see org.eclipse.acceleo.query.validation.type.IType#getType()
50:          */
51:         @Override
52:         public Class<?> getType() {
53:                 return Nothing.class;
54:         }
55:
56:         /**
57:          * {@inheritDoc}
58:          *
59:          * @see java.lang.Object#toString()
60:          */
61:         @Override
62:         public String toString() {
63:                 return "Nothing(" + message + ")";
64:         }
65:
66:         /**
67:          * Makes sure each nothing is unique. {@inheritDoc}
68:          *
69:          * @see org.eclipse.acceleo.query.validation.type.AbstractType#hashCode()
70:          */
71:         @Override
72:         public int hashCode() {
73:                 return System.identityHashCode(this);
74:         }
75:
76:         /**
77:          * Makes sure each nothing is unique. {@inheritDoc}
78:          *
79:          * @see org.eclipse.acceleo.query.validation.type.AbstractType#equals(java.lang.Object)
80:          */
81:         @Override
82:         public boolean equals(Object obj) {
83:•                return System.identityHashCode(this) == System.identityHashCode(obj);
84:         }
85:
86:         /**
87:          * {@inheritDoc}
88:          *
89:          * @see org.eclipse.acceleo.query.validation.type.IType#isAssignableFrom(org.eclipse.acceleo.query.validation.type.IType)
90:          */
91:         @Override
92:         public boolean isAssignableFrom(IType type) {
93:                 return false;
94:         }
95:
96: }