Top Inners Fields Constructors Methods
org.jooq.impl

pack-priv final Class ResultsImpl

extends AbstractList<Result<Record>>
implements Results
Class Inheritance
All Implemented Interfaces
org.jooq.Results, org.jooq.Attachable, java.io.Serializable, java.util.List, java.util.SequencedCollection, java.util.Collection, java.lang.Iterable
Imports
java.util.AbstractList, .ArrayList, .List, org.jooq.Configuration, .Record, .Result, .ResultOrRows, .Results, org.jooq.exception.DataAccessException

Author
Lukas Eder

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static record

Field Summary

Modifier and TypeField and Description
private Configuration
pack-priv final List<ResultOrRows>
Inherited from java.util.AbstractList:
modCount

Constructor Summary

AccessConstructor and Description
pack-priv
ResultsImpl(Configuration configuration)

Method Summary

Modifier and TypeMethod and Description
public void
add(int
index at which the specified element is to be inserted
index
,
Result<Record>
element to be inserted
element
)

Overrides java.util.AbstractList.add.

Implements java.util.List.add.

Inserts the specified element at the specified position in this list (optional operation).
public final void
attach(Configuration
A configuration or null, if you wish to detach this Attachable from its previous configuration.
c
)

Implements org.jooq.Results.attach.

Attach all results and all of their contained records to a new Configuration.
public void
clear()

Overrides java.util.AbstractList.clear.

Implements java.util.List.clear, java.util.Collection.clear.

Removes all of the elements from this list (optional operation).
public final Configuration
configuration()

Implements org.jooq.Attachable.configuration.

Get the currently attached Configuration, or null if no Configuration is attached.
public final void
detach()

Implements org.jooq.Results.detach.

Detach all results and all of their contained records from their current Configuration.
public boolean
equals(Object
the object to be compared for equality with this list
obj
)

Overrides java.util.AbstractList.equals.

Implements java.util.List.equals, java.util.Collection.equals.

Compares the specified object with this list for equality.
public final Result<Record>
get(int
index of the element to return
index
)

Implements abstract java.util.AbstractList.get.

Implements java.util.List.get.

Returns the element at the specified position in this list.
public int
hashCode()

Overrides java.util.AbstractList.hashCode.

Implements java.util.List.hashCode, java.util.Collection.hashCode.

Returns the hash code value for this list.
private final List<Result<Record>>
list()

public Result<Record>
remove(int
the index of the element to be removed
index
)

Overrides java.util.AbstractList.remove.

Implements java.util.List.remove.

Removes the element at the specified position in this list (optional operation).
public final List<ResultOrRows>
resultsOrRows()

Implements org.jooq.Results.resultsOrRows.

All the results or update counts in their order as fetched via JDBC.
public Result<Record>
set(int
index of the element to replace
index
,
Result<Record>
element to be stored at the specified position
element
)

Overrides java.util.AbstractList.set.

Implements java.util.List.set.

Replaces the element at the specified position in this list with the specified element (optional operation).
public final int
size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.List.size, java.util.Collection.size.

Returns the number of elements in this list.
public String
toString()

Overrides java.util.AbstractCollection.toString.

Returns a string representation of this collection.
private final int
translatedIndex(int index)

Inherited from java.util.AbstractList:
addaddAllindexOfiteratorlastIndexOflistIteratorlistIteratorremoveRangesubList

Field Detail

configurationback to summary
private Configuration configuration
resultsOrRowsback to summary
pack-priv final List<ResultOrRows> resultsOrRows

Constructor Detail

ResultsImplback to summary
pack-priv ResultsImpl(Configuration configuration)

Method Detail

addback to summary
public void add(int index, Result<Record> element)

Overrides java.util.AbstractList.add.

Implements java.util.List.add.

Doc from java.util.List.add.

Inserts the specified element at the specified position in this list (optional operation). Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).

Parameters
index:int

index at which the specified element is to be inserted

