@Immutable public class ColumnsRecord extends java.lang.Object implements Record
Constructor and Description |
---|
ColumnsRecord(java.util.Collection<com.scalar.db.io.Column<?>> columns,
ColumnDefinitions columnDefinitions)
Constructs a
ColumnsRecord instance with the specified columns and column definitions. |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getAsObject(int i)
Returns the value of the i-th column as a Java Object type.
|
java.lang.Object |
getAsObject(java.lang.String columnName)
Returns the value of the specified column as a Java Object type.
|
long |
getBigInt(int i)
Returns the BIGINT value of the i-th column as a Java long type.
|
long |
getBigInt(java.lang.String columnName)
Returns the BIGINT value of the specified column as a Java long type.
|
java.nio.ByteBuffer |
getBlobAsByteBuffer(int i)
Returns the BLOB value of the i-th column as a Java ByteBuffer type.
|
java.nio.ByteBuffer |
getBlobAsByteBuffer(java.lang.String columnName)
Returns the BLOB value of the specified column as a Java ByteBuffer type.
|
byte[] |
getBlobAsBytes(int i)
Returns the BLOB value of the i-th column as a Java byte array type.
|
byte[] |
getBlobAsBytes(java.lang.String columnName)
Returns the BLOB value of the specified column as a Java byte array type.
|
boolean |
getBoolean(int i)
Returns the BOOLEAN value of the i-th column as a Java boolean type.
|
boolean |
getBoolean(java.lang.String columnName)
Returns the BOOLEAN value of the specified column as a Java boolean type.
|
double |
getDouble(int i)
Returns the DOUBLE value of the i-th column as a Java double type.
|
double |
getDouble(java.lang.String columnName)
Returns the DOUBLE value of the specified column as a Java double type.
|
float |
getFloat(int i)
Returns the FLOAT value of the i-th column as a Java float type.
|
float |
getFloat(java.lang.String columnName)
Returns the FLOAT value of the specified column as a Java float type.
|
int |
getInt(int i)
Returns the INT value of the i-th column as a Java int type.
|
int |
getInt(java.lang.String columnName)
Returns the INT value of the specified column as a Java int type.
|
java.lang.String |
getText(int i)
Returns the TEXT value of the i-th column as a Java String type.
|
java.lang.String |
getText(java.lang.String columnName)
Returns the TEXT value of the specified column as a Java String type.
|
boolean |
isNull(int i)
Indicates whether the value of the i-th column is NULL.
|
boolean |
isNull(java.lang.String columnName)
Indicates whether the value of the specified column is NULL.
|
public ColumnsRecord(java.util.Collection<com.scalar.db.io.Column<?>> columns, ColumnDefinitions columnDefinitions)
ColumnsRecord
instance with the specified columns and column definitions.
Note that the order of columns in the list must be the same as the order of columns in the list
of column definitions.columns
- columns of a recordcolumnDefinitions
- column definitions of a recordpublic boolean isNull(java.lang.String columnName)
Record
public boolean isNull(int i)
Record
public boolean getBoolean(java.lang.String columnName)
Record
Note that, due to its signature, this method cannot return null. If the value is NULL, it
will return 0. If this doesn't work for you, either call Record.isNull(String)
before calling
this method, or use Record.getAsObject(String)
instead.
getBoolean
in interface Record
columnName
- a column name of the valuepublic boolean getBoolean(int i)
Record
Note that, due to its signature, this method cannot return null. If the value is NULL, it
will return 0. If this doesn't work for you, either call Record.isNull(String)
before calling
this method, or use Record.getAsObject(String)
instead.
getBoolean
in interface Record
i
- the position of the columnpublic int getInt(java.lang.String columnName)
Record
Note that, due to its signature, this method cannot return null. If the value is NULL, it
will return 0. If this doesn't work for you, either call Record.isNull(String)
before calling
this method, or use Record.getAsObject(String)
instead.
public int getInt(int i)
Record
Note that, due to its signature, this method cannot return null. If the value is NULL, it
will return 0. If this doesn't work for you, either call Record.isNull(String)
before calling
this method, or use Record.getAsObject(String)
instead.
public long getBigInt(java.lang.String columnName)
Record
Note that, due to its signature, this method cannot return null. If the value is NULL, it
will return 0. If this doesn't work for you, either call Record.isNull(String)
before calling
this method, or use Record.getAsObject(String)
instead.
public long getBigInt(int i)
Record
Note that, due to its signature, this method cannot return null. If the value is NULL, it
will return 0. If this doesn't work for you, either call Record.isNull(String)
before calling
this method, or use Record.getAsObject(String)
instead.
public float getFloat(java.lang.String columnName)
Record
Note that, due to its signature, this method cannot return null. If the value is NULL, it
will return 0.0. If this doesn't work for you, either call Record.isNull(String)
before
calling this method, or use Record.getAsObject(String)
instead.
public float getFloat(int i)
Record
Note that, due to its signature, this method cannot return null. If the value is NULL, it
will return 0.0. If this doesn't work for you, either call Record.isNull(String)
before
calling this method, or use Record.getAsObject(String)
instead.
public double getDouble(java.lang.String columnName)
Record
Note that, due to its signature, this method cannot return null. If the value is NULL, it
will return 0.0. If this doesn't work for you, either call Record.isNull(String)
before
calling this method, or use Record.getAsObject(String)
instead.
public double getDouble(int i)
Record
Note that, due to its signature, this method cannot return null. If the value is NULL, it
will return 0.0. If this doesn't work for you, either call Record.isNull(String)
before
calling this method, or use Record.getAsObject(String)
instead.
@Nullable public java.lang.String getText(java.lang.String columnName)
Record
@Nullable public java.lang.String getText(int i)
Record
@Nullable public java.nio.ByteBuffer getBlobAsByteBuffer(java.lang.String columnName)
Record
getBlobAsByteBuffer
in interface Record
columnName
- a column name of the value@Nullable public java.nio.ByteBuffer getBlobAsByteBuffer(int i)
Record
getBlobAsByteBuffer
in interface Record
i
- the position of the column@Nullable public byte[] getBlobAsBytes(java.lang.String columnName)
Record
getBlobAsBytes
in interface Record
columnName
- a column name of the value@Nullable public byte[] getBlobAsBytes(int i)
Record
getBlobAsBytes
in interface Record
i
- the position of the column@Nullable public java.lang.Object getAsObject(java.lang.String columnName)
Record
If the columns is a BOOLEAN type, it returns a Boolean
object. If the columns is an
INT type, it returns an Integer
object. If the columns is a BIGINT type, it returns a
LONG
object. If the columns is a FLOAT type, it returns a FLOAT
object. If the
columns is a DOUBLE type, it returns a DOUBLE
object. If the columns is a TEXT type, it
returns a String
object. If the columns is a BLOB type, it returns a ByteBuffer
object.
getAsObject
in interface Record
columnName
- a column name of the value@Nullable public java.lang.Object getAsObject(int i)
Record
If the columns is a BOOLEAN type, it returns a Boolean
object. If the columns is an
INT type, it returns an Integer
object. If the columns is a BIGINT type, it returns a
LONG
object. If the columns is a FLOAT type, it returns a FLOAT
object. If the
columns is a DOUBLE type, it returns a DOUBLE
object. If the columns is a TEXT type, it
returns a String
object. If the columns is a BLOB type, it returns a ByteBuffer
object.
getAsObject
in interface Record
i
- the position of the column