Codota Logo
DataSetRequest$Builder
Code IndexAdd Codota to your IDE (free)

How to use
DataSetRequest$Builder
in
com.jimmoores.quandl

Best Java code snippets using com.jimmoores.quandl.DataSetRequest$Builder (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Connection c =
  • Codota IconDataSource dataSource;dataSource.getConnection()
  • Codota IconString url;DriverManager.getConnection(url)
  • Codota IconIdentityDatabaseUtil.getDBConnection()
  • Smart code suggestions by Codota
}
origin: jimmoores/quandl4j

@Test(expectedExceptions = QuandlRuntimeException.class)
public final void testDataSetRequestFrequency() {
 DataSetRequest.Builder.of("Hello").withFrequency(null).build();
}

origin: jimmoores/quandl4j

@Test
public void testMostComplexGetDataSetDifferentOrder() {
 // now try a different order
 QuandlSession session = getTestSession("https://www.quandl.com/api/v3/datasets/WIKI/AAPL.csv?start_date=2009-01-01&end_date=2010-12-31&column_index=4&collapse=quarterly&limit=10&transform=normalize");
 TabularResult tabularResult = session.getDataSet(DataSetRequest.Builder.of("WIKI/AAPL")
                                     .withFrequency(Frequency.QUARTERLY)
                                     .withColumn(CLOSE_COLUMN)
                                     .withStartDate(LocalDate.of(2009, 1, 1))
                                     .withEndDate(LocalDate.of(2010, 12, 31))
                                     .withMaxRows(10)
                                     .withTransform(Transform.NORMALIZE)
                                     .build());
 Assert.assertEquals(TEST_TABULAR_RESULT, tabularResult);
}

origin: jimmoores/quandl4j

@Test
public final void testComplexDataSetRequestEqualsAndHashCodeAgainstStringAndObject() {
 // Note that the tests on hashCode here are beyond the contract requirements of hashCode, we're saying they must differ if the object differs, which is 
 // generally good, but not required.
 DataSetRequest request1 = DataSetRequest.Builder
   .of("CODE/CODE")
   .withColumn(3)
   .withFrequency(Frequency.NONE)
   .withMaxRows(49)
   .withSortOrder(SortOrder.ASCENDING)
   .withStartDate(LocalDate.of(2010, 1, 1))
   .withEndDate(LocalDate.of(2011, 1, 1))
   .build();
 Assert.assertNotEquals(request1, "Hello");
 Assert.assertNotEquals(request1, new Object());
}
origin: jimmoores/quandl4j

@Test
public void testMoreComplexGetDataSet() {
 ClassicQuandlSessionInterface session = getTestSession("https://www.quandl.com/api/v3/datasets/WIKI/AAPL.csv?column_index=4&collapse=quarterly&transform=normalize");
 TabularResult tabularResult = session.getDataSet(DataSetRequest.Builder.of("WIKI/AAPL")
                                     .withFrequency(Frequency.QUARTERLY)
                                     .withColumn(CLOSE_COLUMN)
                                     .withTransform(Transform.NORMALIZE)
                                     .build());
 Assert.assertEquals(TEST_TABULAR_RESULT, tabularResult);
}

origin: jimmoores/quandl4j

@Test(expectedExceptions = QuandlRuntimeException.class)
public final void testDataSetRequestSortOrder() {
 DataSetRequest.Builder.of("Hello").withSortOrder(null).build();
}

origin: jimmoores/quandl4j

@Test(expectedExceptions = QuandlRuntimeException.class)
public final void testDataSetRequestEndDate() {
 DataSetRequest.Builder.of("Hello").withEndDate(null).build();
}

origin: jimmoores/quandl4j

@Test(expectedExceptions = QuandlRuntimeException.class)
public final void testDataSetRequestStartDate() {
 DataSetRequest.Builder.of("Hello").withStartDate(null).build();
}

origin: jimmoores/quandl4j

@Test(expectedExceptions = QuandlRuntimeException.class)
public final void testDataSetRequestEndDate() {
 DataSetRequest.Builder.of("Hello").withEndDate(null).build();
}

origin: jimmoores/quandl4j

@Test(expectedExceptions = QuandlRuntimeException.class)
public final void testDataSetRequestTransform() {
 DataSetRequest.Builder.of("Hello").withTransform(null).build();
}

origin: jimmoores/quandl4j

@Test(expectedExceptions = QuandlRuntimeException.class)
public final void testDataSetRequestFrequency() {
 DataSetRequest.Builder.of("Hello").withFrequency(null).build();
}

origin: jimmoores/quandl4j

@Test(expectedExceptions = QuandlRuntimeException.class)
public final void testDataSetRequestStartDate() {
 DataSetRequest.Builder.of("Hello").withStartDate(null).build();
}

origin: jimmoores/quandl4j

@Test(expectedExceptions = QuandlRuntimeException.class)
public final void testDataSetRequest() {
 DataSetRequest.Builder.of(null).build();
}

origin: jimmoores/quandl4j

@Test(expectedExceptions = QuandlRuntimeException.class)
public final void testDataSetRequest() {
 DataSetRequest.Builder.of(null).build();
}

origin: jimmoores/quandl4j

@Test
public final void testComplexDataSetRequestEqualsAndHashCodeAgainstStringAndObject() {
 // Note that the tests on hashCode here are beyond the contract requirements of hashCode, we're saying they must differ if the object differs, which is 
 // generally good, but not required.
 DataSetRequest request1 = DataSetRequest.Builder
   .of("CODE/CODE")
   .withColumn(3)
   .withFrequency(Frequency.NONE)
   .withMaxRows(49)
   .withSortOrder(SortOrder.ASCENDING)
   .withStartDate(LocalDate.of(2010, 1, 1))
   .withEndDate(LocalDate.of(2011, 1, 1))
   .build();
 Assert.assertNotEquals(request1, "Hello");
 Assert.assertNotEquals(request1, new Object());
}
origin: jimmoores/quandl4j

