Module org.firebirdsql.jaybird
Package org.firebirdsql.jaybird.props.def

# Class ConnectionProperty

java.lang.Object
org.firebirdsql.jaybird.props.def.ConnectionProperty

public final class ConnectionProperty extends Object
A Jaybird connection property.

Holds information like name, aliases, default value etc for a Jaybird connection property.

Since:
  5
Author:
  Mark Rotteveel

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static final class`
`ConnectionProperty.Builder`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`NO_DPB_ITEM`
`static final int`
`NO_SPB_ITEM`

## Method Summary

Modifier and Type
Method
Description
`List<String>`
`aliases()`
Optional aliases (secondary names) for this property.
`static ConnectionProperty.Builder`
`builder()`
Creates a connection property builder.
`static ConnectionProperty.Builder`
`builder(String name)`
`List<String>`
`choices()`
Possible values for this property.
`int`
`dpbItem()`
Database parameter buffer (DPB) item associated with this property.
`boolean`
`equals(Object o)`
`boolean`
`hasDpbItem()`
`int`
`hashCode()`
`boolean`
`hasSpbItem()`
`boolean`
`isIdenticalTo(ConnectionProperty other)`
Checks if the provided object is identical to this object.
`String`
`name()`
`DpbType`
`pbType()`
Type of the value when sent in the database (or service attach) parameter buffer.
`int`
`spbItem()`
Service parameter buffer (SPB) item associated with this property.
`String`
`toString()`
`ConnectionPropertyType`
`type()`
Type of the property.
`static ConnectionProperty`
`unknown(String name)`
Creates an unknown connection property.
`<T> T`
`validate(T value)`
Validates `value` for this property.

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

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

## Field Details

### NO_DPB_ITEM

public static final int NO_DPB_ITEM

See Also:
  - Constant Field Values

### NO_SPB_ITEM

public static final int NO_SPB_ITEM

See Also:
  - Constant Field Values

## Method Details

### builder

public static ConnectionProperty.Builder builder()
Creates a connection property builder.

Returns:
  builder

### builder

public static ConnectionProperty.Builder builder(String name)

### unknown

public static ConnectionProperty unknown(String name)
Creates an unknown connection property.

An unknown connection property was either not defined but used, or can be used for lookups (given the definition of equals and hashcode). An unknown connection property returned by this method always applies type `ConnectionPropertyType.STRING`

Parameters:
  `name` - Property name
Returns:
  An unknown property with the specified name

### name

public String name()

Returns:
  name of the property

### aliases

public List<String> aliases()
Optional aliases (secondary names) for this property.

Aliases are alternative names for the property, either for backwards compatibility or for ease of use.

Returns:
  aliases for this property, empty means no aliases
See Also:
  - `name()`

### type

public ConnectionPropertyType type()
Type of the property.

Returns:
  type of the property

### choices

public List<String> choices()
Possible values for this property.

Returns:
  possible values for this property, or empty when unrestricted

### validate

public <T> T validate(T value)
Validates `value` for this property.

Parameters:
  `value` - value to validate
Returns:
  `value` when validation passed
Throws:
  `IllegalArgumentException` - When `value` is not a valid value for this property

### pbType

public DpbType pbType()
Type of the value when sent in the database (or service attach) parameter buffer.

Returns:
  type for the parameter buffer

### dpbItem

public int dpbItem()
Database parameter buffer (DPB) item associated with this property.

Returns:
  database parameter buffer item, or `NO_DPB_ITEM` if no item is associated
See Also:
  - `hasDpbItem()`

### hasDpbItem

public boolean hasDpbItem()

Returns:
  `true` if this property has a DPB item
See Also:
  - `dpbItem()`

### spbItem

public int spbItem()
Service parameter buffer (SPB) item associated with this property.

Returns:
  service parameter buffer item, or `NO_SPB_ITEM` if no item is associated
See Also:
  - `hasSpbItem()`

### hasSpbItem

public boolean hasSpbItem()

Returns:
  `true` if this property has an SPB item
See Also:
  - `spbItem()`

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### equals

public boolean equals(Object o)

Equality (and hash code) only considers the `name`.

Use `isIdenticalTo(ConnectionProperty)` for checking full equality.

Overrides:
  `equals` in class `Object`

### hashCode

public int hashCode()

The hashcode (and equals) only considers the `name`.

Overrides:
  `hashCode` in class `Object`

### isIdenticalTo

public boolean isIdenticalTo(ConnectionProperty other)
Checks if the provided object is identical to this object.

This supplements `equals(Object)` which only checks the `name`.

Parameters:
  `other` - Other connection property object
Returns:
  `true` if this is the same object or all fields have the same value, `false` otherwise