element:Result<Record>

element to be inserted

Annotations
@Override
attachback to summary
public final void attach(Configuration c)

Implements org.jooq.Results.attach.

Doc from org.jooq.Results.attach.

Attach all results and all of their contained records to a new Configuration.

Parameters
c:Configuration

A configuration or null, if you wish to detach this Attachable from its previous configuration.

Annotations
@Override
clearback to summary
public void clear()

Overrides java.util.AbstractList.clear.

Implements java.util.List.clear, java.util.Collection.clear.

Doc from java.util.List.clear.

Removes all of the elements from this list (optional operation). The list will be empty after this call returns.

Annotations
@Override
configurationback to summary
public final Configuration configuration()

Implements org.jooq.Attachable.configuration.

Doc from org.jooq.Attachable.configuration.

Get the currently attached Configuration, or null if no Configuration is attached.

Annotations
@Override
detachback to summary
public final void detach()

Implements org.jooq.Results.detach.

Doc from org.jooq.Results.detach.

Detach all results and all of their contained records from their current Configuration.

This is the same as calling attach(null).

Annotations
@Override
equalsback to summary
public boolean equals(Object obj)

Overrides java.util.AbstractList.equals.

Implements java.util.List.equals, java.util.Collection.equals.

Doc from java.util.List.equals.

Compares the specified object with this list for equality. Returns true if and only if the specified object is also a list, both lists have the same size, and all corresponding pairs of elements in the two lists are equal. (Two elements e1 and e2 are equal if Objects.equals(e1, e2).) In other words, two lists are defined to be equal if they contain the same elements in the same order. This definition ensures that the equals method works properly across different implementations of the List interface.

Parameters
obj:Object

the object to be compared for equality with this list

Returns:boolean

true if the specified object is equal to this list

Annotations
@Override
getback to summary
public final Result<Record> get(int index)

Implements abstract java.util.AbstractList.get.

Implements java.util.List.get.

Doc from java.util.List.get.

Returns the element at the specified position in this list.

Parameters
index:int

index of the element to return

Returns:Result<Record>

the element at the specified position in this list

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.util.AbstractList.hashCode.

Implements java.util.List.hashCode, java.util.Collection.hashCode.

Doc from java.util.List.hashCode.

Returns the hash code value for this list. The hash code of a list is defined to be the result of the following calculation:

int hashCode = 1;
    for (E e : list)
        hashCode = 31*hashCode + (e==null ? 0 : e.hashCode());
This ensures that list1.equals(list2) implies that list1.hashCode()==list2.hashCode() for any two lists, list1 and list2, as required by the general contract of Object#hashCode.
Returns:int

the hash code value for this list

Annotations
@Override
listback to summary
private final List<Result<Record>> list()
removeback to summary
public Result<Record> remove(int index)

Overrides java.util.AbstractList.remove.

Implements java.util.List.remove.

Doc from java.util.List.remove.

Removes the element at the specified position in this list (optional operation). Shifts any subsequent elements to the left (subtracts one from their indices). Returns the element that was removed from the list.

Parameters
index:int

the index of the element to be removed

Returns:Result<Record>

the element previously at the specified position

Annotations
@Override
resultsOrRowsback to summary
public final List<ResultOrRows> resultsOrRows()

Implements org.jooq.Results.resultsOrRows.

Doc from org.jooq.Results.resultsOrRows.

All the results or update counts in their order as fetched via JDBC.

While iterator() and all the other methods inherited from the List API return the Result objects only, this method also includes update counts that may have occurred between two results.

It can be safely assumed that:


result.resultsOrRows()
      .stream()
      .filter(r -> r.result() != null)
      .map(r -> r.result())
      .collect(Collectors.toList())
      .equals(result);
Annotations
@Override
setback to summary
public Result<Record> set(int index, Result<Record> element)

Overrides java.util.AbstractList.set.

Implements java.util.List.set.

