public final class StatementSupportBundle implements Immutable,NamespaceBehaviour.Registry {
- private static final StatementSupportBundle EMPTY = new StatementSupportBundle(null, ImmutableMap.<QName, StatementSupport<?, ?, ?>>of(), ImmutableMap.<Class<?>, NamespaceBehaviour<?, ?, ?>>of());
+ private static final StatementSupportBundle EMPTY = new StatementSupportBundle(null, ImmutableMap.of(), ImmutableMap.of());
private final StatementSupportBundle parent;
private final ImmutableMap<QName, StatementSupport<?,?,?>> definitions;
private final ImmutableMap<Class<?>, NamespaceBehaviour<?, ?, ?>> namespaceDefinitions;
private StatementSupportBundle(StatementSupportBundle parent,
- ImmutableMap<QName, StatementSupport<?, ?, ?>> statements,
- ImmutableMap<Class<?>, NamespaceBehaviour<?, ?, ?>> namespaces) {
+ ImmutableMap<QName, StatementSupport<?, ?, ?>> statements,
+ ImmutableMap<Class<?>, NamespaceBehaviour<?, ?, ?>> namespaces) {
this.parent = parent;
this.definitions = statements;
this.namespaceDefinitions = namespaces;
}
+ public ImmutableMap<QName, StatementSupport<?, ?, ?>> getDefinitions() {
+ return definitions;
+ }
+
public static Builder builder() {
return new Builder(EMPTY);
}
* Safe cast, previous checkState checks equivalence of key from
* which type argument are derived
*/
- @SuppressWarnings("unchecked")
- NamespaceBehaviour<K, V, N> casted = (NamespaceBehaviour<K, V, N>) potential;
- return casted;
+ return (NamespaceBehaviour<K, V, N>) potential;
}
if (parent != null) {
return parent.getNamespaceBehaviour(namespace);