# Class DirectoryEntry

java.lang.Object
com.codename1.call.directory.DirectoryEntry

public final class DirectoryEntry extends Object

One number the app can name or block.

##### Numbers must be sorted, and they are numbers

Both platforms require the identification and blocking lists to be handed over in ascending numerical order, and reject the whole list -- not the offending row -- when they are not. That is why the number here is a `long` rather than a string: a string list sorts lexicographically, which puts `+1999...` before `+12...`, and the resulting rejection names no row.

The number is the full international number without the leading `+`, so `+1 415 555 1212` is `14155551212`. `CallDirectory` sorts what it is given, so an app need not.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DirectoryEntry(long number, String label)`
  An entry that gives a number a name.
  `DirectoryEntry(long number, String label, boolean blocked)`
  An entry that names a number, blocks it, or both.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getLabel()`
  What to show when it calls, or null.
  `long`
  `getNumber()`
  The full international number without `+`.
  `boolean`
  `isBlocked()`
  Whether calls from it are rejected without ringing.

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### DirectoryEntry

    public DirectoryEntry(long number, String label)
    An entry that gives a number a name.
    Parameters:
      `number` - the full international number without `+`
      `label` - what to show when it calls

  - ### DirectoryEntry

    public DirectoryEntry(long number, String label, boolean blocked)
    An entry that names a number, blocks it, or both.
    Parameters:
      `number` - the full international number without `+`
      `label` - what to show when it calls, or null to only block
      `blocked` - whether the call should be rejected without ringing

- ## Method Details

  - ### getNumber

    public long getNumber()
    The full international number without `+`.

  - ### getLabel

    public String getLabel()
    What to show when it calls, or null.

  - ### isBlocked

    public boolean isBlocked()
    Whether calls from it are rejected without ringing.