Fix license header violations in yang-model-util
[yangtools.git] / yang / yang-model-util / src / main / java / org / opendaylight / yangtools / yang / model / repo / util / AbstractSchemaSourceRegistration.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.yangtools.yang.model.repo.util;
9
10 import com.google.common.base.Preconditions;
11
12 import org.opendaylight.yangtools.concepts.AbstractObjectRegistration;
13 import org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation;
14 import org.opendaylight.yangtools.yang.model.repo.spi.PotentialSchemaSource;
15 import org.opendaylight.yangtools.yang.model.repo.spi.SchemaSourceProvider;
16 import org.opendaylight.yangtools.yang.model.repo.spi.SchemaSourceRegistration;
17
18 public abstract class AbstractSchemaSourceRegistration<T extends SchemaSourceRepresentation> extends AbstractObjectRegistration<PotentialSchemaSource<T>> implements SchemaSourceRegistration<T> {
19     private final SchemaSourceProvider<?> provider;
20
21     protected AbstractSchemaSourceRegistration(final SchemaSourceProvider<?> provider, final PotentialSchemaSource<T> source) {
22         super(source);
23         this.provider = Preconditions.checkNotNull(provider);
24     }
25
26     protected final SchemaSourceProvider<?> getProvider() {
27         return provider;
28     }
29 }