Doc from java.util.List.set.

Replaces the element at the specified position in this list with the specified element (optional operation).

Parameters
index:int

index of the element to replace

element:Result<Record>

element to be stored at the specified position

Returns:Result<Record>

the element previously at the specified position

Annotations
@Override
sizeback to summary
public final int size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.List.size, java.util.Collection.size.

Doc from java.util.List.size.

Returns the number of elements in this list. If this list contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Returns:int

the number of elements in this list

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.util.AbstractCollection.toString.

Doc from java.util.AbstractCollection.toString.

Returns a string representation of this collection. The string representation consists of a list of the collection's elements in the order they are returned by its iterator, enclosed in square brackets ("[]"). Adjacent elements are separated by the characters ", " (comma and space). Elements are converted to strings as by String#valueOf(Object).

Returns:String

a string representation of this collection

Annotations
@Override
translatedIndexback to summary
private final int translatedIndex(int index)
org.jooq.impl back to summary

pack-priv final Record ResultsImpl.ResultOrRowsImpl

extends Record
implements ResultOrRows
Class Inheritance
All Implemented Interfaces
org.jooq.ResultOrRows
Record Components
result:Result<Record> 
rows:int 
exception:DataAccessException 

Field Summary

Modifier and TypeField and Description
private final DataAccessException
exception

Record Component accessed by exception().

private final Result<Record>
result

Record Component accessed by result().

private final int
rows

Record Component accessed by rows().

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv
ResultOrRowsImpl(int rows)

pack-priv
pack-priv
ResultOrRowsImpl(Result<Record> result, int rows, DataAccessException exception)

Method Summary

Modifier and TypeMethod and Description
public final boolean
equals(Object
the reference object with which to compare.
o
)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.
public DataAccessException
exception()

Record Component getter of exception.

Implements org.jooq.ResultOrRows.exception.

The exception if applicable or null if there was no exception.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.
public Result<Record>
result()

Record Component getter of result.

Implements org.jooq.ResultOrRows.result.

The result or null if there was no result.

public int
rows()

Record Component getter of rows.

Implements org.jooq.ResultOrRows.rows.

The update count if applicable, or the number of rows in result().

public String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

exceptionback to summary
private final DataAccessException exception

Record Component accessed by exception().

resultback to summary
private final Result<Record> result

Record Component accessed by result().

rowsback to summary
private final int rows

Record Component accessed by rows().

Constructor Detail

ResultOrRowsImplback to summary
pack-priv ResultOrRowsImpl(Result<Record> result)
ResultOrRowsImplback to summary
pack-priv ResultOrRowsImpl(int rows)
ResultOrRowsImplback to summary
pack-priv ResultOrRowsImpl(DataAccessException exception)
ResultOrRowsImplback to summary
pack-priv ResultOrRowsImpl(Result<Record> result, int rows, DataAccessException exception)

Method Detail

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this record is equal to the argument; false otherwise.

exceptionback to summary
public DataAccessException exception()

Record Component getter of exception.

Implements org.jooq.ResultOrRows.exception.

Doc from org.jooq.ResultOrRows.exception.

The exception if applicable or null if there was no exception.

Exceptions are made available through this API only if Settings#getThrowExceptions() is set to ThrowExceptions#THROW_NONE. In all other cases, a batch execution is aborted and exceptions are thrown as ordinary Java exceptions.

hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

Returns:int

a hash code value for this record.

resultback to summary
public Result<Record> result()

Record Component getter of result.

Implements org.jooq.ResultOrRows.result.

Doc from org.jooq.ResultOrRows.result.

The result or null if there was no result.

rowsback to summary
public int rows()

Record Component getter of rows.

Implements org.jooq.ResultOrRows.rows.

Doc from org.jooq.ResultOrRows.rows.

The update count if applicable, or the number of rows in result().

toStringback to summary
public String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.

Returns:String

a string representation of the object.

Annotations
@Override