Top Description Inners Fields Constructors Methods
org.jooq.impl

pack-priv final Class Cache

extends Object
Class Inheritance
Static Imports
org.jooq.tools.StringUtils.defaultIfNull

[#2965] This is a Configuration-based cache that can cache reflection information and other things

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static record
Cache.Key2

A 2-value key for caching.

private static record
Cache.Key3

A 3-value key for caching.

Field Summary

Modifier and TypeField and Description
private static final Object
NULL

A null placeholder to be put in ConcurrentHashMap.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv static final Object
key(Object key1, Object key2)

Create a single-value or multi-value key for caching.

pack-priv static final Object
key(Object key1, Object key2, Object key3)

Create a single-value or multi-value key for caching.

pack-priv static final <V> V

Returns:

The cached value or the outcome of the cached operation.
run
(Configuration
The configuration that may cache the outcome of the cached operation.
configuration
,
Supplier<V>
The expensive operation.
operation
,
CacheType
The cache type to be used.
type
,
Supplier<?>
The cache keys.
key
)

Run a cached operation in the context of a Configuration.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

NULLback to summary
private static final Object NULL

A null placeholder to be put in ConcurrentHashMap.

Constructor Detail

Cacheback to summary
pack-priv Cache()

Method Detail

keyback to summary
pack-priv static final Object key(Object key1, Object key2)

Create a single-value or multi-value key for caching.

keyback to summary
pack-priv static final Object key(Object key1, Object key2, Object key3)

Create a single-value or multi-value key for caching.

runback to summary
pack-priv static final <V> V run(Configuration configuration, Supplier<V> operation, CacheType type, Supplier<?> key)

Run a cached operation in the context of a Configuration.

Parameters
configuration:Configuration

The configuration that may cache the outcome of the cached operation.

operation:Supplier<V>

The expensive operation.

type:CacheType

The cache type to be used.

key:Supplier<?>

The cache keys.

Returns:V

The cached value or the outcome of the cached operation.

Annotations
@SuppressWarnings:unchecked
org.jooq.impl back to summary

private final Record Cache.Key2

extends Record
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Record Components
key1:Object 
key2:Object 

A 2-value key for caching.

Field Summary

Modifier and TypeField and Description
private final Object
key1

Record Component accessed by key1().

private final Object
key2

Record Component accessed by key2().

Constructor Summary

AccessConstructor and Description
private
Key2(Object key1, Object key2)

Method Summary

Modifier and TypeMethod and Description
public final boolean
equals(Object
the reference object with which to compare.
o
)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.
public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.
public Object
key1()

Record Component getter of key1.

public Object
key2()

Record Component getter of key2.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

key1back to summary
private final Object key1

Record Component accessed by key1().

key2back to summary
private final Object key2

Record Component accessed by key2().

Constructor Detail

Key2back to summary
private Key2(Object key1, Object key2)

Method Detail

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this record is equal to the argument; false otherwise.

hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

Returns:int

a hash code value for this record.

key1back to summary
public Object key1()

Record Component getter of key1.

key2back to summary
public Object key2()

Record Component getter of key2.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.

Returns:String

a string representation of the object.

org.jooq.impl back to summary

private final Record Cache.Key3

extends Record
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Record Components
key1:Object 
key2:Object 
key3:Object 

A 3-value key for caching.

Field Summary

Modifier and TypeField and Description
private final Object
key1

Record Component accessed by key1().

private final Object
key2

Record Component accessed by key2().

private final Object
key3

Record Component accessed by key3().

Constructor Summary

AccessConstructor and Description
private
Key3(Object key1, Object key2, Object key3)

Method Summary

Modifier and TypeMethod and Description
public final boolean
equals(Object
the reference object with which to compare.
o
)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.
public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.
public Object
key1()

Record Component getter of key1.

public Object
key2()

Record Component getter of key2.

public Object
key3()

Record Component getter of key3.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

key1back to summary
private final Object key1

Record Component accessed by key1().

key2back to summary
private final Object key2

Record Component accessed by key2().

key3back to summary
private final Object key3

Record Component accessed by key3().

Constructor Detail

Key3back to summary
private Key3(Object key1, Object key2, Object key3)

Method Detail

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this record is equal to the argument; false otherwise.

hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

Returns:int

a hash code value for this record.

key1back to summary
public Object key1()

Record Component getter of key1.

key2back to summary
public Object key2()

Record Component getter of key2.

key3back to summary
public Object key3()

Record Component getter of key3.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.

Returns:String

a string representation of the object.