本文整理匯總了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());
}