# Class SiaFormatOption

java.lang.Object
uk.ac.starlink.vo.SiaFormatOption

public class SiaFormatOption extends Object
Encapsulates options for record format requirements used in an SIA query.

This is a bit of a historical relic: in SIAv1 FORMAT was one of the most important options, but in SIAv2 there are many options and FORMAT doesn't necessarily warrant special treatment. This is here to enable pluggability between SIAv1 and v2 without disruption to the UI, but it may be replaced with a more comprehensive upgrade to SIAv2 handling in future.

Since:
  12 Mar 2020
Author:
  Mark Taylor

## Field Summary

Fields
Modifier and Type
Field
Description
`static final SiaFormatOption`
`ALL`
`static final SiaFormatOption`
`DATALINK`
`static final SiaFormatOption`
`FITS`
`static final SiaFormatOption`
`GRAPHIC`

## Constructor Summary

Constructors
Constructor
Description
`SiaFormatOption(String value)`
Constructs an option instance with a single value, suitable for both SIAv1 and SIAv2.
`SiaFormatOption(String v1Value, String[] v2Values)`
Constructs a general format option.

## Method Summary

Modifier and Type
Method
Description
`static SiaFormatOption`
`fromObject(Object formatOrString)`
Tries to turn an object into an SiaFormatObject.
`String`
`getSiav1Value()`
Returns value for use in SIAv1 queries.
`String[]`
`getSiav2Values()`
Returns list of values for use in SIAv2 queries.
`static SiaFormatOption[]`
`getStandardOptions()`
Returns a list of standard options suitable for use in an SIA UI.
`String`
`toString()`

### Methods inherited from class Object

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

## Field Details

### ALL

public static final SiaFormatOption ALL

### GRAPHIC

public static final SiaFormatOption GRAPHIC

### FITS

public static final SiaFormatOption FITS

### DATALINK

public static final SiaFormatOption DATALINK

## Constructor Details

### SiaFormatOption

public SiaFormatOption(String value)
Constructs an option instance with a single value, suitable for both SIAv1 and SIAv2.

Parameters:
  `value` - required FORMAT parameter value

### SiaFormatOption

public SiaFormatOption(String v1Value, String[] v2Values)
Constructs a general format option.

Parameters:
  `v1Value` - value for use in SIAv1 queries
  `v2Values` - list of values to be ORed together for SIAv2 queries

## Method Details

### getSiav1Value

public String getSiav1Value()
Returns value for use in SIAv1 queries.

Returns:
  SIAv1 FORMAT parameter value

### getSiav2Values

public String[] getSiav2Values()
Returns list of values for use in SIAv2 queries.

Returns:
  list of values for repeated SIAv2 FORMAT parameters

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### getStandardOptions

public static SiaFormatOption[] getStandardOptions()
Returns a list of standard options suitable for use in an SIA UI.

Returns:
  standard format options

### fromObject

public static SiaFormatOption fromObject(Object formatOrString)
Tries to turn an object into an SiaFormatObject. The input object may already be an SiaFormatObject or may be a String. This method is intended for use with an editable JComboBox containing SiaFormatOption objects.

Parameters:
  `formatOrString` - object that may represent an SiaFormatObject, either an SiaFormatObject or a FORMAT value
Returns:
  corresponding SiaFormatObject, or null