public class PropertyValue extends Object implements org.apache.flink.types.Value, Serializable, Comparable<PropertyValue>
| Modifier and Type | Field and Description |
|---|---|
static byte |
FLAG_LARGE
Bit flag indicating a "large" property.
|
static int |
LARGE_PROPERTY_THRESHOLD
If the length of the byte representation is larger than this value, the length will be
stored as an
int instead of a short. |
static PropertyValue |
NULL_VALUE
Represents a property value that is
null. |
static byte |
OFFSET
Value offset in byte
|
| Constructor and Description |
|---|
PropertyValue()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
byteSize()
Returns the byte size of the properties internal representation.
|
int |
compareTo(PropertyValue other)
Compares this to another
PropertyValue. |
PropertyValue |
copy()
Creates a deep copy of the property value.
|
static PropertyValue |
create(Object value)
Creates a new Property Value from the given object.
|
boolean |
equals(Object object) |
static PropertyValue |
fromRawBytes(byte[] rawBytes)
Create a
PropertyValue that wraps a byte array. |
<T> T |
get(Class<T> clazz)
Returns the value as the specified type.
|
BigDecimal |
getBigDecimal()
Returns the wrapped value as
BigDecimal. |
boolean |
getBoolean()
Returns the wrapped value as
boolean. |
int |
getByteSize() |
LocalDate |
getDate()
Returns the wrapped List as
LocalDate. |
LocalDateTime |
getDateTime()
Returns the wrapped List as
LocalDateTime. |
double |
getDouble()
Returns the wrapped value as
double. |
float |
getFloat()
Returns the wrapped value as
float. |
GradoopId |
getGradoopId()
Returns the wrapped value as
GradoopId. |
int |
getInt()
Returns the wrapped value as
int. |
List<PropertyValue> |
getList()
Returns the wrapped List as
List<PropertyValue>. |
long |
getLong()
Returns the wrapped value as
long. |
Map<PropertyValue,PropertyValue> |
getMap()
Returns the wrapped Map as
Map<PropertyValue, PropertyValue>. |
Object |
getObject()
Returns the wrapped value as object.
|
byte[] |
getRawBytes() |
Set<PropertyValue> |
getSet()
Returns the wrapped Set as
Set<PropertyValue>. |
short |
getShort()
Returns the wrapped value as
short. |
String |
getString()
Returns the wrapped value as
String. |
LocalTime |
getTime()
Returns the wrapped List as
LocalTime. |
Class<?> |
getType()
Get the data type as class object according to the first position of the rawBytes[] array.
|
int |
hashCode() |
boolean |
is(Class clazz)
Check if the property value type is an instance of a certain class.
|
boolean |
isBigDecimal()
True, if the wrapped value is of type
BigDecimal. |
boolean |
isBoolean()
True, if the wrapped value is of type
boolean. |
boolean |
isDate()
True, if the wrapped value is of type
LocalDate. |
boolean |
isDateTime()
True, if the wrapped value is of type
LocalDateTime. |
boolean |
isDouble()
True, if the wrapped value is of type
double. |
boolean |
isFloat()
True, if the wrapped value is of type
float. |
boolean |
isGradoopId()
True, if the wrapped value is of type
GradoopId. |
boolean |
isInt()
True, if the wrapped value is of type
int. |
boolean |
isList()
True, if the wrapped value is of type
List. |
boolean |
isLong()
True, if the wrapped value is of type
long. |
boolean |
isMap()
True, if the wrapped value is of type
Map. |
boolean |
isNull()
True, if the value represents
null. |
boolean |
isNumber()
True, if the wrapped value is a subtype of
Number. |
boolean |
isSet()
True, if the wrapped value is of type
Set. |
boolean |
isShort()
True, if the wrapped value is of type
short. |
boolean |
isString()
True, if the wrapped value is of type
String. |
boolean |
isTime()
True, if the wrapped value is of type
LocalTime. |
void |
read(org.apache.flink.core.memory.DataInputView inputView) |
void |
setBigDecimal(BigDecimal bigDecimalValue)
Sets the wrapped value as
BigDecimal value. |
void |
setBoolean(boolean booleanValue)
Sets the wrapped value as
boolean value. |
void |
setBytes(byte[] bytes)
Set internal byte representation.
|
void |
setDate(LocalDate date)
Sets the wrapped value as
LocalDate value. |
void |
setDateTime(LocalDateTime dateTime)
Sets the wrapped value as
LocalDateTime value. |
void |
setDouble(double doubleValue)
Sets the wrapped value as
double value. |
void |
setFloat(float floatValue)
Sets the wrapped value as
float value. |
void |
setGradoopId(GradoopId gradoopIdValue)
Sets the wrapped value as
GradoopId value. |
void |
setInt(int intValue)
Sets the wrapped value as
int value. |
void |
setList(List<PropertyValue> list)
Sets the wrapped value as
List value. |
void |
setLong(long longValue)
Sets the wrapped value as
long value. |
void |
setMap(Map<PropertyValue,PropertyValue> map)
Sets the wrapped value as
Map value. |
void |
setObject(Object value)
Sets the given value as internal value if it has a supported type.
|
void |
setSet(Set<PropertyValue> set)
Sets the wrapped value as
Set value. |
void |
setShort(short shortValue)
Sets the wrapped value as
short value. |
void |
setString(String stringValue)
Sets the wrapped value as
String value. |
void |
setTime(LocalTime time)
Sets the wrapped value as
LocalTime value. |
String |
toString() |
void |
write(org.apache.flink.core.memory.DataOutputView outputView)
Byte representation:
byte 1 : type info
for dynamic length types (e.g.
|
public static final PropertyValue NULL_VALUE
null.public static final transient byte OFFSET
public static final transient byte FLAG_LARGE
int instead.write(DataOutputView),
Constant Field Valuespublic static final transient int LARGE_PROPERTY_THRESHOLD
int instead of a short.write(DataOutputView),
Constant Field Valuespublic static PropertyValue create(Object value)
UnsupportedTypeException will be thrown.value - value with supported typepublic static PropertyValue fromRawBytes(byte[] rawBytes)
PropertyValue that wraps a byte array.rawBytes - array to wrapPropertyValuepublic PropertyValue copy()
public boolean is(Class clazz)
clazz - class to check againstvalue is an object of the provided class, false
otherwisepublic boolean isNull()
null.null valuepublic boolean isBoolean()
boolean.boolean valuepublic boolean isShort()
short.short valuepublic boolean isInt()
int.int valuepublic boolean isLong()
long.long valuepublic boolean isFloat()
float.float valuepublic boolean isDouble()
double.double valuepublic boolean isString()
String.String valuepublic boolean isBigDecimal()
BigDecimal.BigDecimal valueBigDecimalpublic boolean isGradoopId()
GradoopId.GradoopId valuepublic boolean isList()
List.List valuepublic boolean isDate()
LocalDate.LocalDate valuepublic boolean isTime()
LocalTime.LocalTime valuepublic boolean isDateTime()
LocalDateTime.LocalDateTime valuepublic boolean isNumber()
Number.Number valuepublic <T> T get(Class<T> clazz) throws UnsupportedOperationException
UnsupportedOperationException is thrown.T - PropertyValue supported typeclazz - the requested value typeUnsupportedOperationException - when trying to get the wrong typepublic Object getObject()
null if the value is emptypublic boolean getBoolean()
boolean.boolean valuepublic short getShort()
short.short valuepublic int getInt()
int.int valuepublic long getLong()
long.long valuepublic float getFloat()
float.float valuepublic double getDouble()
double.double valuepublic BigDecimal getBigDecimal()
BigDecimal.BigDecimal valueBigDecimalpublic GradoopId getGradoopId()
GradoopId.GradoopId valuepublic Map<PropertyValue,PropertyValue> getMap()
Map<PropertyValue, PropertyValue>.Map<PropertyValue, PropertyValue> valuepublic List<PropertyValue> getList()
List<PropertyValue>.List<PropertyValue> valuepublic LocalDateTime getDateTime()
LocalDateTime.LocalDateTime valuepublic Set<PropertyValue> getSet()
Set<PropertyValue>.Set<PropertyValue> valuepublic void setObject(Object value)
value - valueUnsupportedTypeException - if the type of the Object is not supportedpublic void setBoolean(boolean booleanValue)
boolean value.booleanValue - valuepublic void setShort(short shortValue)
short value.shortValue - valuepublic void setInt(int intValue)
int value.intValue - intValuepublic void setLong(long longValue)
long value.longValue - valuepublic void setFloat(float floatValue)
float value.floatValue - valuepublic void setDouble(double doubleValue)
double value.doubleValue - valuepublic void setString(String stringValue)
String value.stringValue - valuepublic void setBigDecimal(BigDecimal bigDecimalValue)
BigDecimal value.bigDecimalValue - valuepublic void setGradoopId(GradoopId gradoopIdValue)
GradoopId value.gradoopIdValue - valuepublic void setMap(Map<PropertyValue,PropertyValue> map)
Map value.map - valuepublic void setList(List<PropertyValue> list)
List value.list - valuepublic void setDate(LocalDate date)
LocalDate value.date - valuepublic void setTime(LocalTime time)
LocalTime value.time - valuepublic void setDateTime(LocalDateTime dateTime)
LocalDateTime value.dateTime - valuepublic void setSet(Set<PropertyValue> set)
Set value.set - valuepublic Class<?> getType()
public int getByteSize()
public byte[] getRawBytes()
public void setBytes(byte[] bytes)
bytes - arraypublic int compareTo(PropertyValue other)
PropertyValue. See PropertyValueStrategyFactory.compare(java.lang.Object, java.lang.Object).compareTo in interface Comparable<PropertyValue>other - the property value to be compared.PropertyValueStrategyFactory.compare(java.lang.Object, java.lang.Object)public int byteSize()
public void write(org.apache.flink.core.memory.DataOutputView outputView)
throws IOException
LARGE_PROPERTY_THRESHOLD (i.e. if a short is too small to store the length),
then the FLAG_LARGE bit will be set in the first byte and the byte representation
will be:
byte 2 ; length (int)
byte 3 : length (int)
byte 4 : length (int)
byte 5 : length (int)
byte 6 - end : value bytes
for fixed length types (e.g. int, long, float, ...)
byte 2 - end : value byteswrite in interface org.apache.flink.core.io.IOReadableWritableoutputView - data output to write data toIOException - if write to output view fails.public void read(org.apache.flink.core.memory.DataInputView inputView)
throws IOException
read in interface org.apache.flink.core.io.IOReadableWritableIOExceptionCopyright © 2014 - 2019–2019 University of Leipzig. All rights reserved.