Does YamlBeans support Optional<T>?

45 views
Skip to first unread message

Jared DiCioccio

unread,
Feb 8, 2017, 10:46:22 AM2/8/17
to yamlbeans-users
I don't see it anywhere but wanted to make sure I wasn't missing something. Right now YamlBeans will produce null values for fields of missing parameters. 

public class ParameterConstraint<T> {

    private T minValue;
    private T maxValue;
}

name: Cores
defaultValue: 4
constraints:
  maxValue: 8

If I parse the above, the field minValue would be null. What I want is instead 


public class ParameterConstraint<T> {

    private Optional<T> minValue;
    private Optional<T> maxValue;
}


to take advantage of the Optional api. 

Is there any way to do this?

Nate

unread,
Feb 8, 2017, 11:22:23 AM2/8/17
to yamlbea...@googlegroups.com
I've not used YamlBeans with Optional. I actually don't like Optional. :) A PR to improve Optional support is welcome!

-Nate



--
--
You received this message because you are subscribed to the "yamlbeans-users" group:
http://groups.google.com/group/yamlbeans-users

---
You received this message because you are subscribed to the Google Groups "yamlbeans-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to yamlbeans-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages