All Downloads are FREE. Search and download functionalities are using the official Maven repository.

templates.scala.method.txt Maven / Gradle / Ivy

There is a newer version: 0.7
Show newest version

  /**
   * {{comment}}
   */
  def {{quote}}{{methodname}}{{quote}}({{#arguments}}{{^first}}, {{/first}}{{name}}: {{typename}}{{#multiple}}*{{/multiple}}{{/arguments}}): Future[{{reply}}{{#generic}}[_]{{/generic}}] = {
    {{#usearray}}
    val arguments = new Array[Object]({{base_length}}{{#arguments}}{{#multiple}} + {{name}}.length{{/multiple}}{{/arguments}})
    {{#arguments}}
    {{#multiple}}
    {{name}}.copyToArray(arguments, {{base_length}})
    {{/multiple}}
    {{^multiple}}
    arguments({{arg_num}}) = {{name}}
    {{/multiple}}
    {{/arguments}}
    service(new Command(RedisClient.{{name}}_BYTES, arguments)) map {
    {{/usearray}}
    {{^usearray}}
    service(new Command(RedisClient.{{name}}_BYTES{{#arguments}}, {{name}}{{/arguments}})) map {
    {{/usearray}}
      case error: ErrorReply => throw new RedisException(error.data())
      case reply: {{reply}}{{#generic}}[_]{{/generic}} => reply
      case other => throw new RedisException("Unexpected reply from {{name}}: " + other)
    }
  }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy