• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Builder类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: toMdIds

import org.opendaylight.yangtools.concepts.Builder; //导入依赖的package包/类
protected <S1 extends INeutronObject<S1>, M extends IdAttributes, B extends Builder<M>>
    void toMdIds(INeutronObject<S1> neutronObject, B builder) {
    try {
        if (neutronObject.getID() != null) {
            setUuid.invoke(builder, toUuid(neutronObject.getID()));
        } else {
            LOG.warn("Attempting to write neutron object {} without UUID", builderClass.getSimpleName());
        }
        if (neutronObject.getTenantID() != null && !neutronObject.getTenantID().isEmpty()) {
            setTenantId.invoke(builder, toUuid(neutronObject.getTenantID()));
        }
        if (neutronObject.getProjectID() != null) {
            setProjectId.invoke(builder, neutronObject.getTenantID());
        }
        if (neutronObject.getRevisionNumber() != null) {
            setRevisionNumber.invoke(builder, neutronObject.getRevisionNumber());
        }
    } catch (IllegalAccessException | InvocationTargetException e) {
        throw new IllegalArgumentException(e);
    }
}
 
开发者ID:opendaylight,项目名称:neutron,代码行数:22,代码来源:AbstractTranscriberInterface.java


示例2: setUp

import org.opendaylight.yangtools.concepts.Builder; //导入依赖的package包/类
@Before
public void setUp() {
    this.ctx = ServiceLoaderBGPExtensionProviderContext.getSingletonInstance();
    final MessageRegistry msgRegistry = this.ctx.getMessageRegistry();
    this.parser = new AbstractBmpPerPeerMessageParser<Builder<?>>(msgRegistry) {
        @Override
        public Notification parseMessageBody(final ByteBuf bytes) {
            return null;
        }

        @Override
        public int getBmpMessageType() {
            return 0;
        }
    };
}
 
开发者ID:opendaylight,项目名称:bgpcep,代码行数:17,代码来源:AbstractBmpPerPeerMessageParserTest.java


示例3: computeIdentifierWithPredicate

import org.opendaylight.yangtools.concepts.Builder; //导入依赖的package包/类
private PathArgument computeIdentifierWithPredicate(final QName name) {
    product.add(new NodeIdentifier(name));

    ImmutableMap.Builder<QName, Object> keyValues = ImmutableMap.builder();
    while (!allCharactersConsumed() && PRECONDITION_START == currentChar()) {
        skipCurrentChar();
        skipWhitespaces();
        final QName key = nextQName();

        skipWhitespaces();
        checkCurrentAndSkip(EQUALS, "Precondition must contain '='");
        skipWhitespaces();
        final Object keyValue = nextCurrentFunctionPathValue();
        skipWhitespaces();
        checkCurrentAndSkip(PRECONDITION_END, "Precondition must ends with ']'");

        keyValues.put(key, keyValue);
    }
    return new NodeIdentifierWithPredicates(name, keyValues.build());
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:21,代码来源:LeafrefXPathStringParsingPathArgumentBuilder.java


示例4: AbstractTranscriberInterface

import org.opendaylight.yangtools.concepts.Builder; //导入依赖的package包/类
protected AbstractTranscriberInterface(Class<? extends Builder<T>> builderClass, DataBroker db) {
    this.db = Preconditions.checkNotNull(db);
    this.builderClass = builderClass;

    ParameterizedType parameterizedType = (ParameterizedType) getClass().getGenericSuperclass();
    Type[] types = parameterizedType.getActualTypeArguments();
    @SuppressWarnings("unchecked")
    Class<T> localMdListClass = (Class<T>) types[MD_LIST_CLASS_TYPE_INDEX];
    mdListClass = localMdListClass;
    @SuppressWarnings("unchecked")
    Class<U> localMdContainerClass = (Class<U>) types[MD_CONTAINER_CLASS_TYPE_INDEX];
    mdContainerClass = localMdContainerClass;
    mdParentClass = getMdParentClass(types);
    @SuppressWarnings("unchecked")
    Class<S> neutronObjectClass = (Class<S>) types[NEUTRON_OBJECT_TYPE_INDEX];
    try {
        setUuid = builderClass.getDeclaredMethod("setUuid", Uuid.class);
        setTenantId = builderClass.getDeclaredMethod("setTenantId", Uuid.class);
        setProjectId = builderClass.getDeclaredMethod("setProjectId", String.class);
        setRevisionNumber = builderClass.getDeclaredMethod("setRevisionNumber", Long.class);
        if (INeutronBaseAttributes.class.isAssignableFrom(neutronObjectClass)) {
            setName = builderClass.getDeclaredMethod("setName", String.class);
        } else {
            setName = null;
        }

        if (INeutronAdminAttributes.class.isAssignableFrom(neutronObjectClass)) {
            setAdminStateUp = builderClass.getDeclaredMethod("setAdminStateUp", Boolean.class);
            setStatus = builderClass.getDeclaredMethod("setStatus", String.class);
        } else {
            setAdminStateUp = null;
            setStatus = null;
        }
    } catch (NoSuchMethodException e) {
        throw new IllegalArgumentException(e);
    }
}
 
开发者ID:opendaylight,项目名称:neutron,代码行数:38,代码来源:AbstractTranscriberInterface.java


示例5: toMdBaseAttributes

import org.opendaylight.yangtools.concepts.Builder; //导入依赖的package包/类
protected <S1 extends INeutronBaseAttributes<S1>, M extends BaseAttributes, B extends Builder<M>>
    void toMdBaseAttributes(S1 neutronObject, B builder) {
    toMdIds(neutronObject, builder);
    try {
        if (neutronObject.getName() != null) {
            setName.invoke(builder, neutronObject.getName());
        }
    } catch (IllegalAccessException | InvocationTargetException e) {
        throw new IllegalArgumentException(e);
    }
}
 
开发者ID:opendaylight,项目名称:neutron,代码行数:12,代码来源:AbstractTranscriberInterface.java


示例6: toMdAdminAttributes

import org.opendaylight.yangtools.concepts.Builder; //导入依赖的package包/类
protected <S1 extends INeutronAdminAttributes<S1>, M extends BaseAttributes & AdminAttributes, B extends Builder<M>>
    void toMdAdminAttributes(S1 neutronObject, B builder) {
    toMdBaseAttributes(neutronObject, builder);
    try {
        if (neutronObject.getAdminStateUp() != null) {
            setAdminStateUp.invoke(builder, neutronObject.getAdminStateUp());
        }
        if (neutronObject.getStatus() != null) {
            setStatus.invoke(builder, neutronObject.getStatus());
        }
    } catch (IllegalAccessException | InvocationTargetException e) {
        throw new IllegalArgumentException(e);
    }
}
 
开发者ID:opendaylight,项目名称:neutron,代码行数:15,代码来源:AbstractTranscriberInterface.java


示例7: toMd

import org.opendaylight.yangtools.concepts.Builder; //导入依赖的package包/类
protected T toMd(String uuid) {
    Builder<T> builder;
    try {
        builder = builderClass.newInstance();
        setUuid.invoke(builder, toUuid(uuid));
    } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) {
        // should not happen.
        throw new IllegalArgumentException(e);
    }
    return builder.build();
}
 
