public class SimpleBulkRecordReader extends Object implements BulkRecordReader
Constructor and Description |
---|
SimpleBulkRecordReader(BulkObjectReader reader) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
BulkObject |
read()
Returns the next object from the file
|
<T extends BulkObject> |
tryRead(Class<T> klazz)
Reads the object only if it has a certain type
|
<T extends BulkObject> |
tryRead(Predicate<T> predicate,
Class<T> klazz)
Reads the object only if it matches a predicate
|
public SimpleBulkRecordReader(BulkObjectReader reader)
public BulkObject read()
read
in interface BulkRecordReader
public <T extends BulkObject> TryResult<T> tryRead(Class<T> klazz)
tryRead
in interface BulkRecordReader
T
- Type of the objectklazz
- The next object from the file if the object has the same
type as requested, null otherwisepublic <T extends BulkObject> TryResult<T> tryRead(Predicate<T> predicate, Class<T> klazz)
tryRead
in interface BulkRecordReader
T
- Type of the objectpredicate
- Predicate that needs to be matchedklazz
- The next object from the file if the object matches the
predicate, null otherwisepublic void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
Copyright © 2024. All rights reserved.