Record Class ConfigSnapshot
java.lang.Object
java.lang.Record
com.loomcache.server.config.ConfigSnapshot
- Record Components:
entries- immutable map of all configuration entries (key -> ConfigEntry)timestamp- the time (millis since epoch) when this snapshot was taken
Immutable snapshot of all configuration entries at a point in time.
Provides atomic multi-key reads of the entire configuration state. Snapshots are read-only and can be safely shared across threads.
-
Constructor Summary
ConstructorsConstructorDescriptionConfigSnapshot(Map<String, ConfigEntry> entries, long timestamp) Creates an instance of aConfigSnapshotrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsKey(String key) Check if a key exists in this snapshot.entries()Get all entries as an unmodifiable map.final booleanIndicates whether some other object is "equal to" this one.@Nullable ConfigEntryGet a configuration entry by key.final inthashCode()Returns a hash code value for this object.intsize()Get the number of configuration entries in this snapshot.longReturns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
entries
Get all entries as an unmodifiable map.- Returns:
- unmodifiable view of entries
-
size
public int size()Get the number of configuration entries in this snapshot.- Returns:
- entry count
-
containsKey
Check if a key exists in this snapshot.- Parameters:
key- the configuration key- Returns:
- true if the key exists
-
get
Get a configuration entry by key.- Parameters:
key- the configuration key- Returns:
- the ConfigEntry, or null if not found
-
toString
-
hashCode
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
timestamp
-