*/
package org.opendaylight.yangtools.yang.model.util;
-import com.google.common.base.Preconditions;
+import static java.util.Objects.requireNonNull;
+
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import java.util.HashMap;
public EffectiveAugmentationSchema(final AugmentationSchemaNode augmentSchema,
final Set<DataSchemaNode> realChildSchemas) {
- this.delegate = Preconditions.checkNotNull(augmentSchema);
+ this.delegate = requireNonNull(augmentSchema);
this.realChildSchemas = ImmutableSet.copyOf(realChildSchemas);
final Map<QName, DataSchemaNode> m = new HashMap<>(realChildSchemas.size());
}
@Override
- public DataSchemaNode getDataChildByName(final QName name) {
- return mappedChildSchemas.get(name);
+ public Optional<DataSchemaNode> findDataChildByName(final QName name) {
+ return Optional.ofNullable(mappedChildSchemas.get(requireNonNull(name)));
}
@Override