java.lang.Object
java.lang.Record
org.firebirdsql.gds.ng.CachedInfoResponse
- Record Components:
infoResponse- byte array with info response; the caller of the constructor is responsible for cloning/copying the array if needed
Cached info response.
This record holds an info response array, and can produce a filtered response holding only those items asked for.
- Since:
- 6.0.2
- Author:
- Mark Rotteveel
-
Constructor Summary
ConstructorsConstructorDescriptionCachedInfoResponse(byte[] infoResponse) Creates an instance of aCachedInfoResponserecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic CachedInfoResponseempty()booleanIndicates whether some other object is "equal to" this one.byte[]filtered(byte[] requestItems) Produces a response with only the items inrequestItems, allowing items to be missing.Optional<byte[]>filteredComplete(byte[] requestItems) Produces a response with only the items inrequestItems, requiring all items to be present.inthashCode()Returns a hash code value for this object.byte[]Returns the value of theinfoResponserecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CachedInfoResponse
public CachedInfoResponse(byte[] infoResponse) Creates an instance of aCachedInfoResponserecord class.- Parameters:
infoResponse- the value for theinfoResponserecord component
-
-
Method Details
-
empty
- Returns:
- a — possibly cached — empty cached info response
-
filtered
public byte[] filtered(byte[] requestItems) Produces a response with only the items inrequestItems, allowing items to be missing.If there are no matching items, or the cached response is empty, then a byte array with only
ISCConstants.isc_info_endis returned.- Parameters:
requestItems- requested info items- Returns:
- an info response with only the requested items, ending in
ISCConstants.isc_info_end - See Also:
-
filteredComplete
Produces a response with only the items inrequestItems, requiring all items to be present.If at least one item in
requestItems(excludingISCConstants.isc_info_end) is not found in this cached info response, empty is returned.- Parameters:
requestItems- requested info items- Returns:
- an optional with an info response with only the requested items, and ending in
ISCConstants.isc_info_end, or empty if at least one of the requested items where not found in the cached response, or if the cached response is empty - See Also:
-
infoResponse
public byte[] infoResponse()Returns the value of theinfoResponserecord component.- Returns:
- the value of the
infoResponserecord component
-
hashCode
public int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
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 withObjects::equals(Object,Object). -
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.
-