public final class DirectoryEntry

  1. Object
  2. DirectoryEntry

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.

Constructors

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

Methods

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

Inherited methods

Constructor details

DirectoryEntry

public DirectoryEntry(long number, String label)
An entry that gives a number a name.

Parameters

number long
the full international number without +
label String
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 long
the full international number without +
label String
what to show when it calls, or null to only block
blocked boolean
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.