Re: System.getEnv(String name, String def)

2021-02-18 Thread Éamonn McManus
Env(key, "n/a") > should be a good addition. > > Regards, > > Loïc > > Le mar. 16 févr. 2021 à 21:59, Remi Forax a écrit : > > > - Mail original - > > > De: "Michael Kuhlmann" > > > À: "core-libs-dev" > > &g

Re: System.getEnv(String name, String def)

2021-02-18 Thread Loïc MATHIEU
l Kuhlmann" > > À: "core-libs-dev" > > Envoyé: Mardi 16 Février 2021 13:34:30 > > Objet: Re: System.getEnv(String name, String def) > > > Hi Rémi, > > > > I don't want to be pedantic, but I see this as an anti-pattern. You > > would cre

Re: System.getEnv(String name, String def)

2021-02-16 Thread Remi Forax
- Mail original - > De: "Michael Kuhlmann" > À: "core-libs-dev" > Envoyé: Mardi 16 Février 2021 13:34:30 > Objet: Re: System.getEnv(String name, String def) > Hi Rémi, > > I don't want to be pedantic, but I see this as an anti-pattern. You

Re: System.getEnv(String name, String def)

2021-02-16 Thread Michael Kuhlmann
var fooOptional = Optional.ofNullable(System.getenv("FOO")); var fooValue = fooOptional.orElse(defaultValue); regards, Rémi Forax - Mail original - De: "Loïc MATHIEU" À: "core-libs-dev" Envoyé: Lundi 15 Février 2021 14:59:42 Objet: System.getEnv(String n

Re: System.getEnv(String name, String def)

2021-02-15 Thread Roger Riggs
wonder if there has already been some discussion to provide a System.getEnv(String name, String def) method that allows to return a default value in case the env variable didn't exist. When using system properties instead of env variable, we do have a System.getProperty(String key, String def) va

Re: System.getEnv(String name, String def)

2021-02-15 Thread Remi Forax
l original - > De: "Loïc MATHIEU" > À: "core-libs-dev" > Envoyé: Lundi 15 Février 2021 14:59:42 > Objet: System.getEnv(String name, String def) > Hello, > > I wonder if there has already been some discussion to provide > a System.getEnv(String name, Stri

System.getEnv(String name, String def)

2021-02-15 Thread Loïc MATHIEU
Hello, I wonder if there has already been some discussion to provide a System.getEnv(String name, String def) method that allows to return a default value in case the env variable didn't exist. When using system properties instead of env variable, we do have a System.getProperty(Strin