2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.yangtools.yang.model.repo.util;
10 import static java.util.Objects.requireNonNull;
12 import com.google.common.base.MoreObjects.ToStringHelper;
13 import org.opendaylight.yangtools.concepts.AbstractObjectRegistration;
14 import org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation;
15 import org.opendaylight.yangtools.yang.model.repo.spi.PotentialSchemaSource;
16 import org.opendaylight.yangtools.yang.model.repo.spi.SchemaSourceProvider;
17 import org.opendaylight.yangtools.yang.model.repo.spi.SchemaSourceRegistration;
19 public abstract class AbstractSchemaSourceRegistration<T extends SchemaSourceRepresentation>
20 extends AbstractObjectRegistration<PotentialSchemaSource<T>> implements SchemaSourceRegistration<T> {
21 private final SchemaSourceProvider<?> provider;
23 protected AbstractSchemaSourceRegistration(final SchemaSourceProvider<?> provider,
24 final PotentialSchemaSource<T> source) {
26 this.provider = requireNonNull(provider);
29 public final SchemaSourceProvider<?> getProvider() {
34 protected ToStringHelper addToStringAttributes(final ToStringHelper toStringHelper) {
35 return super.addToStringAttributes(toStringHelper).add("provider", provider);