Class Beacon.Builder

  • Direct Known Subclasses:
    AltBeacon.Builder
    Enclosing class:
    Beacon

    public static class Beacon.Builder
    extends Object
    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();
     
    • Field Detail

      • mBeacon

        protected final Beacon mBeacon
    • Constructor Detail

      • Builder

        public Builder()
        Creates a builder instance
    • Method Detail

      • build

        public Beacon build()
        Builds an instance of this beacon based on parameters set in the Builder
        Returns:
        beacon
      • copyBeaconFields

        public Beacon.Builder copyBeaconFields​(Beacon beacon)
        Parameters:
        beacon - the beacon whose fields we should copy to this beacon builder
        Returns:
      • setId1

        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
      • setId2

        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
      • setId3

        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
      • setRunningAverageRssi

        public Beacon.Builder setRunningAverageRssi​(double rssi)
        Parameters:
        rssi -
        Returns:
        builder
        See Also:
        Beacon.mRssi