Skip to content

refactor!: replace CapabilityHelpers with the CapabilityReader class - #2534

Merged
mykola-mokhnach merged 6 commits into
betafrom
arch/p1-capability-helpers
Dec 4, 2026
Merged

mykola-mokhnach merged 6 commits into
betafrom
arch/p1-capability-helpers

Conversation

@mykola-mokhnach

@mykola-mokhnach mykola-mokhnach commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Change list

Part of #2513 (Phase 1). A follow-up to #2532: a separate extension package for a static helper class was more surface than needed. The only internal type drivers really used (CapabilityHelpers) is replaced by a small reader class next to BaseOptions.

  • New io.appium.java_client.remote.options.CapabilityReader wraps a Capabilities (or a plain Map, for the option data objects) and returns Optionals: get(name, Class), getBoolean, getInteger, getLong, getDouble, getUrl, getDuration(name[, converter]). Plain and appium:-prefixed names are both looked up, the plain one first. Conversion rules are unchanged (lenient booleans, NumberFormatException for bad numbers, IllegalArgumentException for bad URLs).

  • The option mixins use it by composition, so the options classes gain no public methods:

    default Optional<Boolean> doesNoReset() {
        return new CapabilityReader(this).getBoolean(NO_RESET_OPTION);
    }

    Core code that has a plain Capabilities uses the same class (new CapabilityReader(caps).get("browserName", String.class)).

  • APPIUM_PREFIX moves to BaseOptions. internal.CapabilityHelpers and the extension package are removed.

  • Imports are rewritten in the drivers and core; most of the diff is one or two lines per option mixin. CapabilityReaderTest covers the lookup and every conversion.

Drivers and plugins still import only core public API, so the internal guardrail (#2533) holds.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

…sion package

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@mykola-mokhnach mykola-mokhnach changed the title refactor!: nest CapabilityHelpers into BaseOptions and drop the extension package refactor!: nest CapabilityHelpers into BaseOptions as Helpers and drop the extension package Dec 4, 2026
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@mykola-mokhnach mykola-mokhnach changed the title refactor!: nest CapabilityHelpers into BaseOptions as Helpers and drop the extension package refactor!: nest CapabilityHelpers into BaseOptions as OptionHelpers and drop the extension package Dec 4, 2026
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@mykola-mokhnach mykola-mokhnach changed the title refactor!: nest CapabilityHelpers into BaseOptions as OptionHelpers and drop the extension package refactor!: move CapabilityHelpers to remote.options.OptionHelpers and drop the extension package Dec 4, 2026
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@mykola-mokhnach mykola-mokhnach changed the title refactor!: move CapabilityHelpers to remote.options.OptionHelpers and drop the extension package refactor!: replace CapabilityHelpers with the CapabilityReader class Dec 4, 2026
…cessor and tidy imports

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@mykola-mokhnach
mykola-mokhnach merged commit a8999d8 into beta Dec 4, 2026
10 of 12 checks passed
@mykola-mokhnach
mykola-mokhnach deleted the arch/p1-capability-helpers branch December 4, 2026 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant