-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Milestone
Description
Although it is possible to support read-only/write-only use cases with a combination of various settings, like visibility settings, and/or addition of setters/getters, it would be useful to just have a property that dictates intended behavior, like:
- read-only: figure out an accessor (getter or field), regardless of visibility; ignore any mutators
- write-only: figure out a mutator (getter, field, creator parameter), regardless of visibility, ignore any accessors
- read-write: figure out both accessor and mutator, if any found, regardless of visibility:
- auto: just use default visibility settings (current behavior)
and default to auto
for backwards compatibility.
The benefit here is that this basically allows overriding of visibility settings for individual properties.
For example:
- For a
password
field, we may want "write-only" behavior, so that password is never exposed on serialization, but may be passed in via deserialization - Certain settings are not to be used via POJO, but should be included in serialization:
read-only
setting would allow use ofprivate
accessor or field for serialization, without having to change visibility settings, or make getterpublic
- Modules that want to change default behavior of certain special classes could specify one of accessor cases (like
read-write
) to enable convenient round-trip behavior (for example, Scala module could do this at least for case classes, maybe all typical Scala beans).
Metadata
Metadata
Assignees
Labels
No labels