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.

    Implements
    IEquatable<T>
    IComparable<RealmInteger<T>>
    IComparable<T>
    IConvertible
    IFormattable
    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
    | 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
    | 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
    | 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

    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
    | Improve this Doc View Source

    IConvertible.ToBoolean(IFormatProvider)

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

    IConvertible.ToByte(IFormatProvider)

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

    IConvertible.ToChar(IFormatProvider)

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

    IConvertible.ToDateTime(IFormatProvider)

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

    IConvertible.ToDecimal(IFormatProvider)

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

    IConvertible.ToDouble(IFormatProvider)

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

    IConvertible.ToInt16(IFormatProvider)

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

    IConvertible.ToInt32(IFormatProvider)

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

    IConvertible.ToInt64(IFormatProvider)

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

    IConvertible.ToSByte(IFormatProvider)

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

    IConvertible.ToSingle(IFormatProvider)

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

    IConvertible.ToString(IFormatProvider)

    Declaration
    string IConvertible.ToString(IFormatProvider provider)
    Parameters
    Type Name Description
    IFormatProvider provider
    Returns
    Type Description
    String
    | 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
    | Improve this Doc View Source

    IConvertible.ToUInt16(IFormatProvider)

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

    IConvertible.ToUInt32(IFormatProvider)

    Declaration
    uint IConvertible.ToUInt32(IFormatProvider provider)
    Parameters
    Type Name Description
    IFormatProvider provider
    Returns
    Type Description
    UInt32
    | 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

    System.IEquatable<T>
    System.IComparable<T>
    System.IComparable<T>
    System.IConvertible
    System.IFormattable

    See Also

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