# Class VariantsResolver

java.lang.Object
htsjdk.beta.plugin.registry.HtsCodecResolver<VariantsCodec>
htsjdk.beta.plugin.registry.VariantsResolver

public class VariantsResolver extends HtsCodecResolver<VariantsCodec>
Class with methods for resolving inputs and outputs to variants encoders and decoders.

Provides a convenient typesafe layer over the `HtsCodecResolver` used by an `HtsCodecRegistry` to manage `VariantsCodec`s (see `HtsCodecRegistry.getHaploidReferenceResolver()`).

Provides typesafe conversion of argument and return types to types that conform to those used with `VariantsCodec`s, such as `VariantsDecoder`, `VariantsEncoder`, `VariantsDecoderOptions`.

## Constructor Summary

Constructors
Constructor
Description
`VariantsResolver()`
Create a VariantsResolver.

## Method Summary

Modifier and Type
Method
Description
`VariantsDecoder`
`getVariantsDecoder(Bundle inputBundle)`
Get a `VariantsDecoder` suitable for decoding `inputBundle`.
`VariantsDecoder`
`getVariantsDecoder(Bundle inputBundle, VariantsDecoderOptions variantsDecoderOptions)`
Get a `VariantsDecoder` suitable for decoding `inputBundle` using `variantsDecoderOptions`.
`VariantsDecoder`
`getVariantsDecoder(IOPath inputPath)`
Get a `VariantsDecoder` suitable for decoding `inputPath`.
`VariantsDecoder`
`getVariantsDecoder(IOPath inputPath, VariantsDecoderOptions variantsDecoderOptions)`
Get a `VariantsDecoder` suitable for decoding `inputPath` using `variantsDecoderOptions`.
`VariantsEncoder`
`getVariantsEncoder(Bundle outputBundle, VariantsEncoderOptions variantsEncoderOptions)`
Get a `VariantsEncoder` suitable for encoding to `outputBundle` using `variantsEncoderOptions`.
`VariantsEncoder`
`getVariantsEncoder(Bundle outputBundle, VariantsEncoderOptions variantsEncoderOptions, String variantsFormat, HtsVersion formatVersion)`
Get a `VariantsEncoder` suitable for encoding to `outputBundle` using `variantsEncoderOptions`, specifying a version and output format.
`VariantsEncoder`
`getVariantsEncoder(IOPath outputPath)`
Get a `VariantsEncoder` suitable for encoding to `outputPath`.
`VariantsEncoder`
`getVariantsEncoder(IOPath outputPath, VariantsEncoderOptions variantsEncoderOptions)`
Get a `VariantsEncoder` suitable for encoding to `outputPath` using `variantsEncoderOptions`.

### Methods inherited from class HtsCodecResolver

`filterByVersion, getCodecs, registerCodec, resolveForDecoding, resolveForEncoding, resolveForEncoding, resolveForFormat, resolveFormatAndVersion`

### Methods inherited from class Object

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

## Constructor Details

### VariantsResolver

public VariantsResolver()
Create a VariantsResolver.

## Method Details

### getVariantsDecoder

public VariantsDecoder getVariantsDecoder(IOPath inputPath)
Get a `VariantsDecoder` suitable for decoding `inputPath`.

Parameters:
  `inputPath` - the input path to decode
Returns:
  a `VariantsDecoder` suitable for decoding `inputPath`
Throws:
  `HtsjdkException` - if no registered codecs can handle the resource
  `HtsjdkPluginException` - if more than one codec claims to handle the resource. this usually indicates that the registry contains an incorrectly written codec.

### getVariantsDecoder

public VariantsDecoder getVariantsDecoder(IOPath inputPath, VariantsDecoderOptions variantsDecoderOptions)
Get a `VariantsDecoder` suitable for decoding `inputPath` using `variantsDecoderOptions`.

Parameters:
  `inputPath` - the input path to decode
  `variantsDecoderOptions` - decoder options to use
Returns:
  a `VariantsDecoder` suitable for decoding `inputPath`
