/*
 * Copyright 2014 Red Hat, Inc.
 *
 * Red Hat licenses this file to you under the Apache License, version 2.0
 * (the "License"); you may not use this file except in compliance with the
 * License.  You may obtain a copy of the License at:
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */

package io.reactiverse.rxjava.pgclient;

import java.util.Map;
import rx.Observable;
import rx.Single;
import java.util.List;

Represents the result of an operation on database.

NOTE: This class has been automatically generated from the original non RX-ified interface using Vert.x codegen.
/** * Represents the result of an operation on database. * * <p/> * NOTE: This class has been automatically generated from the {@link io.reactiverse.pgclient.PgResult original} non RX-ified interface using Vert.x codegen. */
@io.vertx.lang.rx.RxGen(io.reactiverse.pgclient.PgResult.class) public class PgResult<T> { @Override public String toString() { return delegate.toString(); } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; PgResult that = (PgResult) o; return delegate.equals(that.delegate); } @Override public int hashCode() { return delegate.hashCode(); } public static final io.vertx.lang.rx.TypeArg<PgResult> __TYPE_ARG = new io.vertx.lang.rx.TypeArg<>( obj -> new PgResult((io.reactiverse.pgclient.PgResult) obj), PgResult::getDelegate ); private final io.reactiverse.pgclient.PgResult<T> delegate; public final io.vertx.lang.rx.TypeArg<T> __typeArg_0; public PgResult(io.reactiverse.pgclient.PgResult delegate) { this.delegate = delegate; this.__typeArg_0 = io.vertx.lang.rx.TypeArg.unknown(); } public PgResult(io.reactiverse.pgclient.PgResult delegate, io.vertx.lang.rx.TypeArg<T> typeArg_0) { this.delegate = delegate; this.__typeArg_0 = typeArg_0; } public io.reactiverse.pgclient.PgResult getDelegate() { return delegate; }
Get the number of the affected rows in the operation to this PgResult.

The meaning depends on the executed statement:
  • INSERT: the number of rows inserted
  • DELETE: the number of rows deleted
  • UPDATE: the number of rows updated
  • SELECT: the number of rows retrieved
Returns:the count of affected rows.
/** * Get the number of the affected rows in the operation to this PgResult. * <p/> * The meaning depends on the executed statement: * <ul> * <li>INSERT: the number of rows inserted</li> * <li>DELETE: the number of rows deleted</li> * <li>UPDATE: the number of rows updated</li> * <li>SELECT: the number of rows retrieved</li> * </ul> * @return the count of affected rows. */
public int rowCount() { int ret = delegate.rowCount(); return ret; }
Get the names of columns in the PgResult.
Returns:the list of names of columns.
/** * Get the names of columns in the PgResult. * @return the list of names of columns. */
public List<String> columnsNames() { List<String> ret = delegate.columnsNames(); return ret; }
Get the number of rows in the PgResult.
Returns:the count of rows.
/** * Get the number of rows in the PgResult. * @return the count of rows. */
public int size() { int ret = delegate.size(); return ret; }
Get the result value.
Returns:the result
/** * Get the result value. * @return the result */
public T value() { T ret = (T)__typeArg_0.wrap(delegate.value()); return ret; }
Return the next available result or null, e.g for a simple query that executed multiple queries or for a batch result.
Returns:the next available result or null if none is available
/** * Return the next available result or <code>null</code>, e.g for a simple query that executed multiple queries or for * a batch result. * @return the next available result or <code>null</code> if none is available */
public io.reactiverse.rxjava.pgclient.PgResult<T> next() { io.reactiverse.rxjava.pgclient.PgResult<T> ret = io.reactiverse.rxjava.pgclient.PgResult.newInstance(delegate.next(), __typeArg_0); return ret; } public static <T>PgResult<T> newInstance(io.reactiverse.pgclient.PgResult arg) { return arg != null ? new PgResult<T>(arg) : null; } public static <T>PgResult<T> newInstance(io.reactiverse.pgclient.PgResult arg, io.vertx.lang.rx.TypeArg<T> __typeArg_T) { return arg != null ? new PgResult<T>(arg, __typeArg_T) : null; } }