Interface Record
public interface Record
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Allows to create a record with a fluent API. -
Method Summary
Modifier and TypeMethodDescription<T> T
Access a record field value.default <T> T
get
(Class<T> expectedType, Schema.Entry entry) default <T> Collection<T>
Seeget(Class, String)
.default boolean
getBoolean
(String name) Seeget(Class, String)
.default byte[]
Seeget(Class, String)
.default ZonedDateTime
getDateTime
(String name) Seeget(Class, String)
.default BigDecimal
getDecimal
(String name) default double
Seeget(Class, String)
.default float
Seeget(Class, String)
.default Instant
getInstant
(String name) Seeget(Class, String)
.default int
Seeget(Class, String)
.default long
Seeget(Class, String)
.default <T> Optional<Collection<T>>
getOptionalArray
(Class<T> type, String name) Seeget(Class, String)
.getOptionalBoolean
(String name) Seeget(Class, String)
.default Optional<byte[]>
getOptionalBytes
(String name) Seeget(Class, String)
.default Optional<ZonedDateTime>
getOptionalDateTime
(String name) Seeget(Class, String)
.default Optional<BigDecimal>
getOptionalDecimal
(String name) Seeget(Class, String)
.default OptionalDouble
getOptionalDouble
(String name) Seeget(Class, String)
.default OptionalDouble
getOptionalFloat
(String name) Seeget(Class, String)
.getOptionalInstant
(String name) Seeget(Class, String)
.default OptionalInt
getOptionalInt
(String name) Seeget(Class, String)
.default OptionalLong
getOptionalLong
(String name) Seeget(Class, String)
.getOptionalRecord
(String name) Seeget(Class, String)
.getOptionalString
(String name) Seeget(Class, String)
.default Record
Seeget(Class, String)
.default String
Seeget(Class, String)
.default Record.Builder
withNewSchema
(Schema schema) Create a Builder with values of the record present inSchema
.
-
Method Details
-
getSchema
- Returns:
- the schema of this record.
-
withNewSchema
Create a Builder with values of the record present inSchema
.- Parameters:
schema
- new schema- Returns:
- a
Record.Builder
-
get
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.
-
get
-
getString
Seeget(Class, String)
.- Parameters:
name
- entry name.- Returns:
- the value of the entry in this record.
-
getInt
Seeget(Class, String)
.- Parameters:
name
- entry name.- Returns:
- the value of the entry in this record.
-
getLong
Seeget(Class, String)
.- Parameters:
name
- entry name.- Returns:
- the value of the entry in this record.
-
getDouble
Seeget(Class, String)
.- Parameters:
name
- entry name.- Returns:
- the value of the entry in this record.
-
getFloat
Seeget(Class, String)
.- Parameters:
name
- entry name.- Returns:
- the value of the entry in this record.
-
getBoolean
Seeget(Class, String)
.- Parameters:
name
- entry name.- Returns:
- the value of the entry in this record.
-
getBytes
Seeget(Class, String)
.- Parameters:
name
- entry name.- Returns:
- the value of the entry in this record.
-
getRecord
Seeget(Class, String)
.- Parameters:
name
- entry name.- Returns:
- the value of the entry in this record.
-
getArray
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
Seeget(Class, String)
.- Parameters:
name
- entry name.- Returns:
- the value of the entry in this record.
-
getInstant
Seeget(Class, String)
.- Parameters:
name
- entry name.- Returns:
- the value of the entry in this record.
-
getDecimal
-
getOptionalArray
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
Seeget(Class, String)
.- Parameters:
name
- entry name.- Returns:
- the value of the entry in this record.
-
getOptionalInstant
Seeget(Class, String)
.- Parameters:
name
- entry name.- Returns:
- the value of the entry in this record.
-
getOptionalDecimal
Seeget(Class, String)
.- Parameters:
name
- entry name.- Returns:
- the value of the entry in this record.
-
getOptionalString
Seeget(Class, String)
.- Parameters:
name
- entry name.- Returns:
- the value of the entry in this record.
-
getOptionalInt
Seeget(Class, String)
.- Parameters:
name
- entry name.- Returns:
- the value of the entry in this record.
-
getOptionalLong
Seeget(Class, String)
.- Parameters:
name
- entry name.- Returns:
- the value of the entry in this record.
-
getOptionalDouble
Seeget(Class, String)
.- Parameters:
name
- entry name.- Returns:
- the value of the entry in this record.
-
getOptionalFloat
Seeget(Class, String)
.- Parameters:
name
- entry name.- Returns:
- the value of the entry in this record.
-
getOptionalBoolean
Seeget(Class, String)
.- Parameters:
name
- entry name.- Returns:
- the value of the entry in this record.
-
getOptionalBytes
Seeget(Class, String)
.- Parameters:
name
- entry name.- Returns:
- the value of the entry in this record.
-
getOptionalRecord
Seeget(Class, String)
.- Parameters:
name
- entry name.- Returns:
- the value of the entry in this record.
-