Class BeaconMetaFields

java.lang.Object
com.thunken.beacon.BeaconMetaFields

public final class BeaconMetaFields
extends Object
Custom collection to hold multiple BEACON meta fields and their respective values.

BeaconMetaFields instances are shared by a BeaconParser and all BeaconLink instances generated by that parser. Therefore, for the sake of consistency, the public API for this class only includes read-only methods.

Note: the current Javadoc for this project is incomplete. We rely on Lombok to generate boilerplate code, and Lombok does not plug into Javadoc. Generated methods and constructors are not included, and the Javadoc for other methods and constructors may be incomplete. See delombok and beacon#1 for more information.

See Also:
BeaconMetaField
  • Constructor Details

    • BeaconMetaFields

      public BeaconMetaFields()
    • BeaconMetaFields

      public BeaconMetaFields​(BeaconMetaFields metaFields)
    • BeaconMetaFields

      public BeaconMetaFields​(Map<BeaconMetaField,​String> map)
  • Method Details

    • equals

      public boolean equals​(Object object)
      Overrides:
      equals in class Object
    • getValue

      public String getValue​(BeaconMetaField field)
      Returns the value to which the specified field is mapped.
      Returns:
      The value to which the specified field is mapped.
      Throws:
      IllegalArgumentException - If field is mapped to multiple values.
      NullPointerException - If field is null.
    • getValues

      @Deprecated public Set<String> getValues​(BeaconMetaField field)
      Deprecated.
      Meta fields are not repeatable anymore, so this method returns an immutable set containing the only value to which the specified field is mapped.
      Returns all values to which the specified field is mapped.
      Returns:
      All values to which the specified field is mapped.
      Throws:
      NullPointerException - If field is null.
      See Also:
      getValue(BeaconMetaField)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • isDefault

      public boolean isDefault​(BeaconMetaField field)
      Returns true if the specified field is mapped to its default value.
      Returns:
      true if the specified field is mapped to its default value.
      Throws:
      NullPointerException - If field is null.
    • toString

      public String toString()
      Overrides:
      toString in class Object