Package org.firebirdsql.gds.ng
Class CachedInfoResponse
- java.lang.Object
-
- org.firebirdsql.gds.ng.CachedInfoResponse
-
public class CachedInfoResponse extends java.lang.Object
Cached info response.This class holds an info response array, and can produce a filtered response holding only those items asked for.
- Since:
- 5.0.8
- Author:
- Mark Rotteveel
-
-
Constructor Summary
Constructors Constructor Description CachedInfoResponse(byte[] infoResponse)
Constructs a cached info response.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CachedInfoResponse
empty()
boolean
equals(java.lang.Object obj)
byte[]
filtered(byte[] requestItems)
Produces a response with only the items inrequestItems
, allowing items to be missing.java.util.Optional<byte[]>
filteredComplete(byte[] requestItems)
Produces a response with only the items inrequestItems
, requiring all items to be present.int
hashCode()
byte[]
infoResponse()
-
-
-
Method Detail
-
empty
public static CachedInfoResponse 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_end
is returned.- Parameters:
requestItems
- requested info items- Returns:
- an info response with only the requested items, ending in
ISCConstants.isc_info_end
- See Also:
filteredComplete(byte[])
-
filteredComplete
public java.util.Optional<byte[]> filteredComplete(byte[] requestItems)
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:
filtered(byte[])
-
infoResponse
public byte[] infoResponse()
- Returns:
- a copy of the full info response array
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-