Package org.apache.wayang.basic.data
Class Record
- java.lang.Object
-
- org.apache.wayang.basic.data.Record
-
public class Record extends java.lang.Object implements java.io.Serializable, Copyable<Record>
A Type that represents a record with a schema, might be replaced with something standard like JPA entity.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Record(java.lang.Object... values)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Record
copy()
Create a (potentially shallow) copy of this instance.boolean
equals(java.lang.Object o)
double
getDouble(int index)
Retrieve a field as adouble
.java.lang.Object
getField(int index)
int
getInt(int index)
Retrieve a field as aint
.long
getLong(int index)
Retrieve a field as along
.java.lang.String
getString(int index)
Retrieve a field as aString
.int
hashCode()
int
size()
Retrieve the size of this instance.java.lang.String
toString()
-
-
-
Method Detail
-
copy
public Record copy()
Description copied from interface:Copyable
Create a (potentially shallow) copy of this instance.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getField
public java.lang.Object getField(int index)
-
getDouble
public double getDouble(int index)
Retrieve a field as adouble
. It must be castable as such.- Parameters:
index
- the index of the field- Returns:
- the
double
representation of the field
-
getLong
public long getLong(int index)
Retrieve a field as along
. It must be castable as such.- Parameters:
index
- the index of the field- Returns:
- the
long
representation of the field
-
getInt
public int getInt(int index)
Retrieve a field as aint
. It must be castable as such.- Parameters:
index
- the index of the field- Returns:
- the
int
representation of the field
-
getString
public java.lang.String getString(int index)
Retrieve a field as aString
.- Parameters:
index
- the index of the field- Returns:
- the field as a
String
(obtained viaObject.toString()
) ornull
if the field isnull
-
size
public int size()
Retrieve the size of this instance.- Returns:
- the number of fields in this instance
-
-