Throws:
  `HtsjdkException` - if no registered codecs can handle the resource
  `HtsjdkPluginException` - if more than one codec claims to handle the resource. this usually indicates that the registry contains an incorrectly written codec.

### getVariantsDecoder

public VariantsDecoder getVariantsDecoder(Bundle inputBundle)
Get a `VariantsDecoder` suitable for decoding `inputBundle`.

Parameters:
  `inputBundle` - the input bundle containing resources to decode
Returns:
  a `VariantsDecoder` suitable for decoding `inputBundle`
Throws:
  `HtsjdkException` - if no registered codecs can handle the resource
  `HtsjdkPluginException` - if more than one codec claims to handle the resource. this usually indicates that the registry contains an incorrectly written codec.

### getVariantsDecoder

public VariantsDecoder getVariantsDecoder(Bundle inputBundle, VariantsDecoderOptions variantsDecoderOptions)
Get a `VariantsDecoder` suitable for decoding `inputBundle` using `variantsDecoderOptions`.

Parameters:
  `inputBundle` - the input bundle to decode
  `variantsDecoderOptions` - decoder options to use
Returns:
  a `VariantsDecoder` suitable for decoding `inputBundle`
Throws:
  `HtsjdkException` - if no registered codecs can handle the resource
  `HtsjdkPluginException` - if more than one codec claims to handle the resource. this usually indicates that the registry contains an incorrectly written codec.

### getVariantsEncoder

public VariantsEncoder getVariantsEncoder(IOPath outputPath)
Get a `VariantsEncoder` suitable for encoding to `outputPath`.

Parameters:
  `outputPath` - path to encode to
Returns:
  a `VariantsEncoder` suitable for encoding to `outputPath`
Throws:
  `HtsjdkException` - if no registered codecs can handle the resource
  `HtsjdkPluginException` - if more than one codec claims to handle the resource. this usually indicates that the registry contains an incorrectly written codec.

### getVariantsEncoder

public VariantsEncoder getVariantsEncoder(IOPath outputPath, VariantsEncoderOptions variantsEncoderOptions)
Get a `VariantsEncoder` suitable for encoding to `outputPath` using `variantsEncoderOptions`.

Parameters:
  `outputPath` - path to encode to
  `variantsEncoderOptions` - encoder options to use
Returns:
  a `VariantsEncoder` suitable for encoding to `outputPath`
Throws:
  `HtsjdkException` - if no registered codecs can handle the resource
  `HtsjdkPluginException` - if more than one codec claims to handle the resource. this usually indicates that the registry contains an incorrectly written codec.

### getVariantsEncoder

public VariantsEncoder getVariantsEncoder(Bundle outputBundle, VariantsEncoderOptions variantsEncoderOptions)
Get a `VariantsEncoder` suitable for encoding to `outputBundle` using `variantsEncoderOptions`.

Parameters:
  `outputBundle` - output bundle containg resources to encode to
  `variantsEncoderOptions` - options to use
Returns:
  a `VariantsEncoder` suitable for encoding to `outputBundle`
Throws:
  `HtsjdkException` - if no registered codecs can handle the resource
  `HtsjdkPluginException` - if more than one codec claims to handle the resource. this usually indicates that the registry contains an incorrectly written codec.

### getVariantsEncoder

public VariantsEncoder getVariantsEncoder(Bundle outputBundle, VariantsEncoderOptions variantsEncoderOptions, String variantsFormat, HtsVersion formatVersion)
Get a `VariantsEncoder` suitable for encoding to `outputBundle` using `variantsEncoderOptions`, specifying a version and output format.

Parameters:
  `outputBundle` - output bundle containing resources to encode to
  `variantsEncoderOptions` - options to use
  `variantsFormat` - the output format to use
  `formatVersion` - the format version to use
Returns:
  a `VariantsEncoder` suitable for encoding to `outputBundle`
Throws:
  `HtsjdkException` - if no registered codecs can handle the resource
  `HtsjdkPluginException` - if more than one codec claims to handle the resource. this usually indicates that the registry contains an incorrectly written codec.