public class Properties extends Object
Modifier and Type | Field and Description |
---|---|
static Supplier<Integer> |
GRPC_PORT
GRPC port for Dapr after checking system property and environment variable.
|
static Supplier<Integer> |
HTTP_PORT
HTTP port for Dapr after checking system property and environment variable.
|
static Supplier<Boolean> |
USE_GRPC
Determines if Dapr client will use GRPC to talk to Dapr's side car.
|
Constructor and Description |
---|
Properties() |
Modifier and Type | Method and Description |
---|---|
static Boolean |
getBooleanOrDefault(String propName,
String envName,
Boolean defaultValue)
Finds a boolean defined by system property first, then env variable or sticks to default.
|
static Integer |
getIntOrDefault(String propName,
String envName,
Integer defaultValue)
Finds an integer defined by system property first, then env variable or sticks to default.
|
public static final Supplier<Integer> HTTP_PORT
public static final Supplier<Integer> GRPC_PORT
public static Integer getIntOrDefault(String propName, String envName, Integer defaultValue)
propName
- Name of the JVM's system property to override (1st).envName
- Name of env variable (2nd).defaultValue
- Default value if cannot find a valid config (last).public static Boolean getBooleanOrDefault(String propName, String envName, Boolean defaultValue)
propName
- Name of the JVM's system property to override (1st).envName
- Name of env variable (2nd).defaultValue
- Default value if cannot find a valid config (last).Copyright © 2020. All rights reserved.