Show / Hide Table of Contents

    Struct RealmInteger<T>

    A structure representing an integer value in the database. It offers API to increment the value, which produces correct merges during conflicts.

    Inherited Members
    Object.Equals(Object, Object)
    Object.GetType()
    Object.ReferenceEquals(Object, Object)
    Namespace:Realms
    Assembly:Realm.dll
    Syntax
    [Preserve(AllMembers = true, Conditional = false)]
    public struct RealmInteger<T> : IEquatable<T>, IComparable<RealmInteger<T>>, IComparable<T>, IConvertible, IFormattable where T : struct, IComparable<T>, IFormattable
    Type Parameters
    Name Description
    T

    The integer type, represented by this RealmInteger<T>. Supported types are Byte, Int16, Int32, and Int64.

    Remarks

    RealmInteger<T> is implicitly convertible to and from T/>.
    Calling Increment() on a managed RealmObject's property must be done in a write transaction. When calling Increment() on a RealmObject property, it will increment the property's value in the database, so the change will be reflected the next time this property is accessed. If the object is unmanaged, its property value will not be affected.

    Methods

    | Improve this Doc View Source

    CompareTo(T)

    Declaration
    public int CompareTo(T other)
    Parameters
    Type Name Description
    T other
    Returns
    Type Description
    Int32
    Implements
    IComparable<T>.CompareTo(T)
    | Improve this Doc View Source

    CompareTo(RealmInteger<T>)

    Declaration
    public int CompareTo(RealmInteger<T> other)
    Parameters
    Type Name Description
    RealmInteger<T> other
    Returns
    Type Description
    Int32
    Implements
    IComparable<T>.CompareTo(T)
    | Improve this Doc View Source

    Decrement()

    Decrements the integer value by 1. Inverse of Increment().

    Declaration
    public RealmInteger<T> Decrement()
    Returns
    Type Description
    RealmInteger<T>

    The decremented value.

    | Improve this Doc View Source

    Equals(T)

    Declaration
    public bool Equals(T other)
    Parameters
    Type Name Description
    T other
    Returns
    Type Description
    Boolean
    Implements
    IEquatable<T>.Equals(T)
    | Improve this Doc View Source

    Equals(Object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    Object obj
    Returns
    Type Description
    Boolean
    Overrides
    ValueType.Equals(Object)
    | Improve this Doc View Source

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    Int32
    Overrides
    ValueType.GetHashCode()
    | Improve this Doc View Source

    Increment()

    Increments the integer value by 1. Inverse of Decrement().

    Declaration
    public RealmInteger<T> Increment()
    Returns
    Type Description
    RealmInteger<T>

    The incremented value.

    | Improve this Doc View Source

    Increment(T)

    Increment the integer value by a specified amount.

    Declaration
    public RealmInteger<T> Increment(T value)
    Parameters
    Type Name Description
    T value

    Value by which to increment.

    Returns
    Type Description
    RealmInteger<T>

    The incremented value.

    | Improve this Doc View Source

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    String
    Overrides
    ValueType.ToString()
    | Improve this Doc View Source

    ToString(String, IFormatProvider)

    Declaration
    public string ToString(string format, IFormatProvider formatProvider)
    Parameters
    Type Name Description
    String format
    IFormatProvider formatProvider
    Returns
    Type Description
    String
    Implements
    IFormattable.ToString(String, IFormatProvider)

    Operators

    | Improve this Doc View Source

    Decrement(RealmInteger<T>)

    Declaration
    public static RealmInteger<T> operator --(RealmInteger<T> source)
    Parameters
    Type Name Description
    RealmInteger<T> source
    Returns
    Type Description
    RealmInteger<T>
    | Improve this Doc View Source

    Equality(RealmInteger<T>, RealmInteger<T>)

    Declaration
    public static bool operator ==(RealmInteger<T> first, RealmInteger<T> second)
    Parameters
    Type Name Description
    RealmInteger<T> first
    RealmInteger<T> second
    Returns
    Type Description
    Boolean
    | Improve this Doc View Source

    Implicit(T to RealmInteger<T>)

    Declaration
    public static implicit operator RealmInteger<T>(T i)
    Parameters
    Type Name Description
    T i
    Returns
    Type Description
    RealmInteger<T>
    | Improve this Doc View Source

    Implicit(RealmInteger<T> to T)

    Declaration
    public static implicit operator T(RealmInteger<T> i)
    Parameters
    Type Name Description
    RealmInteger<T> i
    Returns
    Type Description
    T
    | Improve this Doc View Source

    Increment(RealmInteger<T>)

    Declaration
    public static RealmInteger<T> operator ++(RealmInteger<T> source)
    Parameters
    Type Name Description
    RealmInteger<T> source
    Returns
    Type Description
    RealmInteger<T>
    | Improve this Doc View Source

    Inequality(RealmInteger<T>, RealmInteger<T>)

    Declaration
    public static bool operator !=(RealmInteger<T> first, RealmInteger<T> second)
    Parameters
    Type Name Description
    RealmInteger<T> first
    RealmInteger<T> second
    Returns
    Type Description
    Boolean

    Explicit Interface Implementations

    | Improve this Doc View Source

    IConvertible.GetTypeCode()

    Declaration
    TypeCode IConvertible.GetTypeCode()
    Returns
    Type Description
    TypeCode
    Implements
    IConvertible.GetTypeCode()
    | Improve this Doc View Source

    IConvertible.ToBoolean(IFormatProvider)

    Declaration
    bool IConvertible.ToBoolean(IFormatProvider provider)
    Parameters
    Type Name Description
    IFormatProvider provider
    Returns
    Type Description
    Boolean
    Implements
    IConvertible.ToBoolean(IFormatProvider)
    | Improve this Doc View Source

    IConvertible.ToByte(IFormatProvider)

    Declaration
    byte IConvertible.ToByte(IFormatProvider provider)
    Parameters
    Type Name Description
    IFormatProvider provider
    Returns
    Type Description
    Byte
    Implements
    IConvertible.ToByte(IFormatProvider)
    | Improve this Doc View Source

    IConvertible.ToChar(IFormatProvider)

    Declaration
    char IConvertible.ToChar(IFormatProvider provider)
    Parameters
    Type Name Description
    IFormatProvider provider
    Returns
    Type Description
    Char
    Implements
    IConvertible.ToChar(IFormatProvider)
    | Improve this Doc View Source

    IConvertible.ToDateTime(IFormatProvider)

    Declaration
    DateTime IConvertible.ToDateTime(IFormatProvider provider)
    Parameters
    Type Name Description
    IFormatProvider provider
    Returns
    Type Description
    DateTime
    Implements
    IConvertible.ToDateTime(IFormatProvider)
    | Improve this Doc View Source

    IConvertible.ToDecimal(IFormatProvider)

    Declaration
    decimal IConvertible.ToDecimal(IFormatProvider provider)
    Parameters
    Type Name Description
    IFormatProvider provider
    Returns
    Type Description
    Decimal
    Implements
    IConvertible.ToDecimal(IFormatProvider)
    | Improve this Doc View Source

    IConvertible.ToDouble(IFormatProvider)

    Declaration
    double IConvertible.ToDouble(IFormatProvider provider)
    Parameters
    Type Name Description
    IFormatProvider provider
    Returns
    Type Description
    Double
    Implements
    IConvertible.ToDouble(IFormatProvider)
    | Improve this Doc View Source

    IConvertible.ToInt16(IFormatProvider)

    Declaration
    short IConvertible.ToInt16(IFormatProvider provider)
    Parameters
    Type Name Description
    IFormatProvider provider
    Returns
    Type Description
    Int16
    Implements
    IConvertible.ToInt16(IFormatProvider)
    | Improve this Doc View Source

    IConvertible.ToInt32(IFormatProvider)

    Declaration
    int IConvertible.ToInt32(IFormatProvider provider)
    Parameters
    Type Name Description
    IFormatProvider provider
    Returns
    Type Description
    Int32
    Implements
    IConvertible.ToInt32(IFormatProvider)
    | Improve this Doc View Source

    IConvertible.ToInt64(IFormatProvider)

    Declaration
    long IConvertible.ToInt64(IFormatProvider provider)
    Parameters
    Type Name Description
    IFormatProvider provider
    Returns
    Type Description
    Int64
    Implements
    IConvertible.ToInt64(IFormatProvider)
    | Improve this Doc View Source

    IConvertible.ToSByte(IFormatProvider)

    Declaration
    sbyte IConvertible.ToSByte(IFormatProvider provider)
    Parameters
    Type Name Description
    IFormatProvider provider
    Returns
    Type Description
    SByte
    Implements
    IConvertible.ToSByte(IFormatProvider)
    | Improve this Doc View Source

    IConvertible.ToSingle(IFormatProvider)

    Declaration
    float IConvertible.ToSingle(IFormatProvider provider)
    Parameters
    Type Name Description
    IFormatProvider provider
    Returns
    Type Description
    Single
    Implements
    IConvertible.ToSingle(IFormatProvider)
    | Improve this Doc View Source

    IConvertible.ToString(IFormatProvider)

    Declaration
    string IConvertible.ToString(IFormatProvider provider)
    Parameters
    Type Name Description
    IFormatProvider provider
    Returns
    Type Description
    String
    Implements
    IConvertible.ToString(IFormatProvider)
    | Improve this Doc View Source

    IConvertible.ToType(Type, IFormatProvider)

    Declaration
    object IConvertible.ToType(Type conversionType, IFormatProvider provider)
    Parameters
    Type Name Description
    Type conversionType
    IFormatProvider provider
    Returns
    Type Description
    Object
    Implements
    IConvertible.ToType(Type, IFormatProvider)
    | Improve this Doc View Source

    IConvertible.ToUInt16(IFormatProvider)

    Declaration
    ushort IConvertible.ToUInt16(IFormatProvider provider)
    Parameters
    Type Name Description
    IFormatProvider provider
    Returns
    Type Description
    UInt16
    Implements
    IConvertible.ToUInt16(IFormatProvider)
    | Improve this Doc View Source

    IConvertible.ToUInt32(IFormatProvider)

    Declaration
    uint IConvertible.ToUInt32(IFormatProvider provider)
    Parameters
    Type Name Description
    IFormatProvider provider
    Returns
    Type Description
    UInt32
    Implements
    IConvertible.ToUInt32(IFormatProvider)
    | Improve this Doc View Source

    IConvertible.ToUInt64(IFormatProvider)

    Declaration
    ulong IConvertible.ToUInt64(IFormatProvider provider)
    Parameters
    Type Name Description
    IFormatProvider provider
    Returns
    Type Description
    UInt64
    Implements
    IConvertible.ToUInt64(IFormatProvider)

    See Also

    https://realm.io/docs/realm-object-server/#counters
    • Improve this Doc
    • View Source
    Back to top Copyright © 2017 Realm
    Generated by DocFX