/**
 * The main body of the code.
 */
private void run() {
 ClassicQuandlSession session = ClassicQuandlSession.create();
 TabularResult tabularResult = session.getDataSet(
   DataSetRequest.Builder
    .of("WIKI/AAPL")
    .withFrequency(Frequency.QUARTERLY)
    .withColumn(CLOSE_COLUMN)
    .withTransform(Transform.NORMALIZE)
    .build());
 System.out.println(tabularResult.toPrettyPrintedString());  }
origin: jimmoores/quandl4j

/**
 * The main body of the code.
 */
private void run() {
 ClassicQuandlSession quandl = ClassicQuandlSession.create();
 SearchResult searchResult = quandl.search(SearchRequest.Builder.ofQuery("Apple").withMaxPerPage(2).build());
 System.out.println(searchResult.toPrettyPrintedString());
 for (MetaDataResult metaData : searchResult.getMetaDataResultList()) {
  System.out.println(PrettyPrinter.toPrettyPrintedString(metaData.getRawJSON()));
 }
 TabularResult tabularResult = null;
 tabularResult = quandl.getDataSet(DataSetRequest.Builder.of("WIKI/AAPL").withFrequency(Frequency.QUARTERLY)
                                    .withColumn(CLOSE_COLUMN).withTransform(Transform.NORMALIZE).build());
 System.out.println(PrettyPrinter.toPrettyPrintedString(tabularResult));
 MetaDataResult metaData = quandl.getMetaData(MetaDataRequest.of("WIKI/AAPL"));
 System.out.println(PrettyPrinter.toPrettyPrintedString(metaData.getRawJSON()));
}
origin: jimmoores/quandl4j

@Test
public void testMostComplexGetDataSetDifferentOrder() {
 // now try a different order
 ClassicQuandlSessionInterface session = getTestSession("https://www.quandl.com/api/v3/datasets/WIKI/AAPL.csv?start_date=2009-01-01&end_date=2010-12-31&column_index=4&collapse=quarterly&limit=10&transform=normalize");
 TabularResult tabularResult = session.getDataSet(DataSetRequest.Builder.of("WIKI/AAPL")
                                     .withFrequency(Frequency.QUARTERLY)
                                     .withColumn(CLOSE_COLUMN)
                                     .withStartDate(LocalDate.of(2009, 1, 1))
                                     .withEndDate(LocalDate.of(2010, 12, 31))
                                     .withMaxRows(10)
                                     .withTransform(Transform.NORMALIZE)
                                     .build());
 Assert.assertEquals(TEST_TABULAR_RESULT, tabularResult);
}

origin: jimmoores/quandl4j

/**
 * The main body of the code.
 */
private void run() {
 ClassicQuandlSession session = ClassicQuandlSession.create();
 TabularResult tabularResult = session.getDataSet(
   DataSetRequest.Builder
    .of("SSE/VROS") // VERIANOS REAL ESTATE AG on Boerse Stuttgart
    .withColumn(3) // Last (looked up previously)
    .withStartDate(RECENTISH_DATE)
    .withFrequency(Frequency.MONTHLY)
    .build());
 System.out.println("Header definition: " + tabularResult.getHeaderDefinition());
 for (final Row row : tabularResult) {
  LocalDate date = row.getLocalDate("Date");
  Double value = row.getDouble("Last");
  System.out.println("Value on date " + date + " was " + value);
 } 
}

origin: jimmoores/quandl4j

@Test(expectedExceptions = QuandlRuntimeException.class)
public final void testDataSetRequestTransform() {
 DataSetRequest.Builder.of("Hello").withTransform(null).build();
}

origin: jimmoores/quandl4j

@Test
public final void testSimpleDataSetRequestEqualsAndHashCode() {
 DataSetRequest request1 = DataSetRequest.Builder.of("Hello").build();
 DataSetRequest request2 = DataSetRequest.Builder.of("Hello").build();
 DataSetRequest request3 = DataSetRequest.Builder.of("Goodbye").build();
 Assert.assertEquals(request1, request1);
 Assert.assertEquals(request1.hashCode(), request1.hashCode());
 Assert.assertEquals(request2, request1);
 Assert.assertEquals(request2.hashCode(), request1.hashCode());
 Assert.assertNotEquals(request3, request1);
 Assert.assertNotEquals(request3, request2);
 Assert.assertNotEquals(request1, null);
 Assert.assertNotEquals(request2, null);
 Assert.assertNotEquals(request3, null);
 Assert.assertEquals(request3.hashCode(), request3.hashCode());
 Assert.assertNotEquals(request3.hashCode(), request2.hashCode());
 // we can't assert that 
}
com.jimmoores.quandlDataSetRequest$Builder

Javadoc

Inner builder class. Create an instance using of("QUANDL/CODE"), call any other methods you need, and finish by calling build().

Most used methods

  • build
    Build the request object.
  • of
    Create the base DataSetRequest object passing in the Quandl code.
  • withMaxRows
    Optionally specify the maximum number of rows that should be returns for the request.
  • withColumn
    Optionally specify a specific column for the request. This can only be used once per request.
  • withEndDate
    Optionally specify an end date cut-off for the request.
  • withFrequency
    Optionally specify the sampling frequency for the request.
  • withSortOrder
    Optionally specify the sort order of the results.
  • withStartDate
    Optionally specify a start date cut-off for the request.
  • withTransform
    Optionally specify a data transformation function for the request.
  • <init>

Popular in Java

  • Finding current android device location
  • findViewById (Activity)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • addToBackStack (FragmentTransaction)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now