theodoral22 opened a new pull request, #1552:
URL: https://github.com/apache/commons-lang/pull/1552
### Summary
This PR introduces a new class `LongBitField` that extends the concept of
`BitField` to support 64-bit values (`long`).
The existing `BitField` only supports `int`, `short` and `byte`, which is
insufficient for modern use cases involving large flags or 64-bit bitsets.
### Features
- Supports all basic bit operations: `set`, `clear`, `setBoolean`,
`getValue`, `getRawValue`, `isSet`, `isAllSet`.
- Operates on `long` values to allow 64-bit flags.
- Fully unit-tested in `LongBitFieldTest.java`, covering:
-> Single-bit and multi-bit masks
-> Edge cases (lowest and highest bits)
-> Boolean set/clear operations
-> Setting and getting values
- Designed to be consistent with `BitField` API for easy adoption.
### Motivation
- 'BitField' is limited to 32-bit integers (`int`). Many modern applications
require 64-bit flags or large bitsets.
- This class provides a direct, intuitive solution for such cases without
needing to manually manipulate `long` values.
### Testing
- All methods are covered by JUnit tests in `LongBitFieldTest.java`.
- Tests validate correctness of all bit operations, including edge cases.
- Tests can be run using standard Maven/Gradle build for Apache Commons Lang.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]