# Record Class UpgradeToken

java.lang.Object
java.lang.Record
org.apache.coyote.UpgradeToken

Record Components:
  `httpUpgradeHandler` - The handler for the HTTP upgrade
  `contextBind` - The object to use to bind/unbind the current thread to/from the web application class loader
  `instanceManager` - The instance manager to use to create new Servlets, Filters, Listeners etc
  `protocol` - The desired protocol to upgrade to

public record UpgradeToken(HttpUpgradeHandler httpUpgradeHandler, ContextBind contextBind, InstanceManager instanceManager, String protocol) extends Record
Token used during the upgrade process.

## Constructor Summary

Constructors
Constructor
Description
`UpgradeToken(HttpUpgradeHandler httpUpgradeHandler, ContextBind contextBind, InstanceManager instanceManager, String protocol)`
Creates an instance of a `UpgradeToken` record class.

## Method Summary

Modifier and Type
Method
Description
`ContextBind`
`contextBind()`
Returns the value of the `contextBind` record component.
`final boolean`
`equals(Object o)`
Indicates whether some other object is "equal to" this one.
`ContextBind`
`getContextBind()`
Returns the context binder for this upgrade.
`HttpUpgradeHandler`
`getHttpUpgradeHandler()`
Returns the HTTP upgrade handler.
`InstanceManager`
`getInstanceManager()`
Returns the instance manager for creating servlets and filters.
`String`
`getProtocol()`
Returns the protocol name for the upgrade.
`final int`
`hashCode()`
Returns a hash code value for this object.
`HttpUpgradeHandler`
`httpUpgradeHandler()`
Returns the value of the `httpUpgradeHandler` record component.
`InstanceManager`
`instanceManager()`
Returns the value of the `instanceManager` record component.
`String`
`protocol()`
Returns the value of the `protocol` record component.
`final String`
`toString()`
Returns a string representation of this record class.

### Methods inherited from class Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Constructor Details

### UpgradeToken

public UpgradeToken(HttpUpgradeHandler httpUpgradeHandler, ContextBind contextBind, InstanceManager instanceManager, String protocol)
Creates an instance of a `UpgradeToken` record class.

Parameters:
  `httpUpgradeHandler` - the value for the `httpUpgradeHandler` record component
  `contextBind` - the value for the `contextBind` record component
  `instanceManager` - the value for the `instanceManager` record component
  `protocol` - the value for the `protocol` record component

## Method Details

### getContextBind

public ContextBind getContextBind()
Returns the context binder for this upgrade.

Returns:
  the context binder

### getHttpUpgradeHandler

public HttpUpgradeHandler getHttpUpgradeHandler()
Returns the HTTP upgrade handler.

Returns:
  the upgrade handler

### getInstanceManager

public InstanceManager getInstanceManager()
Returns the instance manager for creating servlets and filters.

Returns:
  the instance manager

### getProtocol

public String getProtocol()
Returns the protocol name for the upgrade.

Returns:
  the protocol name

### toString

public final String toString()
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.

Specified by:
  `toString` in class `Record`
Returns:
  a string representation of this object

### hashCode

public final int hashCode()
Returns a hash code value for this object. The value is derived from the hash code of each of the record components.

Specified by:
  `hashCode` in class `Record`
Returns:
  a hash code value for this object

### equals

public final boolean equals(Object o)
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with `Objects::equals(Object,Object)`.

Specified by:
  `equals` in class `Record`
Parameters:
  `o` - the object with which to compare
Returns:
  `true` if this object is the same as the `o` argument; `false` otherwise.

### httpUpgradeHandler

public HttpUpgradeHandler httpUpgradeHandler()
Returns the value of the `httpUpgradeHandler` record component.

Returns:
  the value of the `httpUpgradeHandler` record component

### contextBind

public ContextBind contextBind()
Returns the value of the `contextBind` record component.

Returns:
  the value of the `contextBind` record component

### instanceManager

public InstanceManager instanceManager()
Returns the value of the `instanceManager` record component.

Returns:
  the value of the `instanceManager` record component

### protocol

public String protocol()
Returns the value of the `protocol` record component.

Returns:
  the value of the `protocol` record component