Skip to content

Package: RDFCollectionAttribute

RDFCollectionAttribute

nameinstructionbranchcomplexitylinemethod
RDFCollectionAttribute(RDFCollectionAttribute.RDFCollectionAttributeBuilder)
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
builder(PropertyAttributes)
M: 0 C: 8
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
isRDFCollection()
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%
toString()
M: 4 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: * JOPA
3: * Copyright (C) 2024 Czech Technical University in Prague
4: *
5: * This library is free software; you can redistribute it and/or
6: * modify it under the terms of the GNU Lesser General Public
7: * License as published by the Free Software Foundation; either
8: * version 3.0 of the License, or (at your option) any later version.
9: *
10: * This library 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 library.
17: */
18: package cz.cvut.kbss.jopa.model.metamodel;
19:
20: import cz.cvut.kbss.jopa.model.IRI;
21: import cz.cvut.kbss.jopa.model.annotations.SequenceType;
22: import cz.cvut.kbss.jopa.oom.converter.ConverterWrapper;
23: import cz.cvut.kbss.jopa.vocabulary.RDF;
24:
25: import java.util.List;
26:
27: public class RDFCollectionAttribute<X, V> extends ListAttributeImpl<X, V> {
28:
29: RDFCollectionAttribute(RDFCollectionAttributeBuilder<X, V> builder) {
30: super(builder);
31: }
32:
33: @Override
34: public boolean isRDFCollection() {
35: return true;
36: }
37:
38: @Override
39: public String toString() {
40: return "RDFCollectionAttribute[" + getName() + "]";
41: }
42:
43: static RDFCollectionAttributeBuilder builder(PropertyAttributes config) {
44: return new RDFCollectionAttributeBuilder().collectionType(List.class).config(config);
45: }
46:
47: static class RDFCollectionAttributeBuilder<X, V> extends ListAttributeBuilder<X, V> {
48:
49: RDFCollectionAttributeBuilder() {
50: owlListClass(IRI.create(RDF.LIST));
51: hasNextProperty(IRI.create(RDF.REST));
52: hasContentsProperty(IRI.create(RDF.FIRST));
53: sequenceType(SequenceType.referenced);
54: }
55:
56: @Override
57: public RDFCollectionAttributeBuilder<X, V> config(PropertyAttributes config) {
58: super.config(config);
59: return this;
60: }
61:
62: @Override
63: public RDFCollectionAttributeBuilder<X, V> collectionType(Class<List<V>> collectionType) {
64: super.collectionType(collectionType);
65: return this;
66: }
67:
68: @Override
69: public RDFCollectionAttributeBuilder<X, V> elementType(Type<V> elementType) {
70: super.elementType(elementType);
71: return this;
72: }
73:
74: @Override
75: public RDFCollectionAttributeBuilder<X, V> propertyInfo(PropertyInfo propertyInfo) {
76: super.propertyInfo(propertyInfo);
77: return this;
78: }
79:
80: @Override
81: public RDFCollectionAttributeBuilder<X, V> declaringType(ManagedType<X> declaringType) {
82: super.declaringType(declaringType);
83: return this;
84: }
85:
86: @Override
87: public RDFCollectionAttributeBuilder<X, V> inferred(boolean inferred) {
88: super.inferred(inferred);
89: return this;
90: }
91:
92: @Override
93: public RDFCollectionAttributeBuilder<X, V> includeExplicit(boolean includeExplicit) {
94: super.includeExplicit(includeExplicit);
95: return this;
96: }
97:
98: @Override
99: public RDFCollectionAttributeBuilder<X, V> converter(ConverterWrapper converter) {
100: super.converter(converter);
101: return this;
102: }
103:
104: @Override
105: public RDFCollectionAttribute<X, V> build() {
106: return new RDFCollectionAttribute<>(this);
107: }
108: }
109: }