/** * Optionally specify a data transformation function for the request. * * @param transform the data transformation method that the server should pre-process the data with * @return a Builder instance, not null */ public Builder withTransform(final Transform transform) { ArgumentChecker.notNull(transform, "transform"); _transform = transform; return this; }
/** * Constructor to augment enum with correct quandl API string. * * @param quandlString string to pass to Quandl REST API */ Frequency(final String quandlString) { ArgumentChecker.notNullOrEmpty(quandlString, "quandlString"); _quandlString = quandlString; }
/** * Optionally specify a start date cut-off for the request. * * @param startDate the start date of the request (inclusive), not null * @return a Builder instance, not null */ public Builder withStartDate(final LocalDate startDate) { ArgumentChecker.notNull(startDate, "startDate"); _startDate = startDate; return this; }
/** * Create the base DataSetRequest object passing in the Quandl code. * * @param quandlCodeRequests the quandl codes/columns (VarArgs) you're interested in, not null * @return a Builder instance, not null */ public static Builder of(final QuandlCodeRequest... quandlCodeRequests) { ArgumentChecker.notNullOrEmpty(quandlCodeRequests, "quandlCodeRequests"); return new Builder(Arrays.asList(quandlCodeRequests)); }
/** * Optionally specify the sort order of the results. * * @param sortOrder the sort order of the results * @return a Builder object onto which you can chain additional calls */ public Builder withSortOrder(final SortOrder sortOrder) { ArgumentChecker.notNull(sortOrder, "sortOrder"); _sortOrder = sortOrder; return this; }
/** * Factory method to create a meta data request instance. * * @param quandlCodes the list of quandl codes for the meta data required, not null * @return an instance of the MetaDataRequest for the given quandlCode, not null */ public static MultiMetaDataRequest of(final List<String> quandlCodes) { ArgumentChecker.notNullOrEmpty(quandlCodes, "quandlCodes"); return new MultiMetaDataRequest(quandlCodes); }
/** * Optionally specify a data transformation function for the request. * * @param transform the data transformation method that the server should pre-process the data with * @return a Builder instance, not null */ public Builder withTransform(final Transform transform) { ArgumentChecker.notNull(transform, "transform"); _transform = transform; return this; }
/** * Factory method to create a meta data request instance. * * @param quandlCodes the list of quandl codes for the meta data required (varargs), not null * @return an instance of the MetaDataRequest for the given quandlCode, not null */ public static MultiMetaDataRequest of(final String... quandlCodes) { ArgumentChecker.notNullOrEmpty(quandlCodes, "quandlCodes"); return new MultiMetaDataRequest(Arrays.asList(quandlCodes)); }
/** * Optionally specify the sort order of the results. * * @param sortOrder the sort order of the results * @return a Builder object onto which you can chain additional calls */ public Builder withSortOrder(final SortOrder sortOrder) { ArgumentChecker.notNull(sortOrder, "sortOrder"); _sortOrder = sortOrder; return this; }
/** * Create the base DataSetRequest object passing in the Quandl code. * * @param quandlCodeRequests the list of quandl codes/columns you're interested in, not null * @return a Builder instance, not null */ public static Builder of(final List<QuandlCodeRequest> quandlCodeRequests) { ArgumentChecker.notNullOrEmpty(quandlCodeRequests, "quandlCodeRequests"); return new Builder(quandlCodeRequests); }
/** * Specify the database to search within. For example WIKI * * @param databaseCode the database code to search within, not null. * @return this Builder, with this database code specified */ public Builder withDatabaseCode(final String databaseCode) { ArgumentChecker.notNull(databaseCode, "databaseCode"); _databaseCode = databaseCode; return this; }
/** * Specify the search term to use for your query. Multiple search terms can be separated by * the + character. * * @param query the query string to use, not null * @return this Builder, with this query added */ public Builder withQuery(final String query) { ArgumentChecker.notNull(query, "query"); _query = query; return this; }
/** * Optionally specify an end date cut-off for the request. * * @param endDate the end date of the request (inclusive), not null * @return a Builder instance, not null */ public Builder withEndDate(final LocalDate endDate) { ArgumentChecker.notNull(endDate, "endDate"); _endDate = endDate; return this; }
/** * Optionally specify an end date cut-off for the request. * * @param endDate the end date of the request (inclusive), not null * @return a Builder instance, not null */ public Builder withEndDate(final LocalDate endDate) { ArgumentChecker.notNull(endDate, "endDate"); _endDate = endDate; return this; }
/** * Optionally specify the sampling frequency for the request. * * @param frequency the sampling frequency, not null * @return a Builder instance, not null */ public Builder withFrequency(final Frequency frequency) { ArgumentChecker.notNull(frequency, "frequency"); _frequency = frequency; return this; }
/** * Optionally specify a start date cut-off for the request. * * @param startDate the start date of the request (inclusive), not null * @return a Builder instance, not null */ public Builder withStartDate(final LocalDate startDate) { ArgumentChecker.notNull(startDate, "startDate"); _startDate = startDate; return this; }
/** * Optionally specify the sampling frequency for the request. * * @param frequency the sampling frequency, not null * @return a Builder instance, not null */ public Builder withFrequency(final Frequency frequency) { ArgumentChecker.notNull(frequency, "frequency"); _frequency = frequency; return this; }
/** * Specify the number of retries to execute before giving up on a request. * * @param retryPolicy the policy to follow regarding retries * @return this builder */ public Builder withRetryPolicy(final RetryPolicy retryPolicy) { ArgumentChecker.notNull(retryPolicy, "retryPolicy"); _retryPolicy = retryPolicy; return this; }
/** * Specify a custom RESTDataProvider for the session to use when sending requests, intended for testing purposes. * * @deprecated you should pass this into the QuandlSessionFactory instead * @param restDataProvider a RESTDataProvider for the session * @return this builder */ public Builder withRESTDataProvider(final RESTDataProvider restDataProvider) { ArgumentChecker.notNull(restDataProvider, "restDataProvider"); _restDataProvider = restDataProvider; _isRestDataProviderSet = true; return this; }
/** * Create a tabular result set from a header definition and an ordered list of rows. * * @param headerDefinition the definition of the header row, not null * @param rows a list of rows, not null * @return the {@code TabularResult} instance */ public static TabularResult of(final HeaderDefinition headerDefinition, final List<Row> rows) { ArgumentChecker.notNull(headerDefinition, "headerDefinition"); ArgumentChecker.notNull(rows, "rows"); return new TabularResult(headerDefinition, rows); }