public boolean matchesBeacon ( Beacon beacon ) { // All identifiers must match, or the corresponding region identifier must be null. for ( int i = mIdentifiers . size ( ) ; -- i >= 0 ; ) { final Identifier identifier = mIdentifiers . get ( i ) ; Identifier beaconIdentifier = null ; if ( i < beacon . mIdentifiers . size ( ) ) { beaconIdentifier = beacon . getIdentifier ( i ) ; } if ( ( beaconIdentifier == null && identifier != null ) || ( beaconIdentifier != null && identifier != null && ! identifier . equals ( beaconIdentifier ) ) ) { return false ; } } if ( mBluetoothAddress != null && ! mBluetoothAddress . equalsIgnoreCase ( beacon . mBluetoothAddress ) ) { return false ; } return true ; }
Checks to see if an Beacon object is included in the matching criteria of this Region