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


Java Parameter类代码示例

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


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

示例1: toString

import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Annotation.Parameter; //导入依赖的package包/类
static String toString(Annotation annotation) {
    StringBuilder builder = new StringBuilder();
    builder.append("@");
    builder.append(annotation.getName());
    if (!annotation.getParams().isEmpty()) {
        builder.append("(");
        for (Parameter param : annotation.getParams()) {
            builder.append(param.getKey());
            builder.append(" = ");
            builder.append(fixString(param.getValue()));
            builder.append(", ");
        }
        builder.setCharAt(builder.length() - 2, ')');
    }
    builder.append("\n");
    return builder.toString();
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:18,代码来源:AnnotationSerializer.java

示例2: getEquals

import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Annotation.Parameter; //导入依赖的package包/类
private MethodDefinition getEquals(final Map<String, AttributeIfc> attrs) {
    final StringBuilder equalsBodyBuilder = new StringBuilder(
            "        if (this == o) { return true; }\n" +
            "        if (o == null || getClass() != o.getClass()) { return false; }\n");
    equalsBodyBuilder.append(String.format(
            "        final %s that = (%s) o;\n", this.name, this.name));
    for (final AttributeIfc s : attrs.values()) {
        equalsBodyBuilder.append(String.format(
                "        if (!java.util.Objects.equals(%1$s, that.%1$s)) {\n" +
                "            return false;\n" +
                "        }\n\n", s.getLowerCaseCammelCase()));
    }
    equalsBodyBuilder.append(
            "       return true;\n");
    return new MethodDefinition("boolean", "equals", Collections.singletonList(new Field("Object", "o")),
            Collections.singletonList(new Annotation("Override", Collections.<Parameter>emptyList())), equalsBodyBuilder.toString());
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:18,代码来源:TemplateFactory.java

示例3: getHash

import org.opendaylight.controller.config.yangjmxgenerator.plugin.ftl.model.Annotation.Parameter; //导入依赖的package包/类
private static MethodDefinition getHash(final Map<String, AttributeIfc> attrs) {
    final StringBuilder hashBodyBuilder = new StringBuilder(
            "        return java.util.Objects.hash(");
    for (final AttributeIfc s : attrs.values()) {
        hashBodyBuilder.append(s.getLowerCaseCammelCase());
        hashBodyBuilder.append(", ");
    }
    hashBodyBuilder.replace(hashBodyBuilder.length() - 2, hashBodyBuilder.length(), ");\n");
    return new MethodDefinition("int", "hashCode", Collections.<Field>emptyList(),
            Collections.singletonList(new Annotation("Override", Collections.<Parameter>emptyList())), hashBodyBuilder.toString());
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:12,代码来源:TemplateFactory.java


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