- public Optional<DOMMountPoint> getMountPoint(final InstanceIdentifier path) {
- return Optional.<DOMMountPoint>fromNullable(mountPoints.get(path));
+ public Optional<DOMMountPoint> getMountPoint(final YangInstanceIdentifier path) {
+ final Optional<org.opendaylight.mdsal.dom.api.DOMMountPoint> delegateMountPoint = delegate.getMountPoint(path);
+ return delegateMountPoint.isPresent() ? Optional.of(convert(delegateMountPoint.get())) : Optional.absent();
+ }
+
+ private DOMMountPoint convert(final org.opendaylight.mdsal.dom.api.DOMMountPoint from) {
+ return new DOMMountPoint() {
+ @Override
+ public YangInstanceIdentifier getIdentifier() {
+ return from.getIdentifier();
+ }
+
+ @Override
+ public <T extends DOMService> Optional<T> getService(Class<T> cls) {
+ return from.getService(cls);
+ }
+
+ @Override
+ public SchemaContext getSchemaContext() {
+ return from.getSchemaContext();
+ }
+
+ @Override
+ public int hashCode() {
+ return from.getIdentifier().hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+
+ if (!(obj instanceof DOMMountPoint)) {
+ return false;
+ }
+
+ DOMMountPoint other = (DOMMountPoint) obj;
+ return from.getIdentifier().equals(other.getIdentifier());
+ }
+ };