Interface Record
-
public interface Record
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
Record.Builder
Allows to create a record with a fluent API.
-
Method Summary
-
-
-
Method Detail
-
withNewSchema
Record.Builder withNewSchema(Schema schema)
Create a Builder with values of the record present inSchema
.- Parameters:
schema
- new schema- Returns:
- a
Record.Builder
-
get
<T> T get(Class<T> expectedType, String name)
Access a record field value. IMPORTANT: it is always better to use the typed accessors and the optional flavor when the entry is nullable.- Type Parameters:
T
- the type of expectedType.- Parameters:
expectedType
- the expected type for the column.name
- the name of the column.- Returns:
- the column value.
-
getString
default String getString(String name)
Seeget(Class, String)
.- Parameters:
name
- entry name.- Returns:
- the value of the entry in this record.
-
getInt
default int getInt(String name)
Seeget(Class, String)
.- Parameters:
name
- entry name.- Returns:
- the value of the entry in this record.
-
getLong
default long getLong(String name)
Seeget(Class, String)
.- Parameters:
name
- entry name.- Returns:
- the value of the entry in this record.
-
getDouble
default double getDouble(String name)
Seeget(Class, String)
.- Parameters:
name
- entry name.- Returns:
- the value of the entry in this record.
-
getFloat
default float getFloat(String name)
Seeget(Class, String)
.- Parameters:
name
- entry name.- Returns:
- the value of the entry in this record.
-
getBoolean
default boolean getBoolean(String name)
Seeget(Class, String)
.- Parameters:
name
- entry name.- Returns:
- the value of the entry in this record.
-
getBytes
default byte[] getBytes(String name)
Seeget(Class, String)
.- Parameters:
name
- entry name.- Returns:
- the value of the entry in this record.
-
getRecord
default Record getRecord(String name)
Seeget(Class, String)
.- Parameters:
name
- entry name.- Returns:
- the value of the entry in this record.
-
getArray
default <T> Collection<T> getArray(Class<T> type, String name)
Seeget(Class, String)
.- Type Parameters:
T
- type of the collection elements.- Parameters:
type
- type of the elements of the collection.name
- entry name.- Returns:
- the value of the entry in this record.
-
getDateTime
default ZonedDateTime getDateTime(String name)
Seeget(Class, String)
.- Parameters:
name
- entry name.- Returns:
- the value of the entry in this record.
-
getOptionalArray
default <T> Optional<Collection<T>> getOptionalArray(Class<T> type, String name)
Seeget(Class, String)
.- Type Parameters:
T
- type of the collection elements.- Parameters:
type
- type of the elements of the collection.name
- entry name.- Returns:
- the value of the entry in this record.
-
getOptionalDateTime
default Optional<ZonedDateTime> getOptionalDateTime(String name)
Seeget(Class, String)
.- Parameters:
name
- entry name.- Returns:
- the value of the entry in this record.
-
getOptionalString
default Optional<String> getOptionalString(String name)
Seeget(Class, String)
.- Parameters:
name
- entry name.- Returns:
- the value of the entry in this record.
-
getOptionalInt
default OptionalInt getOptionalInt(String name)
Seeget(Class, String)
.- Parameters:
name
- entry name.- Returns:
- the value of the entry in this record.
-
getOptionalLong
default OptionalLong getOptionalLong(String name)
Seeget(Class, String)
.- Parameters:
name
- entry name.- Returns:
- the value of the entry in this record.
-
getOptionalDouble
default OptionalDouble getOptionalDouble(String name)
Seeget(Class, String)
.- Parameters:
name
- entry name.- Returns:
- the value of the entry in this record.
-
getOptionalFloat
default OptionalDouble getOptionalFloat(String name)
Seeget(Class, String)
.- Parameters:
name
- entry name.- Returns:
- the value of the entry in this record.
-
getOptionalBoolean
default Optional<Boolean> getOptionalBoolean(String name)
Seeget(Class, String)
.- Parameters:
name
- entry name.- Returns:
- the value of the entry in this record.
-
getOptionalBytes
default Optional<byte[]> getOptionalBytes(String name)
Seeget(Class, String)
.- Parameters:
name
- entry name.- Returns:
- the value of the entry in this record.
-
getOptionalRecord
default Optional<Record> getOptionalRecord(String name)
Seeget(Class, String)
.- Parameters:
name
- entry name.- Returns:
- the value of the entry in this record.
-
-