Skip to content

Relax visibility of DefaultCastingError constructor and DefaultCasting methods #331

@Dzeri96

Description

@Dzeri96

When creating my own custom Casting, I would like to re-use a lot of the logic from the DefaultCasting, but overwrite some methods. For example, I want custom boolean parsing logic that handles y|n, but want to keep everything else the same. I managed to get around this issue by putting a type check in the castValue method that calls super.castValue for everything except a boolean, but in my opinion, the primitive* methods should be protected instead of private.

A worse issue is that the constructor of DefaultCastingError is package-private, meaning I cannot instantiate the class in my custom Casting. The class is also final so I can't inherit it. It would be much better if I could reuse this class instead of making my own copy of it and calling two versions of the getErrors method.

If you agree with these changes, I could even work on the code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions