Java Code Examples for io.vertx.codegen.annotations.GenIgnore#PERMITTED_TYPE

The following examples show how to use io.vertx.codegen.annotations.GenIgnore#PERMITTED_TYPE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Tuple.java    From vertx-sql-client with Apache License 2.0 6 votes vote down vote up
/**
 * Get an array of  {@link LocalDate} value at {@code pos}.
 *
 * <p>Target element instance of {@code LocalDateTime[]} will be
 * coerced to {@code LocalDate[]}.
 *
 * @param pos the position
 * @return the value or {@code null}
 */
@GenIgnore(GenIgnore.PERMITTED_TYPE)
default LocalDate[] getLocalDateArray(int pos) {
  Object val = getValue(pos);
  if (val instanceof LocalDate[]) {
    return (LocalDate[]) val;
  } else if (val instanceof LocalDateTime[]) {
    LocalDateTime[] a = (LocalDateTime[]) val;
    int len = a.length;
    LocalDate[] arr = new LocalDate[len];
    for (int i = 0; i < len; i++) {
      LocalDateTime elt = a[i];
      if (elt != null) {
        arr[i] = elt.toLocalDate();
      }
    }
    return arr;
  } else {
    return null;
  }
}
 
Example 2
Source File: Tuple.java    From vertx-sql-client with Apache License 2.0 5 votes vote down vote up
/**
 * Get {@link java.time.LocalDate} value at {@code pos}.
 *
 * <p>Target element instance of {@code LocalDateTime} will be
 * coerced to {@code LocalDate}.
 *
 * @param pos the position
 * @return the value or {@code null}
 */
@GenIgnore(GenIgnore.PERMITTED_TYPE)
default LocalDate getLocalDate(int pos) {
  Object val = getValue(pos);
  if (val instanceof LocalDate) {
    return (LocalDate) val;
  } else if (val instanceof LocalDateTime) {
    return ((LocalDateTime) val).toLocalDate();
  }
  return null;
}
 
Example 3
Source File: Tuple.java    From vertx-sql-client with Apache License 2.0 5 votes vote down vote up
/**
 * Get {@link java.util.UUID} value at {@code pos}.
 *
 * @param pos the position
 * @return the value or {@code null}
 */
@GenIgnore(GenIgnore.PERMITTED_TYPE)
default UUID getUUID(int pos) {
  Object val = getValue(pos);
  if (val instanceof UUID) {
    return (UUID) val;
  } else if (val instanceof String) {
    return UUID.fromString((String) val);
  }
  return null;
}
 
Example 4
Source File: Tuple.java    From vertx-sql-client with Apache License 2.0 5 votes vote down vote up
/**
 * Get an array of  {@link LocalDateTime} value at {@code pos}.
 *
 * @param pos the position
 * @return the value or {@code null}
 */
@GenIgnore(GenIgnore.PERMITTED_TYPE)
default LocalDateTime[] getLocalDateTimeArray(int pos) {
  Object val = getValue(pos);
  if (val instanceof LocalDateTime[]) {
    return (LocalDateTime[]) val;
  } else {
    return null;
  }
}
 
Example 5
Source File: CassandraClient.java    From vertx-cassandra-client with Apache License 2.0 2 votes vote down vote up
/**
 * Executes the given SQL statement which returns the results of the query as a read stream.
 *
 * @param statement the statement to execute.
 * @param rowStreamHandler the handler which is called once the operation completes. It will return an instance of {@link CassandraRowStream}.
 *
 * @return current Cassandra client instance
 */
@GenIgnore(GenIgnore.PERMITTED_TYPE)
@Fluent
CassandraClient queryStream(Statement statement, Handler<AsyncResult<CassandraRowStream>> rowStreamHandler);
 
Example 6
Source File: Row.java    From vertx-sql-client with Apache License 2.0 2 votes vote down vote up
/**
 * Get an array of {@link Long} value at {@code pos}.
 *
 * @param name the column
 * @return the value or {@code null}
 */
@GenIgnore(GenIgnore.PERMITTED_TYPE)
default Long[] getLongArray(String name) {
  int pos = getColumnIndex(name);
  return pos == -1 ? null : getLongArray(pos);
}
 
Example 7
Source File: ResultSet.java    From vertx-cassandra-client with Apache License 2.0 2 votes vote down vote up
/**
 * @see AsyncResultSet#currentPage()
 */
@GenIgnore(GenIgnore.PERMITTED_TYPE)
Iterable<Row> currentPage();
 
Example 8
Source File: Tuple.java    From vertx-sql-client with Apache License 2.0 2 votes vote down vote up
/**
 * Add an array of {@link LocalDateTime} value at the end of the tuple.
 *
 * @param value the value
 * @return a reference to this, so the API can be used fluently
 */
@GenIgnore(GenIgnore.PERMITTED_TYPE)
default Tuple addLocalDateTimeArray(LocalDateTime[] value) {
  return addValue(value);
}
 
Example 9
Source File: Tuple.java    From vertx-sql-client with Apache License 2.0 2 votes vote down vote up
/**
 * Add an array of {@link Temporal} value at the end of the tuple.
 *
 * @param value the value
 * @return a reference to this, so the API can be used fluently
 */
