Package io.dapr.utils

# Class Properties

java.lang.Object
io.dapr.utils.Properties

    public class Properties
    extends java.lang.Object

Global properties for Dapr's SDK, using Supplier so they are dynamically resolved.

- ## Field Summary

  Fields
  Modifier and Type | Field | Description
  --- | --- | ---
  `static java.util.function.Supplier<java.lang.Integer>` | `GRPC_PORT` | GRPC port for Dapr after checking system property and environment variable.
  `static java.util.function.Supplier<java.lang.Integer>` | `HTTP_PORT` | HTTP port for Dapr after checking system property and environment variable.
  `static java.util.function.Supplier<java.nio.charset.Charset>` | `STRING_CHARSET` | Determines which string encoding is used in Dapr's Java SDK.
  `static java.util.function.Supplier<java.lang.Boolean>` | `USE_GRPC` | Determines if Dapr client will use GRPC to talk to Dapr's side car.

- ## Constructor Summary

  Constructors
  Constructor | Description
  --- | ---
  `Properties()` |

- ## Method Summary

  Modifier and Type | Method | Description
  --- | --- | ---
  `static java.lang.Boolean` | `getBooleanOrDefault​(java.lang.String propName, java.lang.String envName, java.lang.Boolean defaultValue)` | Finds a boolean defined by system property first, then env variable or sticks to default.
  `static java.lang.Integer` | `getIntOrDefault​(java.lang.String propName, java.lang.String envName, java.lang.Integer defaultValue)` | Finds an integer defined by system property first, then env variable or sticks to default.
  `static java.lang.String` | `getStringOrDefault​(java.lang.String propName, java.lang.String envName, java.lang.String defaultValue)` | Finds a string defined by system property first, then env variable or sticks to default.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### HTTP_PORT

    public static final java.util.function.Supplier<java.lang.Integer> HTTP_PORT
    HTTP port for Dapr after checking system property and environment variable.

  - ### GRPC_PORT

    public static final java.util.function.Supplier<java.lang.Integer> GRPC_PORT
    GRPC port for Dapr after checking system property and environment variable.

  - ### USE_GRPC

    public static final java.util.function.Supplier<java.lang.Boolean> USE_GRPC
    Determines if Dapr client will use GRPC to talk to Dapr's side car.

  - ### STRING_CHARSET

    public static final java.util.function.Supplier<java.nio.charset.Charset> STRING_CHARSET
    Determines which string encoding is used in Dapr's Java SDK.

- ## Constructor Details

  - ### Properties

    public Properties()

- ## Method Details

  - ### getIntOrDefault

    public static java.lang.Integer getIntOrDefault​(java.lang.String propName, java.lang.String envName, java.lang.Integer defaultValue)
    Finds an integer defined by system property first, then env variable or sticks to default.
    Parameters:
      `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).
    Returns:
      Integer from system property (1st) or env variable (2nd) or default (last).

  - ### getBooleanOrDefault

    public static java.lang.Boolean getBooleanOrDefault​(java.lang.String propName, java.lang.String envName, java.lang.Boolean defaultValue)
    Finds a boolean defined by system property first, then env variable or sticks to default.
    Parameters:
      `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).
    Returns:
      Boolean from system property (1st) or env variable (2nd) or default (last).

  - ### getStringOrDefault

    public static java.lang.String getStringOrDefault​(java.lang.String propName, java.lang.String envName, java.lang.String defaultValue)
    Finds a string defined by system property first, then env variable or sticks to default.
    Parameters:
      `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).
    Returns:
      String from system property (1st) or env variable (2nd) or default (last).