Package htsjdk.samtools

# Class SAMValidationError

java.lang.Object
htsjdk.samtools.SAMValidationError

All Implemented Interfaces:
  `Serializable`

public class SAMValidationError extends Object implements Serializable
Class that encapsulates a validation error message as well as a type code so that errors can be aggregated by type.

See Also:
  - Serialized Form

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static enum`
`SAMValidationError.Severity`
`static enum`
`SAMValidationError.Type`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final long`
`serialVersionUID`

## Constructor Summary

Constructors
Constructor
Description
`SAMValidationError(SAMValidationError.Type type, String message, String readName)`
Construct a SAMValidationError with unknown record number.
`SAMValidationError(SAMValidationError.Type type, String message, String readName, long recordNumber)`
Construct a SAMValidationError with possibly-known record number.

## Method Summary

Modifier and Type
Method
Description
`String`
`getMessage()`
`String`
`getReadName()`
may be null
`long`
`getRecordNumber()`
1-based.
`String`
`getSource()`
`SAMValidationError.Type`
`getType()`
`void`
`setRecordNumber(long recordNumber)`
`void`
`setSource(String source)`
`String`
`toString()`

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

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

## Field Details

### serialVersionUID

public static final long serialVersionUID

See Also:
  - Constant Field Values

## Constructor Details

### SAMValidationError

public SAMValidationError(SAMValidationError.Type type, String message, String readName)
Construct a SAMValidationError with unknown record number.

Parameters:
  `type` -
  `message` -
  `readName` - May be null if readName is not known.

### SAMValidationError

public SAMValidationError(SAMValidationError.Type type, String message, String readName, long recordNumber)
Construct a SAMValidationError with possibly-known record number.

Parameters:
  `type` - The validation error type
  `message` - The message explaining the problem
  `readName` - The read which is the cause of the violation. May be null if readName is not known.
  `recordNumber` - Position of the record in the SAM file it has been read from. -1 if not known.

## Method Details

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### getType

public SAMValidationError.Type getType()

### getMessage

public String getMessage()

### getReadName

public String getReadName()
may be null

### getRecordNumber

public long getRecordNumber()
1-based. -1 if not known.

### setRecordNumber

public void setRecordNumber(long recordNumber)

### getSource

public String getSource()

### setSource

public void setSource(String source)