|
34 | 34 | * @author Steve Ebersole
|
35 | 35 | * @author Gavin King
|
36 | 36 | */
|
37 |
| -public abstract class AttributeNodeImpl<J, E, K> |
| 37 | +public abstract sealed class AttributeNodeImpl<J, E, K> |
38 | 38 | extends AbstractGraphNode<J>
|
39 |
| - implements AttributeNodeImplementor<J, E, K> { |
| 39 | + implements AttributeNodeImplementor<J, E, K> |
| 40 | + permits AttributeNodeImpl.SingularAttributeNodeImpl, |
| 41 | + AttributeNodeImpl.PluralAttributeNodeImpl, |
| 42 | + AttributeNodeImpl.MapAttributeNodeImpl { |
40 | 43 |
|
41 | 44 | protected final PersistentAttribute<?, J> attribute;
|
42 | 45 | protected final DomainType<E> valueGraphType;
|
@@ -100,7 +103,7 @@ private AttributeNodeImpl(AttributeNodeImpl<J, E, K> that, boolean mutable) {
|
100 | 103 | keySubgraph = that.keySubgraph == null ? null : that.keySubgraph.makeCopy( mutable );
|
101 | 104 | }
|
102 | 105 |
|
103 |
| - private static class SingularAttributeNodeImpl<J> extends AttributeNodeImpl<J, J, Void> { |
| 106 | + static final class SingularAttributeNodeImpl<J> extends AttributeNodeImpl<J, J, Void> { |
104 | 107 | private SingularAttributeNodeImpl(
|
105 | 108 | SingularPersistentAttribute<?,J> attribute,
|
106 | 109 | boolean mutable,
|
@@ -128,7 +131,7 @@ public AttributeNodeImplementor<J, J, Void> makeCopy(boolean mutable) {
|
128 | 131 | }
|
129 | 132 | }
|
130 | 133 |
|
131 |
| - private static class PluralAttributeNodeImpl<J,E> extends AttributeNodeImpl<J, E, Void> { |
| 134 | + static final class PluralAttributeNodeImpl<J,E> extends AttributeNodeImpl<J, E, Void> { |
132 | 135 | private PluralAttributeNodeImpl(
|
133 | 136 | PluralPersistentAttribute<?,J,E> attribute,
|
134 | 137 | boolean mutable,
|
@@ -156,7 +159,7 @@ public AttributeNodeImplementor<J, E, Void> makeCopy(boolean mutable) {
|
156 | 159 | }
|
157 | 160 | }
|
158 | 161 |
|
159 |
| - static class MapAttributeNodeImpl<J,K,V> extends AttributeNodeImpl<J, V, K> { |
| 162 | + static final class MapAttributeNodeImpl<J,K,V> extends AttributeNodeImpl<J, V, K> { |
160 | 163 | private MapAttributeNodeImpl(
|
161 | 164 | PluralPersistentAttribute<?,J,V> pluralAttribute,
|
162 | 165 | @SuppressWarnings("unused") // a "witness" that this is really a Map
|
|
0 commit comments