Package io.realm

Enum 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.

    • 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())
        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.)
        name - the name of the enum constant to be returned.
        the enum constant with the specified name
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • getNativeValue

        public int getNativeValue()
        Returns the native value representing this type.
        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.
        obj - object to test compatibility on.
        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.
        value - the value to convert
        the corresponding Realm type.
        IllegalArgumentException - if value isn't valid.