当前位置: 首页>>代码示例>>Java>>正文


Java EmptyTypeDefinition类代码示例

本文整理汇总了Java中org.opendaylight.yangtools.yang.model.api.type.EmptyTypeDefinition的典型用法代码示例。如果您正苦于以下问题:Java EmptyTypeDefinition类的具体用法?Java EmptyTypeDefinition怎么用?Java EmptyTypeDefinition使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


EmptyTypeDefinition类属于org.opendaylight.yangtools.yang.model.api.type包,在下文中一共展示了EmptyTypeDefinition类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testEmpty

import org.opendaylight.yangtools.yang.model.api.type.EmptyTypeDefinition; //导入依赖的package包/类
@Test
public void testEmpty() {
    currentLeaf = (LeafSchemaNode) types.getDataChildByName(QName.create(types.getQNameModule(), "leaf-empty"));
    assertNotNull(currentLeaf.getType());
    final EmptyTypeDefinition emptyEff = (EmptyTypeDefinition) ((TypeEffectiveStatement<?>)
            ((LeafEffectiveStatement) currentLeaf).effectiveSubstatements().iterator().next())
            .getTypeDefinition();

    assertEquals(Optional.empty(), emptyEff.getUnits());
    assertEquals(Optional.empty(), emptyEff.getDefaultValue());
    assertNull(emptyEff.getBaseType());
    assertEquals("empty", emptyEff.getQName().getLocalName());
    assertNull(emptyEff.getPath().getParent().getParent());
    assertNotNull(emptyEff.getUnknownSchemaNodes());
    assertFalse(emptyEff.getDescription().isPresent());
    assertFalse(emptyEff.getReference().isPresent());
    assertEquals("CURRENT", emptyEff.getStatus().toString());
    assertNotNull(emptyEff.toString());
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:20,代码来源:EffectiveStatementTypeTest.java

示例2: canCreateEmptyType

import org.opendaylight.yangtools.yang.model.api.type.EmptyTypeDefinition; //导入依赖的package包/类
@Test
public void canCreateEmptyType() {
    EmptyTypeDefinition emptyType = emptyType();

    assertEquals("QName", BaseTypes.EMPTY_QNAME, emptyType.getQName());
    assertEquals("Path", Collections.singletonList(BaseTypes.EMPTY_QNAME),
            emptyType.getPath().getPathFromRoot());
    assertEquals("BaseType", null, emptyType.getBaseType());
    assertEquals("DefaultValue", Optional.empty(), emptyType.getDefaultValue());
    assertEquals("Status", Status.CURRENT, emptyType.getStatus());
    assertFalse(emptyType.getReference().isPresent());
    assertEquals("Units", Optional.empty(), emptyType.getUnits());
    assertFalse(emptyType.getDescription().isPresent());
    assertEquals("UnknownSchemaNodes", Collections.EMPTY_LIST, emptyType.getUnknownSchemaNodes());
    assertTrue("toString", emptyType.toString().contains("empty"));
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:17,代码来源:EmptyTypeTest.java

示例3: emitTypeBodyNodes

import org.opendaylight.yangtools.yang.model.api.type.EmptyTypeDefinition; //导入依赖的package包/类
private void emitTypeBodyNodes(final TypeDefinition<?> typeDef) {
    if (typeDef instanceof DecimalTypeDefinition) {
        emitDecimal64Specification((DecimalTypeDefinition) typeDef);
    } else if (typeDef instanceof RangeRestrictedTypeDefinition) {
        emitRangeRestrictedSpecification((RangeRestrictedTypeDefinition<?, ?>) typeDef);
    } else if (typeDef instanceof StringTypeDefinition) {
        emitStringRestrictions((StringTypeDefinition) typeDef);
    } else if (typeDef instanceof EnumTypeDefinition) {
        emitEnumSpecification((EnumTypeDefinition) typeDef);
    } else if (typeDef instanceof LeafrefTypeDefinition) {
        emitLeafrefSpecification((LeafrefTypeDefinition) typeDef);
    } else if (typeDef instanceof IdentityrefTypeDefinition) {
        emitIdentityrefSpecification((IdentityrefTypeDefinition) typeDef);
    } else if (typeDef instanceof InstanceIdentifierTypeDefinition) {
        emitInstanceIdentifierSpecification((InstanceIdentifierTypeDefinition) typeDef);
    } else if (typeDef instanceof BitsTypeDefinition) {
        emitBitsSpecification((BitsTypeDefinition) typeDef);
    } else if (typeDef instanceof UnionTypeDefinition) {
        emitUnionSpecification((UnionTypeDefinition) typeDef);
    } else if (typeDef instanceof BinaryTypeDefinition) {
        ((BinaryTypeDefinition) typeDef).getLengthConstraint().ifPresent(this::emitLength);
    } else if (typeDef instanceof BooleanTypeDefinition || typeDef instanceof EmptyTypeDefinition) {
        // NOOP
    } else {
        throw new IllegalArgumentException("Not supported type " + typeDef.getClass());
    }
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:28,代码来源:SchemaContextEmitter.java

示例4: fromType

import org.opendaylight.yangtools.yang.model.api.type.EmptyTypeDefinition; //导入依赖的package包/类
public static TypeDefinitionAwareCodec<?, ?> fromType(final TypeDefinition<?> typeDefinition) {
    final TypeDefinitionAwareCodec<?, ?> codec;

    if (typeDefinition instanceof BinaryTypeDefinition) {
        codec = BinaryStringCodec.from((BinaryTypeDefinition)typeDefinition);
    } else if (typeDefinition instanceof BitsTypeDefinition) {
        codec = BitsStringCodec.from((BitsTypeDefinition)typeDefinition);
    } else if (typeDefinition instanceof BooleanTypeDefinition) {
        codec = BooleanStringCodec.from((BooleanTypeDefinition)typeDefinition);
    } else if (typeDefinition instanceof DecimalTypeDefinition) {
        codec = DecimalStringCodec.from((DecimalTypeDefinition)typeDefinition);
    } else if (typeDefinition instanceof EmptyTypeDefinition) {
        codec = EmptyStringCodec.INSTANCE;
    } else if (typeDefinition instanceof EnumTypeDefinition) {
        codec = EnumStringCodec.from((EnumTypeDefinition)typeDefinition);
    } else if (typeDefinition instanceof Int8TypeDefinition) {
        codec = AbstractIntegerStringCodec.from((Int8TypeDefinition) typeDefinition);
    } else if (typeDefinition instanceof Int16TypeDefinition) {
        codec = AbstractIntegerStringCodec.from((Int16TypeDefinition) typeDefinition);
    } else if (typeDefinition instanceof Int32TypeDefinition) {
        codec = AbstractIntegerStringCodec.from((Int32TypeDefinition) typeDefinition);
    } else if (typeDefinition instanceof Int64TypeDefinition) {
        codec = AbstractIntegerStringCodec.from((Int64TypeDefinition) typeDefinition);
    } else if (typeDefinition instanceof StringTypeDefinition) {
        codec = StringStringCodec.from((StringTypeDefinition)typeDefinition);
    } else if (typeDefinition instanceof UnionTypeDefinition) {
        codec = UnionStringCodec.from((UnionTypeDefinition)typeDefinition);
    } else if (typeDefinition instanceof Uint8TypeDefinition) {
        codec = AbstractIntegerStringCodec.from((Uint8TypeDefinition) typeDefinition);
    } else if (typeDefinition instanceof Uint16TypeDefinition) {
        codec = AbstractIntegerStringCodec.from((Uint16TypeDefinition) typeDefinition);
    } else if (typeDefinition instanceof Uint32TypeDefinition) {
        codec = AbstractIntegerStringCodec.from((Uint32TypeDefinition) typeDefinition);
    } else if (typeDefinition instanceof Uint64TypeDefinition) {
        codec = AbstractIntegerStringCodec.from((Uint64TypeDefinition) typeDefinition);
    } else {
        codec = null;
    }
    return codec;
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:41,代码来源:TypeDefinitionAwareCodec.java

示例5: derivedEmptyBuilder

import org.opendaylight.yangtools.yang.model.api.type.EmptyTypeDefinition; //导入依赖的package包/类
public static DerivedTypeBuilder<EmptyTypeDefinition> derivedEmptyBuilder(final EmptyTypeDefinition baseType,
        final SchemaPath path) {
    return new DerivedTypeBuilder<EmptyTypeDefinition>(baseType, path) {
        @Override
        public EmptyTypeDefinition build() {
            return new DerivedEmptyType(getBaseType(), getPath(), getDefaultValue(), getDescription(),
                    getReference(), getStatus(), getUnits(), getUnknownSchemaNodes());
        }
    };
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:11,代码来源:DerivedTypes.java

示例6: newEmptyBuilder

import org.opendaylight.yangtools.yang.model.api.type.EmptyTypeDefinition; //导入依赖的package包/类
public static TypeBuilder<EmptyTypeDefinition> newEmptyBuilder(final EmptyTypeDefinition baseType,
        final SchemaPath path) {
    return new AbstractRestrictedTypeBuilder<EmptyTypeDefinition>(baseType, path) {
        @Override
        EmptyTypeDefinition buildType() {
            return new RestrictedEmptyType(getBaseType(), getPath(), getUnknownSchemaNodes());
        }
    };
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:10,代码来源:RestrictedTypes.java

示例7: concreteEmptyBuilder

import org.opendaylight.yangtools.yang.model.api.type.EmptyTypeDefinition; //导入依赖的package包/类
private static ConcreteTypeBuilder<EmptyTypeDefinition> concreteEmptyBuilder(final EmptyTypeDefinition baseType,
        final SchemaPath path) {
    return new ConcreteTypeBuilder<EmptyTypeDefinition>(baseType, path) {
        @Nonnull
        @Override
        public EmptyTypeDefinition buildType() {
            return new DerivedEmptyType(getBaseType(), getPath(), getDefaultValue(), getDescription(),
                    getReference(), getStatus(), getUnits(), getUnknownSchemaNodes());
        }
    };
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:12,代码来源:ConcreteTypes.java

示例8: emptyCodec

import org.opendaylight.yangtools.yang.model.api.type.EmptyTypeDefinition; //导入依赖的package包/类
@Override
protected JSONCodec<?> emptyCodec(final EmptyTypeDefinition type) {
    return EmptyJSONCodec.INSTANCE;
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:5,代码来源:JSONCodecFactory.java

示例9: emptyCodec

import org.opendaylight.yangtools.yang.model.api.type.EmptyTypeDefinition; //导入依赖的package包/类
@Override
protected XmlCodec<?> emptyCodec(final EmptyTypeDefinition type) {
    return EmptyXmlCodec.INSTANCE;
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:5,代码来源:XmlCodecFactory.java

示例10: EmptyTypeEffectiveStatementImpl

import org.opendaylight.yangtools.yang.model.api.type.EmptyTypeDefinition; //导入依赖的package包/类
EmptyTypeEffectiveStatementImpl(
        final StmtContext<String, TypeStatement, EffectiveStatement<String, TypeStatement>> ctx,
        final EmptyTypeDefinition baseType) {
    super(ctx, RestrictedTypes.newEmptyBuilder(baseType,
        AbstractTypeStatementSupport.typeEffectiveSchemaPath(ctx)));
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:7,代码来源:EmptyTypeEffectiveStatementImpl.java

示例11: DerivedEmptyType

import org.opendaylight.yangtools.yang.model.api.type.EmptyTypeDefinition; //导入依赖的package包/类
DerivedEmptyType(final EmptyTypeDefinition baseType, final SchemaPath path, final Object defaultValue,
    final String description, final String reference, final Status status, final String units,
    final Collection<UnknownSchemaNode> unknownSchemNodes) {
    super(baseType, path, defaultValue, description, reference, status, units, unknownSchemNodes);
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:6,代码来源:DerivedEmptyType.java

示例12: hashCode

import org.opendaylight.yangtools.yang.model.api.type.EmptyTypeDefinition; //导入依赖的package包/类
@Override
public int hashCode() {
    return EmptyTypeDefinition.hashCode(this);
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:5,代码来源:DerivedEmptyType.java

示例13: equals

import org.opendaylight.yangtools.yang.model.api.type.EmptyTypeDefinition; //导入依赖的package包/类
@Override
public boolean equals(final Object obj) {
    return EmptyTypeDefinition.equals(this, obj);
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:5,代码来源:DerivedEmptyType.java

示例14: toString

import org.opendaylight.yangtools.yang.model.api.type.EmptyTypeDefinition; //导入依赖的package包/类
@Override
public String toString() {
    return EmptyTypeDefinition.toString(this);
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:5,代码来源:BaseEmptyType.java

示例15: RestrictedEmptyType

import org.opendaylight.yangtools.yang.model.api.type.EmptyTypeDefinition; //导入依赖的package包/类
RestrictedEmptyType(final EmptyTypeDefinition baseType, final SchemaPath path,
        final Collection<UnknownSchemaNode> unknownSchemaNodes) {
    super(baseType, path, unknownSchemaNodes);
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:5,代码来源:RestrictedEmptyType.java


注:本文中的org.opendaylight.yangtools.yang.model.api.type.EmptyTypeDefinition类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。