2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.yangtools.yang.model.api.stmt;
10 import static com.google.common.base.Verify.verifyNotNull;
12 import org.eclipse.jdt.annotation.NonNull;
13 import org.eclipse.jdt.annotation.NonNullByDefault;
14 import org.opendaylight.yangtools.yang.model.api.YangStmtMapping;
15 import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
16 import org.opendaylight.yangtools.yang.model.api.meta.StatementDefinition;
18 public interface OrderedByStatement extends DeclaredStatement<OrderedByStatement.Ordering> {
24 private String argumentString;
26 Ordering(final String argumentString) {
27 this.argumentString = argumentString;
30 public String getArgumentString() {
31 return argumentString;
34 public static Ordering forArgumentString(final String argumentString) {
35 switch (argumentString) {
41 throw new IllegalArgumentException("Invalid ordering string '" + argumentString + "'");
47 default StatementDefinition statementDefinition() {
48 return YangStmtMapping.ORDERED_BY;
51 default @NonNull Ordering getValue() {
52 // FIXME: YANGTOOLS-908: verifyNotNull() should not be needed here
53 return verifyNotNull(argument());