Package io.realm
Enum RealmFieldType
- java.lang.Object
-
- java.lang.Enum<RealmFieldType>
-
- io.realm.RealmFieldType
-
- All Implemented Interfaces:
Serializable
,Comparable<RealmFieldType>
public enum RealmFieldType extends Enum<RealmFieldType>
List of the types used by Realm's underlying storage engine.Normally there is no reason to interact with the underlying Realm types as Realm will automatically convert between normal Java types and the Realm types. However it is possible to access these types through a
DynamicRealmObject
.
-
-
Enum Constant Summary
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RealmFieldType
fromNativeValue(int value)
Converts the underlying value used by the storage engine to the proper Realm type.int
getNativeValue()
Returns the native value representing this type.boolean
isValid(Object obj)
Checks if the given Java object can be converted to the underlying Realm type.static RealmFieldType
valueOf(String name)
Returns the enum constant of this type with the specified name.static RealmFieldType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INTEGER
public static final RealmFieldType INTEGER
-
BOOLEAN
public static final RealmFieldType BOOLEAN
-
STRING
public static final RealmFieldType STRING
-
BINARY
public static final RealmFieldType BINARY
-
DATE
public static final RealmFieldType DATE
-
FLOAT
public static final RealmFieldType FLOAT
-
DOUBLE
public static final RealmFieldType DOUBLE
-
OBJECT
public static final RealmFieldType OBJECT
-
DECIMAL128
public static final RealmFieldType DECIMAL128
-
OBJECT_ID
public static final RealmFieldType OBJECT_ID
-
UUID
public static final RealmFieldType UUID
-
MIXED
public static final RealmFieldType MIXED
-
TYPED_LINK
public static final RealmFieldType TYPED_LINK
-
LIST
public static final RealmFieldType LIST
-
LINKING_OBJECTS
public static final RealmFieldType LINKING_OBJECTS
-
INTEGER_LIST
public static final RealmFieldType INTEGER_LIST
-
BOOLEAN_LIST
public static final RealmFieldType BOOLEAN_LIST
-
STRING_LIST
public static final RealmFieldType STRING_LIST
-
BINARY_LIST
public static final RealmFieldType BINARY_LIST
-
DATE_LIST
public static final RealmFieldType DATE_LIST
-
FLOAT_LIST
public static final RealmFieldType FLOAT_LIST
-
DOUBLE_LIST
public static final RealmFieldType DOUBLE_LIST
-
DECIMAL128_LIST
public static final RealmFieldType DECIMAL128_LIST
-
OBJECT_ID_LIST
public static final RealmFieldType OBJECT_ID_LIST
-
UUID_LIST
public static final RealmFieldType UUID_LIST
-
MIXED_LIST
public static final RealmFieldType MIXED_LIST
-
STRING_TO_INTEGER_MAP
public static final RealmFieldType STRING_TO_INTEGER_MAP
-
STRING_TO_BOOLEAN_MAP
public static final RealmFieldType STRING_TO_BOOLEAN_MAP
-
STRING_TO_STRING_MAP
public static final RealmFieldType STRING_TO_STRING_MAP
-
STRING_TO_BINARY_MAP
public static final RealmFieldType STRING_TO_BINARY_MAP
-
STRING_TO_DATE_MAP
public static final RealmFieldType STRING_TO_DATE_MAP
-
STRING_TO_FLOAT_MAP
public static final RealmFieldType STRING_TO_FLOAT_MAP
-
STRING_TO_DOUBLE_MAP
public static final RealmFieldType STRING_TO_DOUBLE_MAP
-
STRING_TO_DECIMAL128_MAP
public static final RealmFieldType STRING_TO_DECIMAL128_MAP
-
STRING_TO_OBJECT_ID_MAP
public static final RealmFieldType STRING_TO_OBJECT_ID_MAP
-
STRING_TO_UUID_MAP
public static final RealmFieldType STRING_TO_UUID_MAP
-
STRING_TO_MIXED_MAP
public static final RealmFieldType STRING_TO_MIXED_MAP
-
STRING_TO_LINK_MAP
public static final RealmFieldType STRING_TO_LINK_MAP
-
INTEGER_SET
public static final RealmFieldType INTEGER_SET
-
BOOLEAN_SET
public static final RealmFieldType BOOLEAN_SET
-
STRING_SET
public static final RealmFieldType STRING_SET
-
BINARY_SET
public static final RealmFieldType BINARY_SET
-
DATE_SET
public static final RealmFieldType DATE_SET
-
FLOAT_SET
public static final RealmFieldType FLOAT_SET
-
DOUBLE_SET
public static final RealmFieldType DOUBLE_SET
-
DECIMAL128_SET
public static final RealmFieldType DECIMAL128_SET
-
OBJECT_ID_SET
public static final RealmFieldType OBJECT_ID_SET
-
UUID_SET
public static final RealmFieldType UUID_SET
-
LINK_SET
public static final RealmFieldType LINK_SET
-
MIXED_SET
public static final RealmFieldType MIXED_SET
-
-
Method Detail
-
values
public static RealmFieldType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (RealmFieldType c : RealmFieldType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static RealmFieldType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getNativeValue
public int getNativeValue()
Returns the native value representing this type.- Returns:
- the value used by the underlying storage engine to represent this type.
-
isValid
public boolean isValid(Object obj)
Checks if the given Java object can be converted to the underlying Realm type.- Parameters:
obj
- object to test compatibility on.- Returns:
true
if object can be converted to the Realm type,false
otherwise.
-
fromNativeValue
public static RealmFieldType fromNativeValue(int value)
Converts the underlying value used by the storage engine to the proper Realm type.- Parameters:
value
- the value to convert- Returns:
- the corresponding Realm type.
- Throws:
IllegalArgumentException
- if value isn't valid.
-
-