# Enum RangingRole

java.lang.Object
java.lang.Enum<RangingRole>
com.codename1.nearby.ranging.RangingRole

All Implemented Interfaces:
  `Comparable<RangingRole>`

public enum RangingRole extends Enum<RangingRole>

Which end of a UWB session this device is.

The distinction is real on Android, where the controller owns the channel and session parameters and the controlee joins them, and it decides which side has to publish a token first. It is invisible on iOS: Nearby Interaction negotiates the roles itself, both peers publish a discovery token, and the value passed here is ignored. Code that will run on both should still pick a role -- one side controller, the other controlee -- because that costs nothing on iOS and is required on Android.

- ## Enum Constant Summary

  Enum Constants
  Enum Constant
  Description
  `CONTROLEE`
  This device joins a session whose parameters the controller chose.
  `CONTROLLER`
  This device chooses the channel and session parameters and publishes them; peers join.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static RangingRole`
  `valueOf(String name)`
  Returns the enum constant of this type with the specified name.
  `static RangingRole[]`
  `values()`
  Returns an array containing the constants of this enum type, in the order they are declared.

  ### Methods inherited from class Enum

  `clone, compareTo, equals, getDeclaringClass, getEnumValues, hashCode, name, ordinal, setEnumValues, toString, valueOf`

  ### Methods inherited from class Object

  `getClass, notify, notifyAll, wait, wait, wait`

- ## Enum Constant Details

  - ### CONTROLLER

    public static final RangingRole CONTROLLER
    This device chooses the channel and session parameters and publishes them; peers join. Exactly one side of a session is the controller.

  - ### CONTROLEE

    public static final RangingRole CONTROLEE
    This device joins a session whose parameters the controller chose.

- ## Method Details

  - ### values

    public static RangingRole[] values()
    Returns an array containing the constants of this enum type, in the order they are declared.
    Returns:
      an array containing the constants of this enum type, in the order they are declared

  - ### valueOf

    public static RangingRole valueOf(String name)
    Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
    Parameters:
      `name` - the name of the enum constant to be returned.
    Returns:
      the enum constant with the specified name
    Throws:
      `IllegalArgumentException` - if this enum type has no constant with the specified name
      `NullPointerException` - if the argument is null