Options
All
  • Public
  • Public/Protected
  • All
Menu

Class EntityState

EntityState is an 'Enum' containing all of the valid states for an 'Entity'.

Hierarchy

Index

Constructors

constructor

Properties

_$typeName

_$typeName: string

Type of the enum; set in prototype of each enum

name

name: string

The name of this symbol

Static Added

Added: EntityState = new EntityState()

The 'Added' state.

Static Deleted

Deleted: EntityState = new EntityState()

The 'Deleted' state.

Static Detached

Detached: EntityState = new EntityState()

The 'Detached' state.

Static Modified

Modified: EntityState = new EntityState()

The 'Modified' state.

Static Unchanged

Unchanged: EntityState = new EntityState()

The 'Unchanged' state.

Methods

isAdded

  • isAdded(): boolean
  • Return whether an entityState instance is EntityState.Added.

    var es = anEntity.entityAspect.entityState;
    return es.isAdded();
    

    is the same as

    return es === EntityState.Added;
    

    Returns boolean

isAddedModifiedOrDeleted

  • isAddedModifiedOrDeleted(): boolean
  • Returns whether an entityState instance is EntityState.Added or EntityState.Modified or EntityState.Deleted.

    var es = anEntity.entityAspect.entityState;
    return es.isAddedModifiedOrDeleted();
    

    is the same as

    return es === EntityState.Added || es === EntityState.Modified || es === EntityState.Deleted
    

    Returns boolean

isDeleted

  • isDeleted(): boolean
  • Returns whether an entityState instance is EntityState.Deleted.

    var es = anEntity.entityAspect.entityState;
    return es.isDeleted();
    

    is the same as

    return es === EntityState.Deleted;
    

    Returns boolean

isDetached

  • isDetached(): boolean
  • Returns whether an entityState instance is EntityState.Detached.

    var es = anEntity.entityAspect.entityState;
    return es.isDetached();
    

    is the same as

    return es === EntityState.Detached;
    

    Returns boolean

isModified

  • isModified(): boolean
  • Returns whether an entityState instance is EntityState.Modified.

    var es = anEntity.entityAspect.entityState;
    return es.isModified();
    

    is the same as

    return es === EntityState.Modified;
    

    Returns boolean

isUnchanged

  • isUnchanged(): boolean
  • Returns whether an entityState instance is EntityState.Unchanged.

    var es = anEntity.entityAspect.entityState;
    return es.isUnchanged();
    

    is the same as

    return es === EntityState.Unchanged;
    

    Returns boolean

isUnchangedOrModified

  • isUnchangedOrModified(): boolean
  • Returns whether an entityState instance is EntityState.Unchanged or EntityState.Modified.

    var es = anEntity.entityAspect.entityState;
    return es.isUnchangedOrModified();
    

    is the same as

    return es === EntityState.Unchanged || es === EntityState.Modified
    

    Returns boolean

toJSON

  • toJSON(): { _$typeName: any; name: string }
  • Return enum name and symbol name

    Returns { _$typeName: any; name: string }

    • _$typeName: any
    • name: string

toString

  • toString(): string

Static contains

  • Returns whether an Enum contains a specified symbol.

    let symbol = DayOfWeek.Friday;
    if (DayOfWeek.contains(symbol)) {
        // do something
    }
    

    Parameters

    Returns boolean

    Whether this Enum contains the specified symbol.

Static fromName

  • fromName(name: string): any
  • Returns an Enum symbol given its name.

    let dayOfWeek = DayOfWeek.from("Thursday");
    // nowdayOfWeek === DayOfWeek.Thursday
    

    Parameters

    • name: string

      Name for which an enum symbol should be returned.

    Returns any

    The symbol that matches the name or 'undefined' if not found.

Static getNames

  • getNames(): string[]
  • Returns the names of all of the symbols contained within this Enum.

    let symbols = DayOfWeek.getNames();
    

    Returns string[]

    All of the names of the symbols contained within this Enum.

Static getSymbols

  • Returns all of the symbols contained within this Enum.

    let symbols = DayOfWeek.getSymbols();
    

    Returns BreezeEnum[]

    All of the symbols contained within this Enum.

Static resolveSymbols

  • resolveSymbols(): { name: string; symbol: BreezeEnum }[]
  • Seals this enum so that no more symbols may be added to it. This should only be called after all symbols have already been added to the Enum. This method also sets the 'name' property on each of the symbols.

    DayOfWeek.resolveSymbols();
    

    Returns { name: string; symbol: BreezeEnum }[]

Generated using TypeDoc