本文整理汇总了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();
}
示例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());
}
示例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());
}