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
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
- 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
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
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
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
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