/**
* 添加方法
*
*/
protected void addMethod(TopLevelClass topLevelClass) {
Method method = new Method();
method.setVisibility(JavaVisibility.PUBLIC);
method.setName("setSuccess");
method.addParameter(new Parameter(FullyQualifiedJavaType.getBooleanPrimitiveInstance(), "success"));
method.addBodyLine("this.success = success;");
topLevelClass.addMethod(method);
method = new Method();
method.setVisibility(JavaVisibility.PUBLIC);
method.setReturnType(FullyQualifiedJavaType.getBooleanPrimitiveInstance());
method.setName("isSuccess");
method.addBodyLine("return success;");
topLevelClass.addMethod(method);
method = new Method();
method.setVisibility(JavaVisibility.PUBLIC);
method.setName("setMessage");
method.addParameter(new Parameter(FullyQualifiedJavaType.getStringInstance(), "message"));
method.addBodyLine("this.message = message;");
topLevelClass.addMethod(method);
method = new Method();
method.setVisibility(JavaVisibility.PUBLIC);
method.setReturnType(FullyQualifiedJavaType.getStringInstance());
method.setName("getMessage");
method.addBodyLine("return message;");
topLevelClass.addMethod(method);
}