Module org.firebirdsql.jaybird
Package org.firebirdsql.jdbc

# Enum Class QuoteStrategy

java.lang.Object
java.lang.Enum<QuoteStrategy>
org.firebirdsql.jdbc.QuoteStrategy

All Implemented Interfaces:
  `Serializable`, `Comparable<QuoteStrategy>`, `Constable`

@InternalApi public enum QuoteStrategy extends Enum<QuoteStrategy>
Strategy for quoting object names and literals (or no quoting of object names in the case of dialect 1).

This class is internal API of Jaybird. Future versions may radically change, move, or make inaccessible this type.

Since:
  2.2

## Nested Class Summary

## Nested classes/interfaces inherited from class java.lang.Enum

`Enum.EnumDesc<E extends Enum<E>>`

## Enum Constant Summary

Enum Constants
Enum Constant
Description
`DIALECT_1`
Dialect 1 doesn't support quoting of object names, and uses double quotes for literals.
`DIALECT_3`
Dialect 3 (and 2) supports quoting of object names, and uses single quotes for literals.
`NO_QUOTES`
Deprecated, for removal: This API element is subject to removal in a future version.
Will be removed in Jaybird 7, use `DIALECT_1` instead
`QUOTES`
Deprecated, for removal: This API element is subject to removal in a future version.
Will be removed in Jaybird 7, use `DIALECT_3` instead

## Method Summary

Modifier and Type
Method
Description
`abstract StringBuilder`
`appendLiteral(String value, StringBuilder sb)`
Appends `value` as a CHAR literal with the right quotes and escaping for this quote strategy to `sb`.
`abstract StringBuilder`
`appendQuoted(String objectName, StringBuilder sb)`
Appends the `objectName` with (or in the case of dialect 1: without) quotes to `sb`.
`static QuoteStrategy`
`forDialect(int dialect)`
Obtain the `QuoteStrategy` for the specified dialect.
`String`
`quoteLiteral(String value)`
Returns `value` as a CHAR literal with the right quotes and escaping for this quote strategy.
`abstract String`
`quoteObjectName(String objectName)`
Returns the object name appropriately quoted according to this quote strategy.
`static QuoteStrategy`
`valueOf(String name)`
Returns the enum constant of this class with the specified name.
`static QuoteStrategy[]`
`values()`
Returns an array containing the constants of this enum class, in the order they are declared.

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

`clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

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

`getClass, notify, notifyAll, wait, wait, wait`

## Enum Constant Details

### DIALECT_1

public static final QuoteStrategy DIALECT_1
Dialect 1 doesn't support quoting of object names, and uses double quotes for literals.

Since:
  6

### DIALECT_3

public static final QuoteStrategy DIALECT_3
Dialect 3 (and 2) supports quoting of object names, and uses single quotes for literals.

Since:
  6

### NO_QUOTES

@Deprecated(since="6", forRemoval=true) public static final QuoteStrategy NO_QUOTES
Deprecated, for removal: This API element is subject to removal in a future version.
Will be removed in Jaybird 7, use `DIALECT_1` instead
Basically an alias for `DIALECT_1` for backwards compatibility.

### QUOTES

@Deprecated(since="6", forRemoval=true) public static final QuoteStrategy QUOTES
Deprecated, for removal: This API element is subject to removal in a future version.
Will be removed in Jaybird 7, use `DIALECT_3` instead
Basically an alias for `DIALECT_3` for backwards compatibility.

## Method Details

### values

public static QuoteStrategy[] values()
Returns an array containing the constants of this enum class, in the order they are declared.

Returns:
  an array containing the constants of this enum class, in the order they are declared

### valueOf

public static QuoteStrategy valueOf(String name)
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)

Parameters:
  `name` - the name of the enum constant to be returned.
Returns:
  the enum constant with the specified name
Throws:
  `IllegalArgumentException` - if this enum class has no constant with the specified name
  `NullPointerException` - if the argument is null

### appendQuoted

public abstract StringBuilder appendQuoted(String objectName, StringBuilder sb)
Appends the `objectName` with (or in the case of dialect 1: without) quotes to `sb`.

Parameters:
  `objectName` - The object name to append
  `sb` - StringBuilder for appending
Returns:
  The StringBuilder for method chaining

### quoteObjectName

public abstract String quoteObjectName(String objectName)
Returns the object name appropriately quoted according to this quote strategy.

Parameters:
  `objectName` - The object name
Returns:
  The transformed object name
Since:
  3.0.6

### appendLiteral

public abstract StringBuilder appendLiteral(String value, StringBuilder sb)
Appends `value` as a CHAR literal with the right quotes and escaping for this quote strategy to `sb`.

Parameters:
  `value` - The value to append as a literal
  `sb` - StringBuilder for appending
Returns:
  The StringBuilder for method chaining
Since:
  6

### quoteLiteral

public String quoteLiteral(String value)
Returns `value` as a CHAR literal with the right quotes and escaping for this quote strategy.

Parameters:
  `value` - The value to append as a literal
Returns:
  The transformed value as a literal
Since:
  6

### forDialect

public static QuoteStrategy forDialect(int dialect)
Obtain the `QuoteStrategy` for the specified dialect.

Parameters:
  `dialect` - Dialect
Returns:
  Appropriate `QuoteStrategy`