*/
package org.opendaylight.yangtools.yang.parser.stmt.rfc6020;
+import org.opendaylight.yangtools.yang.model.api.Deviation;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.DeviateEffectiveStatementImpl;
import org.opendaylight.yangtools.yang.model.api.Rfc6020Mapping;
import org.opendaylight.yangtools.yang.parser.spi.meta.AbstractStatementSupport;
import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
+
import javax.annotation.Nonnull;
-public class DeviateStatementImpl extends AbstractDeclaredStatement<String> implements DeviateStatement {
+public class DeviateStatementImpl extends AbstractDeclaredStatement<Deviation.Deviate> implements DeviateStatement {
protected DeviateStatementImpl(
- StmtContext<String, DeviateStatement, ?> context) {
+ StmtContext<Deviation.Deviate, DeviateStatement, ?> context) {
super(context);
}
- public static class Definition extends AbstractStatementSupport<String,DeviateStatement,EffectiveStatement<String,DeviateStatement>> {
+ public static class Definition extends AbstractStatementSupport<Deviation.Deviate,DeviateStatement,EffectiveStatement<Deviation.Deviate,DeviateStatement>> {
public Definition() {
super(Rfc6020Mapping.DEVIATE);
}
- @Override public String parseArgumentValue(
+ @Override public Deviation.Deviate parseArgumentValue(
StmtContext<?, ?, ?> ctx, String value) throws SourceException {
- return value;
+ return Utils.parseDeviateFromString(value);
}
@Override public DeviateStatement createDeclared(
- StmtContext<String, DeviateStatement, ?> ctx) {
+ StmtContext<Deviation.Deviate, DeviateStatement, ?> ctx) {
return new DeviateStatementImpl(ctx);
}
- @Override public EffectiveStatement<String, DeviateStatement> createEffective(
- StmtContext<String, DeviateStatement, EffectiveStatement<String, DeviateStatement>> ctx) {
+ @Override public EffectiveStatement<Deviation.Deviate, DeviateStatement> createEffective(
+ StmtContext<Deviation.Deviate, DeviateStatement, EffectiveStatement<Deviation.Deviate, DeviateStatement>> ctx) {
return new DeviateEffectiveStatementImpl(ctx);
}
+
}
@Nonnull @Override
- public String getValue() {
- return rawArgument();
+ public Deviation.Deviate getValue() {
+ return argument();
}
}