import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type.EnumTypeEffectiveStatementImpl;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type.IdentityrefTypeEffectiveStatementImpl;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type.InstanceIdentifierTypeEffectiveStatementImpl;
-import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type.IntegerTypeEffectiveStatementImpl;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type.IntegralTypeEffectiveStatementImpl;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type.LeafrefTypeEffectiveStatementImpl;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type.StringTypeEffectiveStatementImpl;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type.UnionTypeEffectiveStatementImpl;
-import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type.UnsignedIntegerTypeEffectiveStatementImpl;
public class TypeStatementImpl extends AbstractDeclaredStatement<String>
implements TypeStatement {
return new InstanceIdentifierTypeEffectiveStatementImpl(ctx,
(InstanceIdentifierTypeDefinition) baseType);
} else if (baseType instanceof Int8TypeDefinition) {
- return IntegerTypeEffectiveStatementImpl.create(ctx, (Int8TypeDefinition) baseType);
+ return IntegralTypeEffectiveStatementImpl.create(ctx, (Int8TypeDefinition) baseType);
} else if (baseType instanceof Int16TypeDefinition) {
- return IntegerTypeEffectiveStatementImpl.create(ctx, (Int16TypeDefinition) baseType);
+ return IntegralTypeEffectiveStatementImpl.create(ctx, (Int16TypeDefinition) baseType);
} else if (baseType instanceof Int32TypeDefinition) {
- return IntegerTypeEffectiveStatementImpl.create(ctx, (Int32TypeDefinition) baseType);
+ return IntegralTypeEffectiveStatementImpl.create(ctx, (Int32TypeDefinition) baseType);
} else if (baseType instanceof Int64TypeDefinition) {
- return IntegerTypeEffectiveStatementImpl.create(ctx, (Int64TypeDefinition) baseType);
+ return IntegralTypeEffectiveStatementImpl.create(ctx, (Int64TypeDefinition) baseType);
} else if (baseType instanceof LeafrefTypeDefinition) {
return new LeafrefTypeEffectiveStatementImpl(ctx, (LeafrefTypeDefinition) baseType);
} else if (baseType instanceof StringTypeDefinition) {
return new StringTypeEffectiveStatementImpl(ctx, (StringTypeDefinition) baseType);
} else if (baseType instanceof Uint8TypeDefinition) {
- return UnsignedIntegerTypeEffectiveStatementImpl.create(ctx, (Uint8TypeDefinition) baseType);
+ return IntegralTypeEffectiveStatementImpl.create(ctx, (Uint8TypeDefinition) baseType);
} else if (baseType instanceof Uint16TypeDefinition) {
- return UnsignedIntegerTypeEffectiveStatementImpl.create(ctx, (Uint16TypeDefinition) baseType);
+ return IntegralTypeEffectiveStatementImpl.create(ctx, (Uint16TypeDefinition) baseType);
} else if (baseType instanceof Uint32TypeDefinition) {
- return UnsignedIntegerTypeEffectiveStatementImpl.create(ctx, (Uint32TypeDefinition) baseType);
+ return IntegralTypeEffectiveStatementImpl.create(ctx, (Uint32TypeDefinition) baseType);
} else if (baseType instanceof Uint64TypeDefinition) {
- return UnsignedIntegerTypeEffectiveStatementImpl.create(ctx, (Uint64TypeDefinition) baseType);
+ return IntegralTypeEffectiveStatementImpl.create(ctx, (Uint64TypeDefinition) baseType);
} else if (baseType instanceof UnionTypeDefinition) {
return new UnionTypeEffectiveStatementImpl(ctx, (UnionTypeDefinition) baseType);
} else {
/*
- * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2017 Pantheon Technologies, s.r.o. and others. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
package org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.type;
+import java.math.BigInteger;
import javax.annotation.Nonnull;
import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.stmt.TypeEffectiveStatement;
import org.opendaylight.yangtools.yang.model.api.type.Int32TypeDefinition;
import org.opendaylight.yangtools.yang.model.api.type.Int64TypeDefinition;
import org.opendaylight.yangtools.yang.model.api.type.Int8TypeDefinition;
-import org.opendaylight.yangtools.yang.model.api.type.IntegerTypeDefinition;
+import org.opendaylight.yangtools.yang.model.api.type.RangeRestrictedTypeDefinition;
+import org.opendaylight.yangtools.yang.model.api.type.Uint16TypeDefinition;
+import org.opendaylight.yangtools.yang.model.api.type.Uint32TypeDefinition;
+import org.opendaylight.yangtools.yang.model.api.type.Uint64TypeDefinition;
+import org.opendaylight.yangtools.yang.model.api.type.Uint8TypeDefinition;
import org.opendaylight.yangtools.yang.model.util.type.InvalidRangeConstraintException;
import org.opendaylight.yangtools.yang.model.util.type.RangeRestrictedTypeBuilder;
import org.opendaylight.yangtools.yang.model.util.type.RestrictedTypes;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.DeclaredEffectiveStatementBase;
import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.UnknownEffectiveStatementImpl;
-public final class IntegerTypeEffectiveStatementImpl<T extends IntegerTypeDefinition<N, T>,
+public final class IntegralTypeEffectiveStatementImpl<T extends RangeRestrictedTypeDefinition<T, N>,
N extends Number & Comparable<N>> extends DeclaredEffectiveStatementBase<String, TypeStatement>
implements TypeEffectiveStatement<TypeStatement> {
private final T typeDefinition;
- private IntegerTypeEffectiveStatementImpl(
+ private IntegralTypeEffectiveStatementImpl(
final StmtContext<String, TypeStatement, EffectiveStatement<String, TypeStatement>> ctx,
final RangeRestrictedTypeBuilder<T, N> builder) {
super(ctx);
for (EffectiveStatement<?, ?> stmt : effectiveSubstatements()) {
if (stmt instanceof RangeEffectiveStatementImpl) {
- final RangeEffectiveStatementImpl range = (RangeEffectiveStatementImpl) stmt;
- builder.setRangeConstraint(range, range.argument());
+ final RangeEffectiveStatementImpl rangeStmt = (RangeEffectiveStatementImpl)stmt;
+ builder.setRangeConstraint(rangeStmt, rangeStmt.argument());
}
if (stmt instanceof UnknownEffectiveStatementImpl) {
builder.addUnknownSchemaNode((UnknownEffectiveStatementImpl)stmt);
}
}
- public static IntegerTypeEffectiveStatementImpl<Int8TypeDefinition, Byte> create(
+ public static IntegralTypeEffectiveStatementImpl<Int8TypeDefinition, Byte> create(
final StmtContext<String, TypeStatement, EffectiveStatement<String, TypeStatement>> ctx,
final Int8TypeDefinition baseType) {
- return new IntegerTypeEffectiveStatementImpl<>(ctx, RestrictedTypes.newInt8Builder(baseType,
+ return new IntegralTypeEffectiveStatementImpl<>(ctx, RestrictedTypes.newInt8Builder(baseType,
TypeUtils.typeEffectiveSchemaPath(ctx)));
}
- public static IntegerTypeEffectiveStatementImpl<Int16TypeDefinition, Short> create(
+ public static IntegralTypeEffectiveStatementImpl<Int16TypeDefinition, Short> create(
final StmtContext<String, TypeStatement, EffectiveStatement<String, TypeStatement>> ctx,
final Int16TypeDefinition baseType) {
- return new IntegerTypeEffectiveStatementImpl<>(ctx, RestrictedTypes.newInt16Builder(baseType,
+ return new IntegralTypeEffectiveStatementImpl<>(ctx, RestrictedTypes.newInt16Builder(baseType,
TypeUtils.typeEffectiveSchemaPath(ctx)));
}
- public static IntegerTypeEffectiveStatementImpl<Int32TypeDefinition, Integer> create(
+ public static IntegralTypeEffectiveStatementImpl<Int32TypeDefinition, Integer> create(
final StmtContext<String, TypeStatement, EffectiveStatement<String, TypeStatement>> ctx,
final Int32TypeDefinition baseType) {
- return new IntegerTypeEffectiveStatementImpl<>(ctx, RestrictedTypes.newInt32Builder(baseType,
+ return new IntegralTypeEffectiveStatementImpl<>(ctx, RestrictedTypes.newInt32Builder(baseType,
TypeUtils.typeEffectiveSchemaPath(ctx)));
}
- public static IntegerTypeEffectiveStatementImpl<Int64TypeDefinition, Long> create(
+ public static IntegralTypeEffectiveStatementImpl<Int64TypeDefinition, Long> create(
final StmtContext<String, TypeStatement, EffectiveStatement<String, TypeStatement>> ctx,
final Int64TypeDefinition baseType) {
- return new IntegerTypeEffectiveStatementImpl<>(ctx, RestrictedTypes.newInt64Builder(baseType,
+ return new IntegralTypeEffectiveStatementImpl<>(ctx, RestrictedTypes.newInt64Builder(baseType,
+ TypeUtils.typeEffectiveSchemaPath(ctx)));
+ }
+
+ public static IntegralTypeEffectiveStatementImpl<Uint8TypeDefinition, Short> create(
+ final StmtContext<String, TypeStatement, EffectiveStatement<String, TypeStatement>> ctx,
+ final Uint8TypeDefinition baseType) {
+ return new IntegralTypeEffectiveStatementImpl<>(ctx, RestrictedTypes.newUint8Builder(baseType,
+ TypeUtils.typeEffectiveSchemaPath(ctx)));
+ }
+
+ public static IntegralTypeEffectiveStatementImpl<Uint16TypeDefinition, Integer> create(
+ final StmtContext<String, TypeStatement, EffectiveStatement<String, TypeStatement>> ctx,
+ final Uint16TypeDefinition baseType) {
+ return new IntegralTypeEffectiveStatementImpl<>(ctx, RestrictedTypes.newUint16Builder(baseType,
+ TypeUtils.typeEffectiveSchemaPath(ctx)));
+ }
+
+ public static IntegralTypeEffectiveStatementImpl<Uint32TypeDefinition, Long> create(
+ final StmtContext<String, TypeStatement, EffectiveStatement<String, TypeStatement>> ctx,
+ final Uint32TypeDefinition baseType) {
+ return new IntegralTypeEffectiveStatementImpl<>(ctx, RestrictedTypes.newUint32Builder(baseType,
+ TypeUtils.typeEffectiveSchemaPath(ctx)));
+ }
+
+ public static IntegralTypeEffectiveStatementImpl<Uint64TypeDefinition, BigInteger> create(
+ final StmtContext<String, TypeStatement, EffectiveStatement<String, TypeStatement>> ctx,
+ final Uint64TypeDefinition baseType) {
+ return new IntegralTypeEffectiveStatementImpl<>(ctx, RestrictedTypes.newUint64Builder(baseType,
TypeUtils.typeEffectiveSchemaPath(ctx)));
}
+++ /dev/null
-/*
- * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.stmt.rfc6020.effective.type;
-
-import java.math.BigInteger;
-import javax.annotation.Nonnull;
-import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
-import org.opendaylight.yangtools.yang.model.api.stmt.TypeEffectiveStatement;
-import org.opendaylight.yangtools.yang.model.api.stmt.TypeStatement;
-import org.opendaylight.yangtools.yang.model.api.type.Uint16TypeDefinition;
-import org.opendaylight.yangtools.yang.model.api.type.Uint32TypeDefinition;
-import org.opendaylight.yangtools.yang.model.api.type.Uint64TypeDefinition;
-import org.opendaylight.yangtools.yang.model.api.type.Uint8TypeDefinition;
-import org.opendaylight.yangtools.yang.model.api.type.UnsignedIntegerTypeDefinition;
-import org.opendaylight.yangtools.yang.model.util.type.RangeRestrictedTypeBuilder;
-import org.opendaylight.yangtools.yang.model.util.type.RestrictedTypes;
-import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
-import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.TypeUtils;
-import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.DeclaredEffectiveStatementBase;
-import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.UnknownEffectiveStatementImpl;
-
-public final class UnsignedIntegerTypeEffectiveStatementImpl<T extends UnsignedIntegerTypeDefinition<N, T>,
- N extends Number & Comparable<N>> extends DeclaredEffectiveStatementBase<String, TypeStatement>
- implements TypeEffectiveStatement<TypeStatement> {
-
- private final T typeDefinition;
-
- private UnsignedIntegerTypeEffectiveStatementImpl(
- final StmtContext<String, TypeStatement, EffectiveStatement<String, TypeStatement>> ctx,
- final RangeRestrictedTypeBuilder<T, N> builder) {
- super(ctx);
-
- for (EffectiveStatement<?, ?> stmt : effectiveSubstatements()) {
- if (stmt instanceof RangeEffectiveStatementImpl) {
- final RangeEffectiveStatementImpl rangeStmt = (RangeEffectiveStatementImpl)stmt;
- builder.setRangeConstraint(rangeStmt, rangeStmt.argument());
- }
- if (stmt instanceof UnknownEffectiveStatementImpl) {
- builder.addUnknownSchemaNode((UnknownEffectiveStatementImpl)stmt);
- }
- }
-
- typeDefinition = builder.build();
- }
-
- public static UnsignedIntegerTypeEffectiveStatementImpl<Uint8TypeDefinition, Short> create(
- final StmtContext<String, TypeStatement, EffectiveStatement<String, TypeStatement>> ctx,
- final Uint8TypeDefinition baseType) {
- return new UnsignedIntegerTypeEffectiveStatementImpl<>(ctx, RestrictedTypes.newUint8Builder(baseType,
- TypeUtils.typeEffectiveSchemaPath(ctx)));
- }
-
- public static UnsignedIntegerTypeEffectiveStatementImpl<Uint16TypeDefinition, Integer> create(
- final StmtContext<String, TypeStatement, EffectiveStatement<String, TypeStatement>> ctx,
- final Uint16TypeDefinition baseType) {
- return new UnsignedIntegerTypeEffectiveStatementImpl<>(ctx, RestrictedTypes.newUint16Builder(baseType,
- TypeUtils.typeEffectiveSchemaPath(ctx)));
- }
-
- public static UnsignedIntegerTypeEffectiveStatementImpl<Uint32TypeDefinition, Long> create(
- final StmtContext<String, TypeStatement, EffectiveStatement<String, TypeStatement>> ctx,
- final Uint32TypeDefinition baseType) {
- return new UnsignedIntegerTypeEffectiveStatementImpl<>(ctx, RestrictedTypes.newUint32Builder(baseType,
- TypeUtils.typeEffectiveSchemaPath(ctx)));
- }
-
- public static UnsignedIntegerTypeEffectiveStatementImpl<Uint64TypeDefinition, BigInteger> create(
- final StmtContext<String, TypeStatement, EffectiveStatement<String, TypeStatement>> ctx,
- final Uint64TypeDefinition baseType) {
- return new UnsignedIntegerTypeEffectiveStatementImpl<>(ctx, RestrictedTypes.newUint64Builder(baseType,
- TypeUtils.typeEffectiveSchemaPath(ctx)));
- }
-
- @Nonnull
- @Override
- public T getTypeDefinition() {
- return typeDefinition;
- }
-}