Skip to content

Method: TargetClassResolverConfig()

1: /*
2: * JB4JSON-LD
3: * Copyright (C) 2023 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.jsonld.deserialization.util;
19:
20: /**
21: * Configuration object for the {@link TargetClassResolver}.
22: */
23: public final class TargetClassResolverConfig {
24:
25: private final boolean allowAssumingTargetType;
26: private final boolean optimisticTypeResolutionEnabled;
27: private final boolean preferSuperclass;
28:
29: public TargetClassResolverConfig() {
30: this.allowAssumingTargetType = false;
31: this.optimisticTypeResolutionEnabled = false;
32: this.preferSuperclass = false;
33: }
34:
35: public TargetClassResolverConfig(boolean allowAssumingTargetType, boolean optimisticTypeResolutionEnabled,
36: boolean preferSuperclass) {
37: this.allowAssumingTargetType = allowAssumingTargetType;
38: this.optimisticTypeResolutionEnabled = optimisticTypeResolutionEnabled;
39: this.preferSuperclass = preferSuperclass;
40: }
41:
42: public boolean shouldAllowAssumingTargetType() {
43: return allowAssumingTargetType;
44: }
45:
46: public boolean isOptimisticTypeResolutionEnabled() {
47: return optimisticTypeResolutionEnabled;
48: }
49:
50: public boolean shouldPreferSuperclass() {
51: return preferSuperclass;
52: }
53: }