Package io.realm
Enum FieldAttribute
- java.lang.Object
-
- java.lang.Enum<FieldAttribute>
-
- io.realm.FieldAttribute
-
- All Implemented Interfaces:
Serializable
,Comparable<FieldAttribute>
public enum FieldAttribute extends Enum<FieldAttribute>
This class contains all Realm attributes for a Realm field. These will usually match the annotations found in theio.realm.annotation
package. See the relevant annotation for further information on each modifier.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description INDEXED
Marks a field as indexed.PRIMARY_KEY
Marks a field as a primary key.REQUIRED
Marks a field as explicitly not allowing null values.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static FieldAttribute
valueOf(String name)
Returns the enum constant of this type with the specified name.static FieldAttribute[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
INDEXED
public static final FieldAttribute INDEXED
Marks a field as indexed.- See Also:
Index
-
PRIMARY_KEY
public static final FieldAttribute PRIMARY_KEY
Marks a field as a primary key. This also implicitly mark it asINDEXED
.- See Also:
PrimaryKey
-
REQUIRED
public static final FieldAttribute REQUIRED
Marks a field as explicitly not allowing null values. The default behavior for allowingnull
depends on the type of the field.
-
-
Method Detail
-
values
public static FieldAttribute[] 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 (FieldAttribute c : FieldAttribute.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static FieldAttribute 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
-
-