Fix license header violations in yang-model-util
[yangtools.git] / yang / yang-model-util / src / main / java / org / opendaylight / yangtools / yang / model / util / repo / SchemaSourceTransformation.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.util.repo;
9
10 import com.google.common.annotations.Beta;
11
12 /**
13  *
14  * Schema Source Transformation which transforms from one schema source
15  * representation to another.
16  *
17  * <p>
18  * <b>Representation of Schema Source</b>
19  * <p>
20  * Schema source may be represented by
21  * various Java Types, which depends on provider and/or consumer.
22  * <p>
23  * E.g example of possible representations:
24  * <ul>
25  * <li>{@link String}
26  * <li>{@link java.io.InputStream}
27  * <li>{@link com.google.common.io.ByteSource}
28  * </ul>
29  *
30  * FIXME: <b>Beta:</b> Consider allowing transformations, which may
31  * fail to produce Output, this will require introduction of
32  * checked exception.
33  *
34  * @param <I> Input schema source representation
35  * @param <O> Output schema source representation
36  *
37  * @deprecated Replaced with {@link org.opendaylight.yangtools.yang.model.repo.util.SchemaSourceTransformer}
38  */
39 @Beta
40 @Deprecated
41 public interface SchemaSourceTransformation<I, O> {
42
43     /**
44      *
45      * Transforms supplied schema source in format <code>I</code> to schema
46      * source in format <code>O</code>.
47      *
48      * <ul>
49      * <li>Its execution does not cause any observable side effects.
50      * <li>If the contents of a,b are semantically same (e.g. contents of InputStream),
51      * output representations MUST BE also semantically equals.
52      * </ul>
53      *
54      * Implementations of transformation SHOULD NOT fail to
55      * transform valid non-null input to output representation.
56      *
57      *
58      * FIXME: <b>Beta:</b> Consider lowering condition for safe transformation
59      * and introduce checked exception for cases when transformation may fail.
60      *
61      * @param input Not null input which should be transformed
62      * @return Representation of input in <code>O</code> format.
63      * @throws NullPointerException if input is null.
64      *
65      */
66     @Beta
67     O transform(I input);
68 }