code: public static StageInfo createStageInfo(String locationType, String location, Map credentials,
                                            String region, String endPoint, String storageAccount)
    throws IllegalArgumentException
    {
      StageType stageType;
      // Ensure that all the required parameters are specified
      switch (locationType)
      {
        case "AZURE":
          stageType = StageType.AZURE;
          if (!isSpecified(location) || !isSpecified(endPoint) || !isSpecified(storageAccount)
              || credentials == null)
          {
            throw new IllegalArgumentException("Incomplete parameters specified for Azure stage");
          }
          break;
  
        case "S3":
          stageType = StageType.S3;
          if (!isSpecified(location) || !isSpecified(region) || credentials == null)
          {
            throw new IllegalArgumentException("Incomplete parameters specified for S3 stage");
          }
          break;
  
        case "LOCAL_FS":
          stageType = StageType.LOCAL_FS;
          if (!isSpecified(location))
          {
            throw new IllegalArgumentException("Incomplete parameters specific for local stage");
          }
          break;
  
        default:
          throw new IllegalArgumentException("Invalid stage type: " + locationType);
      }
      return new StageInfo(stageType, location, credentials, region, endPoint, storageAccount);
    }
docs: /*
  Creates a StageInfo object
  Validates that the necessary Stage info arguments are specified
  
  @param locationType the type of stage, i.e. AZURE/S3
  @param location The container/bucket
  @param credentials Map of cloud provider credentials
  @param region The geographic region where the stage is located (S3 only)
  @param endPoint The Azure Storage end point (Azure only)
  @param storageAccount The Azure Storage account (azure only)
  @throws IllegalArgumentException one or more parameters required were missing