public class PersistedOptionValue extends Object
This represents a persisted OptionValue
. Decoupling the OptionValue
from what
is persisted will prevent us from accidentally breaking backward compatibility in the future
when the OptionValue
changes. Additionally when we do change the format of stored options we
will not have to change much code since this is already designed with backward compatibility in mind.
This class is also forward compatible with the Drill Option storage format in Drill 1.11 and earlier.
Contract:
Only PersistedOptionValue
s created from an OptionValue
should be persisted.
And OptionValue
s should only be created from PersistedOptionValue
s that are
retrieved from a store.
Modifier and Type | Class and Description |
---|---|
static class |
PersistedOptionValue.Deserializer
This deserializer only fetches the relevant information we care about from a store, which is the
value of an option.
|
Modifier and Type | Field and Description |
---|---|
static String |
JSON_BOOL_VAL
This constant cannot be changed for backward and forward compatibility reasons.
|
static String |
JSON_FLOAT_VAL
This constant cannot be changed for backward and forward compatibility reasons.
|
static String |
JSON_INTEGER_VAL
This constant cannot be changed for backward and forward compatibility reasons.
|
static String |
JSON_KIND
This constant cannot be changed for backward and forward compatibility reasons.
|
static String |
JSON_NAME
This constant cannot be changed for backward and forward compatibility reasons.
|
static String |
JSON_NUM_VAL
This constant cannot be changed for backward and forward compatibility reasons.
|
static String |
JSON_STRING_VAL
This constant cannot be changed for backward and forward compatibility reasons.
|
static String |
JSON_TYPE
This constant cannot be changed for backward and forward compatibility reasons.
|
static String |
SYSTEM_TYPE
This is present for forward compatability with Drill 1.11 and earlier
|
Constructor and Description |
---|
PersistedOptionValue(OptionValue.Kind kind,
String name,
Long num_val,
String string_val,
Boolean bool_val,
Double float_val) |
PersistedOptionValue(String value) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
Boolean |
getBoolVal()
This is present for forward compatibility.
|
Double |
getFloatVal()
This is present for forward compatibility.
|
OptionValue.Kind |
getKind()
This is present for forward compatibility.
|
String |
getName()
This is present for forward compatibility.
|
Long |
getNumVal()
This is present for forward compatibility.
|
String |
getStringVal()
This is present for forward compatibility.
|
String |
getType()
This is present for forward compatibility.
|
String |
getValue()
This is ignored for forward compatibility.
|
int |
hashCode() |
OptionValue |
toOptionValue(OptionDefinition optionDefinition,
OptionValue.OptionScope optionScope) |
String |
toString() |
public static final String SYSTEM_TYPE
public static final String JSON_TYPE
public static final String JSON_KIND
public static final String JSON_NAME
public static final String JSON_NUM_VAL
public static final String JSON_STRING_VAL
public static final String JSON_BOOL_VAL
public static final String JSON_FLOAT_VAL
public static final String JSON_INTEGER_VAL
public PersistedOptionValue(String value)
public String getValue()
public String getType()
public OptionValue.Kind getKind()
public String getName()
public Long getNumVal()
public String getStringVal()
public Boolean getBoolVal()
public Double getFloatVal()
public OptionValue toOptionValue(OptionDefinition optionDefinition, OptionValue.OptionScope optionScope)
Copyright © 1970 The Apache Software Foundation. All rights reserved.