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

# Record Class FBSavepoint

java.lang.Object
java.lang.Record
org.firebirdsql.jdbc.FBSavepoint

Record Components:
  `savepointId` - numeric savepoint id (must be non-`null` if `name` is `null`).
  `name` - savepoint name (must be non-`null` if `savepointId` is `null`)

All Implemented Interfaces:
  `Savepoint`, `FirebirdSavepoint`

@InternalApi public record FBSavepoint(Integer savepointId, String name) extends Record implements FirebirdSavepoint
Savepoint implementation.

This class is internal API of Jaybird. Future versions may radically change, move, or make inaccessible this type. For the public API, refer to the `Savepoint` and `FirebirdSavepoint` interfaces.

Author:
  Roman Rokytskyy, Mark Rotteveel

## Constructor Summary

Constructors
Constructor
Description
`FBSavepoint(int savepointId)`
Create an unnamed savepoint.
`FBSavepoint(Integer savepointId, String name)`
Creates an instance of a `FBSavepoint` record class.
`FBSavepoint(String name)`
Create a named savepoint.

## Method Summary

Modifier and Type
Method
Description
`final boolean`
`equals(Object o)`
Indicates whether some other object is "equal to" this one.
`int`
`getSavepointId()`
`String`
`getSavepointName()`
`final int`
`hashCode()`
Returns a hash code value for this object.
`String`
`name()`
Returns the value of the `name` record component.
`Integer`
`savepointId()`
Returns the value of the `savepointId` record component.
`final String`
`toString()`
Returns a string representation of this record class.

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

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

## Constructor Details

### FBSavepoint

public FBSavepoint(Integer savepointId, String name)
Creates an instance of a `FBSavepoint` record class.

Parameters:
  `savepointId` - the value for the `savepointId` record component
  `name` - the value for the `name` record component

### FBSavepoint

public FBSavepoint(int savepointId)
Create an unnamed savepoint.

Parameters:
  `savepointId` - ID of the savepoint

### FBSavepoint

public FBSavepoint(String name)
Create a named savepoint.

Parameters:
  `name` - name of the savepoint

## Method Details

### getSavepointId

public int getSavepointId() throws SQLException

Specified by:
  `getSavepointId` in interface `Savepoint`
Throws:
  `SQLException`

### getSavepointName

public String getSavepointName() throws SQLException

Specified by:
  `getSavepointName` in interface `Savepoint`
Throws:
  `SQLException`

### toString

public final String toString()
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.

Specified by:
  `toString` in class `Record`
Returns:
  a string representation of this object

### hashCode

public final int hashCode()
Returns a hash code value for this object. The value is derived from the hash code of each of the record components.

Specified by:
  `hashCode` in class `Record`
Returns:
  a hash code value for this object

### equals

public final boolean equals(Object o)
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with `Objects::equals(Object,Object)`.

Specified by:
  `equals` in class `Record`
Parameters:
  `o` - the object with which to compare
Returns:
  `true` if this object is the same as the `o` argument; `false` otherwise.

### savepointId

public Integer savepointId()
Returns the value of the `savepointId` record component.

Returns:
  the value of the `savepointId` record component

### name

public String name()
Returns the value of the `name` record component.

Returns:
  the value of the `name` record component