examples/iot-nirvana/client/src/main/java/com/google/cloud/demo/iot/nirvana/client/ClientOptions.java
/** Define all the input parameters. */
Define all the input parameters.
Define all the input parameters .
private Options initOptions() {
    Option optGcpProjectId = new Option(INPUT_PARAM_GCP_PROJECT_ID, true, "GCP Project ID");
    optGcpProjectId.setRequired(true);
    Option optGcpRegion = new Option(INPUT_PARAM_GCP_REGION, true, "GCP region");
    optGcpRegion.setRequired(true);
    Option optRegistryName =
        new Option(INPUT_PARAM_CLOUD_IOT_REGISTRY_NAME, true, "Cloud IoT Core registry name");
    optRegistryName.setRequired(true);
    Option optRsaCertificateFilePath =
        new Option(INPUT_PARAM_RSA_CERTIFICATE_FILE_PATH, true, "RSA certificate file path");
    optRsaCertificateFilePath.setRequired(true);
    Option optPrivateKey = new Option(INPUT_PARAM_PRIVATE_KEY, true, "Private Key (PKCS8 format)");
    optPrivateKey.setRequired(true);
    Option optCityIndex = new Option(INPUT_PARAM_INDEX, true, "city index [0-18]");
    optCityIndex.setRequired(true);
    Options options = new Options();
    options.addOption(optGcpProjectId);
    options.addOption(optGcpRegion);
    options.addOption(optRegistryName);
    options.addOption(optRsaCertificateFilePath);
    options.addOption(optPrivateKey);
    options.addOption(optCityIndex);
    return options;
  }
private Options initOptions ( ) { Option optGcpProjectId = new Option ( INPUT_PARAM_GCP_PROJECT_ID , true , "GCP Project ID" ) ; optGcpProjectId . setRequired ( true ) ; Option optGcpRegion = new Option ( INPUT_PARAM_GCP_REGION , true , "GCP region" ) ; optGcpRegion . setRequired ( true ) ; Option optRegistryName = new Option ( INPUT_PARAM_CLOUD_IOT_REGISTRY_NAME , true , "Cloud IoT Core registry name" ) ; optRegistryName . setRequired ( true ) ; Option optRsaCertificateFilePath = new Option ( INPUT_PARAM_RSA_CERTIFICATE_FILE_PATH , true , "RSA certificate file path" ) ; optRsaCertificateFilePath . setRequired ( true ) ; Option optPrivateKey = new Option ( INPUT_PARAM_PRIVATE_KEY , true , "Private Key (PKCS8 format)" ) ; optPrivateKey . setRequired ( true ) ; Option optCityIndex = new Option ( INPUT_PARAM_INDEX , true , "city index [0-18]" ) ; optCityIndex . setRequired ( true ) ; Options options = new Options ( ) ; options . addOption ( optGcpProjectId ) ; options . addOption ( optGcpRegion ) ; options . addOption ( optRegistryName ) ; options . addOption ( optRsaCertificateFilePath ) ; options . addOption ( optPrivateKey ) ; options . addOption ( optCityIndex ) ; return options ; }
Define all the input parameters.
Define all the input parameters .
// Define input parameters one by one // Wrap all input parameters