Allow Property impl to transform value before setting

Aperta
#355 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
java
Ambito
tooling

Direzione di ricerca

Inizia con Property#isValidValue e il percorso di SettingsManager utilizzato quando un'applicazione imposta un valore. Esamina LowercaseStringSetProperty, le proprietà di raccolta e InlineArrayProperty per confrontare il caricamento delle risorse con l'impostazione programmatica. L'attività è completata quando è stato concordato un comportamento di trasformazione o rifiuto per questi casi, con test che coprano il comportamento risultante.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

architecture

A property like LowercaseStringSetProperty or any other property type where not every value of the Java type is considered valid, proper validation/transformation happens when values are loaded from the resource, but if a property's value is programmatically set later on, no such validation occurs. While there is Property#isValidValue and it gets called when a value is set, this makes the SettingsManager throw an exception if it's false.

Ideally, values are valid when the application sets them for a property, but it might make sense to promote the idea that properties manage their values a bit more by maybe allowing the property to slightly transform the value (or throw if the value is unusable) also when a property's value is set by the application.

Examples:

  • A set with upper-case text is set for a LowercaseStringSetProperty
  • A collection is provided for any collection property where one of the entries is null (I believe nothing checks this at all at the moment)
  • InlineArrayProperty does not escape the chosen delimiter in the value -> would need to be done by the developer himself
Lingua principale
Java
Stelle
44
Fork
21
Merge medio
2g 2h
PR unite (30g)
3

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di AuthMe/ConfigMe

Tutte le issue di AuthMe/ConfigMe

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.