@Override public int hashCode() { int result = (isConstant() ? 1 : 0); result = 31 * result + (getInputs() != null ? getInputs().hashCode() : 0); result = 31 * result + (getName() != null ? getName().hashCode() : 0); result = 31 * result + (getOutputs() != null ? getOutputs().hashCode() : 0); result = 31 * result + (getType() != null ? getType().hashCode() : 0); result = 31 * result + (isPayable() ? 1 : 0); result = 31 * result + (getStateMutability() != null ? getStateMutability().hashCode() : 0); return result; }
private MethodSpec buildDeploy( String className, AbiDefinition functionDefinition, Class authType, String authName, boolean withGasProvider) { boolean isPayable = functionDefinition.isPayable(); MethodSpec.Builder methodBuilder = getDeployMethodSpec( className, authType, authName, isPayable, withGasProvider); String inputParams = addParameters(methodBuilder, functionDefinition.getInputs()); if (!inputParams.isEmpty()) { return buildDeployWithParams( methodBuilder, className, inputParams, authName, isPayable, withGasProvider); } else { return buildDeployNoParams(methodBuilder, className, authName, isPayable, withGasProvider); } }
MethodSpec buildFunction( AbiDefinition functionDefinition) throws ClassNotFoundException { String functionName = functionDefinition.getName(); // If the solidity function name is a reserved word // in the current java version prepend it with "_" if (!SourceVersion.isName(functionName)) { functionName = "_" + functionName; } MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder(functionName) .addModifiers(Modifier.PUBLIC); String inputParams = addParameters(methodBuilder, functionDefinition.getInputs()); List<TypeName> outputParameterTypes = buildTypeNames(functionDefinition.getOutputs()); if (functionDefinition.isConstant()) { buildConstantFunction( functionDefinition, methodBuilder, outputParameterTypes, inputParams); } else { buildTransactionFunction( functionDefinition, methodBuilder, inputParams); } return methodBuilder.build(); }
TypeSpec.Builder classBuilder) throws ClassNotFoundException { String functionName = functionDefinition.getName(); List<AbiDefinition.NamedType> inputs = functionDefinition.getInputs(); String responseClassName = Strings.capitaliseFirstLetter(functionName) + "EventResponse";
private MethodSpec buildDeploy( String className, AbiDefinition functionDefinition, Class authType, String authName, boolean withGasProvider) { boolean isPayable = functionDefinition.isPayable(); MethodSpec.Builder methodBuilder = getDeployMethodSpec( className, authType, authName, isPayable, withGasProvider); String inputParams = addParameters(methodBuilder, functionDefinition.getInputs()); if (!inputParams.isEmpty()) { return buildDeployWithParams( methodBuilder, className, inputParams, authName, isPayable, withGasProvider); } else { return buildDeployNoParams(methodBuilder, className, authName, isPayable, withGasProvider); } }
MethodSpec buildFunction( AbiDefinition functionDefinition) throws ClassNotFoundException { String functionName = functionDefinition.getName(); // If the solidity function name is a reserved word // in the current java version prepend it with "_" if (!SourceVersion.isName(functionName)) { functionName = "_" + functionName; } MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder(functionName) .addModifiers(Modifier.PUBLIC); String inputParams = addParameters(methodBuilder, functionDefinition.getInputs()); List<TypeName> outputParameterTypes = buildTypeNames(functionDefinition.getOutputs()); if (functionDefinition.isConstant()) { buildConstantFunction( functionDefinition, methodBuilder, outputParameterTypes, inputParams); } else { buildTransactionFunction( functionDefinition, methodBuilder, inputParams); } return methodBuilder.build(); }
TypeSpec.Builder classBuilder) throws ClassNotFoundException { String functionName = functionDefinition.getName(); List<AbiDefinition.NamedType> inputs = functionDefinition.getInputs(); String responseClassName = Strings.capitaliseFirstLetter(functionName) + "EventResponse";