public static class

Beacon.Builder

extends Object
java.lang.Object
   ↳ org.altbeacon.beacon.Beacon.Builder
Known Direct Subclasses

Class Overview

Builder class for Beacon objects. Provides a convenient way to set the various fields of a Beacon

Example:

 Beacon beacon = new Beacon.Builder()
         .setId1("2F234454-CF6D-4A0F-ADF2-F4911BA9FFA6")
         .setId2("1")
         .setId3("2")
         .build();
 

Summary

Fields
protected final Beacon mBeacon
Public Constructors
Builder()
Creates a builder instance
Public Methods
Beacon build()
Builds an instance of this beacon based on parameters set in the Builder
Beacon.Builder copyBeaconFields(Beacon beacon)
Beacon.Builder setBeaconTypeCode(int beaconTypeCode)
Beacon.Builder setBluetoothAddress(String bluetoothAddress)
Beacon.Builder setBluetoothName(String name)
Beacon.Builder setDataFields(List<Long> dataFields)
Beacon.Builder setExtraDataFields(List<Long> extraDataFields)
Beacon.Builder setId1(String id1String)
Convenience method allowing the first beacon identifier to be set as a String.
Beacon.Builder setId2(String id2String)
Convenience method allowing the second beacon identifier to be set as a String.
Beacon.Builder setId3(String id3String)
Convenience method allowing the third beacon identifier to be set as a String.
Beacon.Builder setIdentifiers(List<Identifier> identifiers)
Beacon.Builder setManufacturer(int manufacturer)
Beacon.Builder setMultiFrameBeacon(boolean multiFrameBeacon)
Beacon.Builder setParserIdentifier(String id)
Beacon.Builder setRssi(int rssi)
Beacon.Builder setRunningAverageRssi(double rssi)
Beacon.Builder setServiceUuid(int serviceUuid)
Beacon.Builder setTxPower(int txPower)
[Expand]
Inherited Methods
From class java.lang.Object

Fields

protected final Beacon mBeacon

Public Constructors

public Builder ()

Creates a builder instance

Public Methods

public Beacon build ()

Builds an instance of this beacon based on parameters set in the Builder

Returns
  • beacon

public Beacon.Builder copyBeaconFields (Beacon beacon)

Parameters
beacon the beacon whose fields we should copy to this beacon builder

public Beacon.Builder setBeaconTypeCode (int beaconTypeCode)

Returns
  • builder
See Also

public Beacon.Builder setBluetoothAddress (String bluetoothAddress)

Returns
  • builder

public Beacon.Builder setBluetoothName (String name)

Returns
  • builder
See Also

public Beacon.Builder setDataFields (List<Long> dataFields)

Returns
  • builder
See Also

public Beacon.Builder setExtraDataFields (List<Long> extraDataFields)

Returns
  • builder
See Also

public Beacon.Builder setId1 (String id1String)

Convenience method allowing the first beacon identifier to be set as a String. It will be parsed into an Identifier object

Parameters
id1String string to parse into an identifier
Returns
  • builder

public Beacon.Builder setId2 (String id2String)

Convenience method allowing the second beacon identifier to be set as a String. It will be parsed into an Identifier object

Parameters
id2String string to parse into an identifier
Returns
  • builder

public Beacon.Builder setId3 (String id3String)

Convenience method allowing the third beacon identifier to be set as a String. It will be parsed into an Identifier object

Parameters
id3String string to parse into an identifier
Returns
  • builder

public Beacon.Builder setIdentifiers (List<Identifier> identifiers)

Parameters
identifiers identifiers to set
Returns
  • builder
See Also

public Beacon.Builder setManufacturer (int manufacturer)

Returns
  • builder
See Also

public Beacon.Builder setMultiFrameBeacon (boolean multiFrameBeacon)

Returns
  • multiFrameBeacon

public Beacon.Builder setParserIdentifier (String id)

Returns
  • builder

public Beacon.Builder setRssi (int rssi)

Returns
  • builder
See Also

public Beacon.Builder setRunningAverageRssi (double rssi)

Returns
  • builder
See Also

public Beacon.Builder setServiceUuid (int serviceUuid)

Returns
  • builder
See Also

public Beacon.Builder setTxPower (int txPower)

Returns
  • builder
See Also