Merge "Runtime Codec cleanup"
[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/eplv10.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.SourceIdentifier;
14 import org.opendaylight.yangtools.yang.model.repo.spi.SchemaSourceProvider;
15 import org.opendaylight.yangtools.yang.model.repo.spi.SchemaSourceRegistration;
16
17 public abstract class AbstractSchemaSourceRegistration extends AbstractObjectRegistration<SourceIdentifier> implements SchemaSourceRegistration {
18     private final SchemaSourceProvider<?> provider;
19
20     protected AbstractSchemaSourceRegistration(final SourceIdentifier identifier, final SchemaSourceProvider<?> provider) {
21         super(identifier);
22         this.provider = Preconditions.checkNotNull(provider);
23     }
24
25     protected SchemaSourceProvider<?> getProvider() {
26         return provider;
27     }
28 }