當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。