@GenIgnore(GenIgnore.PERMITTED_TYPE)
default Tuple addTemporalArray(Temporal[] value) {
  return addValue(value);
}
 
Example 10
Source File: ResultSet.java    From vertx-cassandra-client with Apache License 2.0 2 votes vote down vote up
/**
 * The method should <strong>not</strong> be used concurrently with others like {@link #fetchNextPage()} or {@link #one(Handler)}.
 * This may lead to unexpected result.
 *
 * @param handler handler called when all the rows is fetched
 */
@GenIgnore(GenIgnore.PERMITTED_TYPE)
@Fluent
ResultSet all(Handler<AsyncResult<List<Row>>> handler);
 
Example 11
Source File: Tuple.java    From vertx-sql-client with Apache License 2.0 2 votes vote down vote up
/**
 * Add a {@link java.time.LocalTime} value at the end of the tuple.
 *
 * @param value the value
 * @return a reference to this, so the API can be used fluently
 */
@GenIgnore(GenIgnore.PERMITTED_TYPE)
default Tuple addLocalTime(LocalTime value) {
  return addValue(value);
}
 
Example 12
Source File: CassandraClient.java    From vertx-cassandra-client with Apache License 2.0 2 votes vote down vote up
/**
 * Like {@link #queryStream(Statement, Handler)} but returns a {@code Future} of the asynchronous result.
 */
@GenIgnore(GenIgnore.PERMITTED_TYPE)
Future<CassandraRowStream> queryStream(Statement statement);
 
Example 13
Source File: Tuple.java    From vertx-sql-client with Apache License 2.0 2 votes vote down vote up
/**
 * Add a {@link java.time.OffsetDateTime} value at the end of the tuple.
 *
 * @param value the value
 * @return a reference to this, so the API can be used fluently
 */
@GenIgnore(GenIgnore.PERMITTED_TYPE)
default Tuple addOffsetDateTime(OffsetDateTime value) {
  return addValue(value);
}
 
Example 14
Source File: Tuple.java    From vertx-sql-client with Apache License 2.0 2 votes vote down vote up
/**
 * Wrap the provided {@code array} with a tuple.
 * <br/>
 * The array is not copied and is used as store for tuple elements.
 *
 * @return the list wrapped as a tuple
 */
@GenIgnore(GenIgnore.PERMITTED_TYPE)
static Tuple wrap(Object... array) {
  return new ListTuple(Arrays.asList(array));
}
 
Example 15
Source File: Tuple.java    From vertx-sql-client with Apache License 2.0 2 votes vote down vote up
/**
 * Add an array of {@link String} value at the end of the tuple.
 *
 * @param value the value
 * @return a reference to this, so the API can be used fluently
 */
@GenIgnore(GenIgnore.PERMITTED_TYPE)
default Tuple addStringArray(String[] value) {
  return addValue(value);
}
 
Example 16
Source File: Tuple.java    From vertx-sql-client with Apache License 2.0 2 votes vote down vote up
/**
 * Add a {@link java.time.temporal.Temporal} value at the end of the tuple.
 *
 * @param value the value
 * @return a reference to this, so the API can be used fluently
 */
@GenIgnore(GenIgnore.PERMITTED_TYPE)
default Tuple addTemporal(Temporal value) {
  return addValue(value);
}
 
Example 17
Source File: Tuple.java    From vertx-sql-client with Apache License 2.0 2 votes vote down vote up
/**
 * Add an array of {@link Long} value at the end of the tuple.
 *
 * @param value the value
 * @return a reference to this, so the API can be used fluently
 */
@GenIgnore(GenIgnore.PERMITTED_TYPE)
default Tuple addLongArray(Long[] value) {
  return addValue(value);
}
 
Example 18
Source File: Row.java    From vertx-sql-client with Apache License 2.0 2 votes vote down vote up
/**
 * Get {@link BigDecimal} value at {@code pos}.
 *
 * @param name the column
 * @return the value or {@code null}
 */
@GenIgnore(GenIgnore.PERMITTED_TYPE)
default BigDecimal getBigDecimal(String name) {
  int pos = getColumnIndex(name);
  return pos == -1 ? null : getBigDecimal(pos);
}
 
Example 19
Source File: CassandraClient.java    From vertx-cassandra-client with Apache License 2.0 2 votes vote down vote up
/**
 * Execute the query and provide a handler for consuming results.
 *
 * @param resultHandler handler called when result of execution is fully fetched.
 * @param query the query to execute
 *
 * @return current Cassandra client instance
 */
@GenIgnore(GenIgnore.PERMITTED_TYPE)
@Fluent
CassandraClient executeWithFullFetch(String query, Handler<AsyncResult<List<Row>>> resultHandler);
 
Example 20
Source File: Tuple.java    From vertx-sql-client with Apache License 2.0 2 votes vote down vote up
/**
 * Add an array of {@link LocalDate} value at the end of the tuple.
 *
 * @param value the value
 * @return a reference to this, so the API can be used fluently
 */
@GenIgnore(GenIgnore.PERMITTED_TYPE)
default Tuple addLocalDateArray(LocalDate[] value) {
  return addValue(value);
}