ambry icon indicating copy to clipboard operation
ambry copied to clipboard

VerifiableProperties needs more APIs

Open vgkholla opened this issue 7 years ago • 2 comments

VerifiableProperties needs a few more APIs to support the use cases that have cropped.

  • a "get if positive, otherwise throw" function for all types
  • also provide separate functions for min and max bounds (for ranges)

vgkholla avatar Mar 20 '18 23:03 vgkholla

@vgkholla Would it make more sense to implement the getter methods to return Java's Optional? This way the caller could choose if they want to get the value or throw or get the value or do some other action.

mbabauer avatar Oct 24 '18 11:10 mbabauer

@mbabauer That might be a good addition but if everyone has to write the code to do "some other action", that wouldn't serve the purpose either (we could provide a default static orElse() function in VerifiableProperties to cover most cases)

vgkholla avatar Oct 24 '18 22:10 vgkholla