开发者ID:opendaylight,项目名称:neutron,代码行数:12,代码来源:AbstractTranscriberInterface.java


示例8: CustomCrossSourceStatementReactorBuilder

import org.opendaylight.yangtools.concepts.Builder; //导入依赖的package包/类
/**
 * Creates a new CustomCrossSourceStatementReactorBuilder object initialized by specific version bundle. Statement
 * parser will support all versions defined in given version bundle.
 *
 * @param supportedVersions
 *            bundle of supported verions
 */
CustomCrossSourceStatementReactorBuilder(final Set<YangVersion> supportedVersions) {
    reactorSupportBundles = ImmutableMap.<ModelProcessingPhase, StatementSupportBundle.Builder>builder()
            .put(ModelProcessingPhase.INIT, StatementSupportBundle.builder(supportedVersions))
            .put(ModelProcessingPhase.SOURCE_PRE_LINKAGE, StatementSupportBundle.builder(supportedVersions))
            .put(ModelProcessingPhase.SOURCE_LINKAGE, StatementSupportBundle.builder(supportedVersions))
            .put(ModelProcessingPhase.STATEMENT_DEFINITION, StatementSupportBundle.builder(supportedVersions))
            .put(ModelProcessingPhase.FULL_DECLARATION, StatementSupportBundle.builder(supportedVersions))
            .put(ModelProcessingPhase.EFFECTIVE_MODEL, StatementSupportBundle.builder(supportedVersions)).build();
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:17,代码来源:CustomCrossSourceStatementReactorBuilder.java


示例9: addAllNamespaceSupports

import org.opendaylight.yangtools.concepts.Builder; //导入依赖的package包/类
public CustomCrossSourceStatementReactorBuilder addAllNamespaceSupports(final ModelProcessingPhase phase,
        final Collection<NamespaceBehaviour<?, ?, ?>> namespaceSupports) {
    final StatementSupportBundle.Builder stmtBundleBuilder = reactorSupportBundles.get(phase);
    for (final NamespaceBehaviour<?, ?, ?> namespaceSupport : namespaceSupports) {
        stmtBundleBuilder.addSupport(namespaceSupport);
    }
    return this;
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:9,代码来源:CustomCrossSourceStatementReactorBuilder.java


示例10: addAllCommonStatementSupports

import org.opendaylight.yangtools.concepts.Builder; //导入依赖的package包/类
public CustomCrossSourceStatementReactorBuilder addAllCommonStatementSupports(final ModelProcessingPhase phase,
        final Collection<StatementSupport<?, ?, ?>> statementSupports) {
    final StatementSupportBundle.Builder stmtBundleBuilder = reactorSupportBundles.get(phase);
    for (final StatementSupport<?, ?, ?> statementSupport : statementSupports) {
        stmtBundleBuilder.addSupport(statementSupport);
    }
    return this;
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:9,代码来源:CustomCrossSourceStatementReactorBuilder.java


示例11: addAllVersionSpecificSupports

import org.opendaylight.yangtools.concepts.Builder; //导入依赖的package包/类
public CustomCrossSourceStatementReactorBuilder addAllVersionSpecificSupports(final ModelProcessingPhase phase,
        final Table<YangVersion, QName, StatementSupport<?, ?, ?>> versionSpecificSupports) {
    final StatementSupportBundle.Builder stmtBundleBuilder = reactorSupportBundles.get(phase);
    for (final Cell<YangVersion, QName, StatementSupport<?, ?, ?>> cell : versionSpecificSupports.cellSet()) {
        stmtBundleBuilder.addVersionSpecificSupport(cell.getRowKey(), cell.getValue());
    }
    return this;
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:9,代码来源:CustomCrossSourceStatementReactorBuilder.java


示例12: build

import org.opendaylight.yangtools.concepts.Builder; //导入依赖的package包/类
@Override
public @NonNull CrossSourceStatementReactor build() {
    final StatementSupportBundle initBundle = reactorSupportBundles.get(ModelProcessingPhase.INIT).build();
    final StatementSupportBundle preLinkageBundle = reactorSupportBundles
            .get(ModelProcessingPhase.SOURCE_PRE_LINKAGE).setParent(initBundle).build();
    final StatementSupportBundle linkageBundle = reactorSupportBundles.get(ModelProcessingPhase.SOURCE_LINKAGE)
            .setParent(preLinkageBundle).build();
    final StatementSupportBundle stmtDefBundle = reactorSupportBundles
            .get(ModelProcessingPhase.STATEMENT_DEFINITION).setParent(linkageBundle).build();
    final StatementSupportBundle fullDeclBundle = reactorSupportBundles.get(ModelProcessingPhase.FULL_DECLARATION)
            .setParent(stmtDefBundle).build();
    final StatementSupportBundle effectiveBundle = reactorSupportBundles.get(ModelProcessingPhase.EFFECTIVE_MODEL)
            .setParent(fullDeclBundle).build();

    final CrossSourceStatementReactor.Builder reactorBuilder = CrossSourceStatementReactor.builder()
            .setBundle(ModelProcessingPhase.INIT, initBundle)
            .setBundle(ModelProcessingPhase.SOURCE_PRE_LINKAGE, preLinkageBundle)
            .setBundle(ModelProcessingPhase.SOURCE_LINKAGE, linkageBundle)
            .setBundle(ModelProcessingPhase.STATEMENT_DEFINITION, stmtDefBundle)
            .setBundle(ModelProcessingPhase.FULL_DECLARATION, fullDeclBundle)
            .setBundle(ModelProcessingPhase.EFFECTIVE_MODEL, effectiveBundle);

    for (final Entry<ValidationBundleType, Collection<StatementDefinition>> entry : reactorValidationBundles
            .entrySet()) {
        reactorBuilder.setValidationBundle(entry.getKey(), entry.getValue());
    }

    return reactorBuilder.build();
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:30,代码来源:CustomCrossSourceStatementReactorBuilder.java


示例13: addError

import org.opendaylight.yangtools.concepts.Builder; //导入依赖的package包/类
private void addError(final RpcError error) {

        if (errors == null) {
            errors = new ImmutableList.Builder<>();
        }

        errors.add(error);
    }
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:9,代码来源:RpcResultBuilder.java


示例14: computeIdentifierWithPredicate

import org.opendaylight.yangtools.concepts.Builder; //导入依赖的package包/类
/**
 * Creates path argument with predicates and sets offset
 * to end of path argument.
 *
 * {@code
 *     predicate = "[" *WSP (predicate-expr / pos) *WSP "]"
 *     predicate-expr = (node-identifier / ".") *WSP "=" *WSP
 *          ((DQUOTE string DQUOTE) /
 *           (SQUOTE string SQUOTE))
 *     pos = non-negative-integer-value
 * }
 *
 * @param name QName of node, for which predicates are computed.
 * @return PathArgument representing node selection with predictes
 */
private PathArgument computeIdentifierWithPredicate(final QName name) {
    DataSchemaContextNode<?> currentNode = nextContextNode(name);
    checkValid(currentNode.isKeyedEntry(), "Entry %s does not allow specifying predicates.", name);

    ImmutableMap.Builder<QName,Object> keyValues = ImmutableMap.builder();
    while (!allCharactersConsumed() && PRECONDITION_START == currentChar()) {
        skipCurrentChar();
        skipWhitespaces();
        final QName key;
        if (DOT == currentChar()) {
            key = null;
            skipCurrentChar();
        } else {
            key = nextQName();
        }
        skipWhitespaces();
        checkCurrentAndSkip(EQUALS, "Precondition must contain '='");
        skipWhitespaces();
        final String keyValue = nextQuotedValue();
        skipWhitespaces();
        checkCurrentAndSkip(PRECONDITION_END, "Precondition must ends with ']'");

        // Break-out from method for leaf-list case
        if (key == null && currentNode.isLeaf()) {
            checkValid(offset == data.length(), "Leaf argument must be last argument of instance identifier.");
            return new NodeWithValue<>(name, keyValue);
        }
        final DataSchemaContextNode<?> keyNode = currentNode.getChild(key);
        checkValid(keyNode != null, "%s is not correct schema node identifier.", key);
        final Object value = codec.deserializeKeyValue(keyNode.getDataSchemaNode(), keyValue);
        keyValues.put(key, value);
    }
    return new NodeIdentifierWithPredicates(name, keyValues.build());
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:50,代码来源:XpathStringParsingPathArgumentBuilder.java


示例15: build

import org.opendaylight.yangtools.concepts.Builder; //导入依赖的package包/类
public final T build(final String testName, final String key, final String value) {
    final Builder<T> builder = builder();
    this.counter++;
    if (key != null) {
        setKey(builder, String.format(FORMAT_STR, testName, key, this.counter));
    }
    if (value != null) {
        setValue(builder, String.format(FORMAT_STR, testName, value, this.counter));
    }
    return builder.build();
}
 
开发者ID:opendaylight,项目名称:ovsdb,代码行数:12,代码来源:SouthboundIT.java


示例16: AbstractNeutronInterface

import org.opendaylight.yangtools.concepts.Builder; //导入依赖的package包/类
protected AbstractNeutronInterface(Class<? extends Builder<T>> builderClass, DataBroker db) {
    super(builderClass, db);
}
 
开发者ID:opendaylight,项目名称:neutron,代码行数:4,代码来源:AbstractNeutronInterface.java


示例17: restrictedBuilderTest

import org.opendaylight.yangtools.concepts.Builder; //导入依赖的package包/类
private static void restrictedBuilderTest(final Builder<?> typeBuilder1, final Builder<?> typeBuilder2) {
    final TypeDefinition<?> typeDefinition1 = ((AbstractRestrictedTypeBuilder<?>) typeBuilder1).buildType();
    final TypeDefinition<?> typeDefinition2 = ((AbstractRestrictedTypeBuilder<?>) typeBuilder2).buildType();
    hashCodeEqualsToStringTest(typeDefinition1, typeDefinition2);
}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:6,代码来源:TypeTest.java


示例18: builder

import org.opendaylight.yangtools.concepts.Builder; //导入依赖的package包/类
@Override
protected Builder<QueuesExternalIds> builder() {
    return new QueuesExternalIdsBuilder();
}
 
开发者ID:opendaylight,项目名称:ovsdb,代码行数:5,代码来源:SouthboundIT.java


示例19: setKey

import org.opendaylight.yangtools.concepts.Builder; //导入依赖的package包/类
@Override
protected void setKey(Builder<QueuesExternalIds> builder, String key) {
    ((QueuesExternalIdsBuilder) builder).setQueuesExternalIdKey(key);
}
 
开发者ID:opendaylight,项目名称:ovsdb,代码行数:5,代码来源:SouthboundIT.java


示例20: setValue

import org.opendaylight.yangtools.concepts.Builder; //导入依赖的package包/类
@Override
protected void setValue(Builder<QueuesExternalIds> builder, String value) {
    ((QueuesExternalIdsBuilder) builder).setQueuesExternalIdValue(value);
}
 
开发者ID:opendaylight,项目名称:ovsdb,代码行数:5,代码来源:SouthboundIT.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DataManifest类代码示例发布时间:2022-05-23
下一篇:
Java MetricsReplicationSource类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap