Fixed some major sonar issues in yang-validation-tool
[yangtools.git] / code-generator / binding-generator-impl / src / main / java / org / opendaylight / yangtools / sal / binding / generator / util / XtendHelper.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.generator.util;
9
10 import java.util.List;
11
12 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
13 import org.opendaylight.yangtools.yang.model.api.type.UnionTypeDefinition;
14
15 public final class XtendHelper {
16     private XtendHelper() {
17         throw new UnsupportedOperationException("Utility class should not be instantiated");
18     }
19
20     @SuppressWarnings({"rawtypes","unchecked"})
21     public static Iterable<TypeDefinition> getTypes(final UnionTypeDefinition definition) {
22         return (List) definition.getTypes();
23     }
24 }