Skip to content

Package: TypesSpecificationImpl

TypesSpecificationImpl

nameinstructionbranchcomplexitylinemethod
TypesSpecificationImpl(ManagedType, FetchType, Field, Class, boolean)
M: 0 C: 18
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 7
100%
M: 0 C: 1
100%
getDeclaringType()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getElementType()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getFetchType()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getJavaField()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getJavaType()
M: 0 C: 2
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getName()
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
includeExplicit()
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%
isCollection()
M: 0 C: 2
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
isInferred()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%

Coverage

1: /**
2: * Copyright (C) 2022 Czech Technical University in Prague
3: *
4: * This program is free software: you can redistribute it and/or modify it under
5: * the terms of the GNU General Public License as published by the Free Software
6: * Foundation, either version 3 of the License, or (at your option) any
7: * later version.
8: *
9: * This program is distributed in the hope that it will be useful, but WITHOUT
10: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11: * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12: * details. You should have received a copy of the GNU General Public License
13: * along with this program. If not, see <http://www.gnu.org/licenses/>.
14: */
15: package cz.cvut.kbss.jopa.model.metamodel;
16:
17: import cz.cvut.kbss.jopa.model.annotations.FetchType;
18:
19: import java.lang.reflect.Field;
20: import java.util.Set;
21:
22: public class TypesSpecificationImpl<X, Y> implements TypesSpecification<X, Y> {
23: private final ManagedType<X> declaringType;
24: private final FetchType fetchType;
25: private final Field javaField;
26: private final Class<Y> elementType;
27: private final boolean inferred;
28:
29: public TypesSpecificationImpl(final ManagedType<X> declaringType,
30: final FetchType fetchType, final Field javaField,
31: final Class<Y> elementType, boolean inferred) {
32: this.declaringType = declaringType;
33: this.fetchType = fetchType;
34: this.javaField = javaField;
35: this.elementType = elementType;
36: this.inferred = inferred;
37: }
38:
39: @Override
40: public ManagedType<X> getDeclaringType() {
41: return declaringType;
42: }
43:
44: @Override
45: public FetchType getFetchType() {
46: return fetchType;
47: }
48:
49: @Override
50: public Field getJavaField() {
51: return javaField;
52: }
53:
54: @Override
55: public Class<Set> getJavaType() {
56: return Set.class;
57: }
58:
59: @Override
60: public Class<Y> getElementType() {
61: return elementType;
62: }
63:
64: @Override
65: public boolean isInferred() {
66: return inferred;
67: }
68:
69: @Override
70: public boolean includeExplicit() {
71: // TODO
72: return true;
73: }
74:
75: @Override
76: public String getName() {
77: return javaField.getName();
78: }
79:
80: @Override
81: public boolean isCollection() {
82: return true;
83: }
84: }