{
  "schema_version": 2,
  "id": "operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/callnext",
  "title": "CallNext",
  "url": "https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/callnext/",
  "summary": "Calls the next execution that overrides the command or the original command itself. A more flexible version of callNextArray.",
  "aliases": [
    "/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/classes/gearsbuilder/callnext/"
  ],
  "tags": [
    "docs",
    "operate",
    "stack"
  ],
  "last_updated": "2026-09-21T16:36:38+01:00",
  "page_type": "content",
  "content_hash": "7c23e64368074b30ddcd3cffa2e8fcc7963e1c75a5ba6f60d0e8dffe3a137360",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "[code example]\n\nWhen you override a Redis command with the [`CommandOverrider`](https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/readers/commandoverrider), use `callNext` to run the next execution that overrides the command or the original command itself.\n\nIt is a more flexible version of [`callNextArray`](https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsbuilder/callnextarray) since the list of string arguments does not have to be an explicit `String[]` object. This allows function calls like: <nobr>`callNext(\"key\", \"value\")`.</nobr>"
    },
    {
      "id": "parameters",
      "title": "Parameters",
      "role": "parameters",
      "text": "| Name | Type | Description |\n|------|------|-------------|\n| args | string | Redis command arguments |"
    },
    {
      "id": "returns",
      "title": "Returns",
      "role": "returns",
      "text": "Returns the command result. It could be a string or an array of strings, depending on the command."
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "Without `String[]`:\n\n[code example]\n\nWith `String[]`:\n\n[code example]"
    }
  ],
  "examples": [
    {
      "id": "overview-ex0",
      "language": "java",
      "code": "public static java.lang.Object callNext(java.lang.String... args)",
      "section_id": "overview"
    },
    {
      "id": "examples-ex0",
      "language": "java",
      "code": "GearsBuilder.callNext(\"restaurant:1\", \"reviews\", \"50\");",
      "section_id": "examples"
    },
    {
      "id": "examples-ex1",
      "language": "java",
      "code": "GearsBuilder.callNext(new String[]{\"restaurant:1\", \"reviews\", \"50\"});",
      "section_id": "examples"
    }
  ]
}
