import java.util.Collection;
import java.util.Optional;
import java.util.stream.Stream;
-import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import org.eclipse.jdt.annotation.NonNull;
*
* @return Collection of statements, which were explicitly declared in source of model.
*/
- @Nonnull Collection<? extends DeclaredStatement<?>> declaredSubstatements();
+ @NonNull Collection<? extends DeclaredStatement<?>> declaredSubstatements();
/**
* Returns collection of explicitly declared child statements, while preserving its original ordering from original
import com.google.common.collect.ImmutableList;
import java.util.Collection;
import java.util.Objects;
-import javax.annotation.Nonnull;
import org.opendaylight.yangtools.yang.model.api.YangStmtMapping;
import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
abstract EffectiveStatement<Boolean, ConfigStatement> toEffective();
- @Nonnull
@Override
public final Collection<? extends DeclaredStatement<?>> declaredSubstatements() {
return ImmutableList.of();
}
- @Nonnull
@Override
public final StatementDefinition statementDefinition() {
return YangStmtMapping.CONFIG;
return Boolean.toString(getValue());
}
- @Nonnull
@Override
public final StatementSource getStatementSource() {
return StatementSource.DECLARATION;
import com.google.common.collect.ImmutableList;
import java.util.Collection;
import java.util.Objects;
-import javax.annotation.Nonnull;
import org.opendaylight.yangtools.yang.model.api.YangStmtMapping;
import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
abstract EffectiveStatement<Boolean, MandatoryStatement> toEffective();
- @Nonnull
@Override
public final Collection<? extends DeclaredStatement<?>> declaredSubstatements() {
return ImmutableList.of();
}
- @Nonnull
@Override
public final StatementDefinition statementDefinition() {
return YangStmtMapping.MANDATORY;
return getValue().toString();
}
- @Nonnull
@Override
public final StatementSource getStatementSource() {
return StatementSource.DECLARATION;
import com.google.common.collect.ImmutableMap.Builder;
import java.util.Collection;
import java.util.Map;
-import javax.annotation.Nonnull;
import org.opendaylight.yangtools.yang.model.api.YangStmtMapping;
import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
import org.opendaylight.yangtools.yang.model.api.meta.StatementDefinition;
return argument;
}
- @Nonnull
@Override
public Collection<? extends DeclaredStatement<?>> declaredSubstatements() {
return ImmutableList.of();
}
- @Nonnull
@Override
public StatementDefinition statementDefinition() {
return YangStmtMapping.TYPE;
}
- @Nonnull
@Override
public StatementSource getStatementSource() {
return StatementSource.DECLARATION;
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*/
-
package org.opendaylight.yangtools.yang.parser.spi.meta;
import com.google.common.collect.Collections2;
import com.google.common.collect.ImmutableList;
import java.util.Collection;
-import javax.annotation.Nonnull;
+import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
import org.opendaylight.yangtools.yang.model.api.meta.StatementDefinition;
import org.opendaylight.yangtools.yang.model.api.meta.StatementSource;
* @param <A> Argument type.
*/
public abstract class AbstractDeclaredStatement<A> implements DeclaredStatement<A> {
+ private final @NonNull ImmutableList<? extends DeclaredStatement<?>> substatements;
+ private final @NonNull StatementDefinition definition;
+ private final @NonNull StatementSource source;
+
private final A argument;
private final String rawArgument;
- private final ImmutableList<? extends DeclaredStatement<?>> substatements;
- private final StatementDefinition definition;
- private final StatementSource source;
- protected AbstractDeclaredStatement(final StmtContext<A,?,?> context) {
+ protected AbstractDeclaredStatement(final StmtContext<A, ?, ?> context) {
rawArgument = context.rawStatementArgument();
argument = context.getStatementArgument();
source = context.getStatementSource();
return argument;
}
- @Nonnull
@Override
public StatementDefinition statementDefinition() {
return definition;
}
- @Nonnull
@Override
public Collection<? extends DeclaredStatement<?>> declaredSubstatements() {
return substatements;
}
- @Nonnull
@Override
public StatementSource getStatementSource() {
return source;