@author Lukas Eder
| 50 | * @author Lukas Eder |
| 51 | */ |
| 52 | abstract class AbstractScope implements Scope { |
| 53 | |
| 54 | final Configuration configuration; |
| 55 | final Map<Object, Object> data; |
| 56 | final Instant creationTime; |
| 57 | |
| 58 | AbstractScope(Configuration configuration) { |
| 59 | this(configuration, null); |
| 60 | } |
| 61 | |
| 62 | AbstractScope(Configuration configuration, Map<Object, Object> data) { |
| 63 | |
| 64 | // The Configuration can be null when unattached objects are |
| 65 | // executed or when unattached Records are stored... |
| 66 | if (configuration == null) |
| 67 | configuration = new DefaultConfiguration(); |
| 68 | |
| 69 | if (data == null) |
| 70 | data = new DataMap(); |
| 71 | |
| 72 | this.configuration = configuration; |
| 73 | this.data = data; |
| 74 | this.creationTime = configuration.clock().instant(); |
| 75 | } |
| 76 | |
| 77 | // ------------------------------------------------------------------------ |
| 78 | // XXX Scope API |
| 79 | // ------------------------------------------------------------------------ |
| 80 | |
| 81 | @Override |
| 82 | public final Instant creationTime() { |
| 83 | return creationTime; |
| 84 | } |
| 85 | |
| 86 | @Override |
| 87 | public final Configuration configuration() { |
| 88 | return configuration; |
| 89 | } |
| 90 | |
| 91 | @Override |
| 92 | public final DSLContext dsl() { |
| 93 | return configuration.dsl(); |
| 94 | } |
| 95 | |
| 96 | @Override |
| 97 | public final Settings settings() { |
| 98 | return configuration.settings(); |
| 99 | } |
| 100 | |
| 101 | @Override |
| 102 | public final SQLDialect dialect() { |
| 103 | return configuration.dialect(); |
| 104 | } |
| 105 | |
| 106 | @Override |
| 107 | public final SQLDialect family() { |
| 108 | return configuration.family(); |
| 109 | } |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…