# Class Util

java.lang.Object
org.apache.tomcat.websocket.Util

public class Util extends Object
Utility class for internal use only within the `org.apache.tomcat.websocket` package.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `Util.DecoderMatch`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static Object`
  `coerceToType(Class<?> type, String value)`
  `static List<DecoderEntry>`
  `getDecoders(List<Class<? extends Decoder>> decoderClazzes)`
  Deprecated.
  Will be removed in Tomcat 10.1.x.
  `static List<DecoderEntry>`
  `getDecoders(List<Class<? extends Decoder>> decoderClazzes, InstanceManager instanceManager)`
  Build the list of decoder entries from a set of decoder implementations.
  `static boolean`
  `isPrimitive(Class<?> clazz)`
  `static void`
  `parseExtensionHeader(List<Extension> extensions, String header)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### isPrimitive

    public static boolean isPrimitive(Class<?> clazz)

  - ### coerceToType

    public static Object coerceToType(Class<?> type, String value)

  - ### getDecoders

    @Deprecated public static List<DecoderEntry> getDecoders(List<Class<? extends Decoder>> decoderClazzes) throws DeploymentException
    Deprecated.
    Will be removed in Tomcat 10.1.x. Use `getDecoders(List, InstanceManager)`
    Build the list of decoder entries from a set of decoder implementations.
    Parameters:
      `decoderClazzes` - Decoder implementation classes
    Returns:
      List of mappings from target type to associated decoder
    Throws:
      `DeploymentException` - If a provided decoder class is not valid

  - ### getDecoders

    public static List<DecoderEntry> getDecoders(List<Class<? extends Decoder>> decoderClazzes, InstanceManager instanceManager) throws DeploymentException
    Build the list of decoder entries from a set of decoder implementations.
    Parameters:
      `decoderClazzes` - Decoder implementation classes
      `instanceManager` - Instance manager to use to create Decoder instances
    Returns:
      List of mappings from target type to associated decoder
    Throws:
      `DeploymentException` - If a provided decoder class is not valid

  - ### parseExtensionHeader

    public static void parseExtensionHeader(List<Extension> extensions, String header)