Merge "Added tests for yang.model.util"
[yangtools.git] / code-generator / binding-model-api / src / main / java / org / opendaylight / yangtools / sal / binding / model / api / BoxableType.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.sal.binding.model.api;
9
10 /**
11  * Implementing this interface allows an object to hold information about that if
12  * is generated type suitable for boxing.
13  *
14  * Example:
15  * choice foo-choice {
16  *   case foo-case {
17  *     container foo {
18  *           ...
19  *     }
20  *   }
21  * }
22  *
23  * Suitable type have to implements ChildOf<T>, where !(T instanceof Identifiable) and
24  * T does not place any structural requirements (must/when) on existence/value Foo.
25  */
26 public interface BoxableType {
27
28     /**
29      * Check if generated type is suitable for boxing.
30      *
31      * @return true if generated type is suitable for boxing, false otherwise.
32      */
33     boolean isSuitableForBoxing();
34 }