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())
            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 name
        NullPointerException - 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.