Class CacheConfigurationException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- io.github.dhruv1110.jcachex.exceptions.CacheException
-
- io.github.dhruv1110.jcachex.exceptions.CacheConfigurationException
-
- All Implemented Interfaces:
Serializable
public class CacheConfigurationException extends CacheException
Exception thrown when there are configuration errors in cache setup.This exception indicates problems with cache configuration such as:
- Invalid cache size limits
- Incompatible configuration combinations
- Missing required configuration parameters
- Invalid eviction strategy settings
Usage Examples:
try { CacheConfig<String, String> config = CacheConfig.<String, String>builder() .maximumSize(-1L) // Invalid size .build(); } catch (CacheConfigurationException e) { // Handle configuration error logger.error("Invalid cache configuration: " + e.getMessage()); }
- Since:
- 1.0.0
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.github.dhruv1110.jcachex.exceptions.CacheException
CacheException.ErrorType
-
-
Constructor Summary
Constructors Constructor Description CacheConfigurationException(String message)
Constructs a new cache configuration exception with the specified detail message.CacheConfigurationException(String message, String errorCode)
Constructs a new cache configuration exception with a specific error code.CacheConfigurationException(String message, Throwable cause)
Constructs a new cache configuration exception with the specified detail message and cause.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CacheConfigurationException
conflictingSettings(String setting1, String setting2)
Creates a configuration exception for conflicting settings.static CacheConfigurationException
invalidMaximumSize(long size)
Creates a configuration exception for invalid maximum size.static CacheConfigurationException
invalidMaximumWeight(long weight)
Creates a configuration exception for invalid maximum weight.static CacheConfigurationException
missingWeigher()
Creates a configuration exception for missing weigher function.-
Methods inherited from class io.github.dhruv1110.jcachex.exceptions.CacheException
getErrorCode, getErrorType, isRetryable, toString
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
-
-
-
Constructor Detail
-
CacheConfigurationException
public CacheConfigurationException(String message)
Constructs a new cache configuration exception with the specified detail message.- Parameters:
message
- the detail message
-
CacheConfigurationException
public CacheConfigurationException(String message, Throwable cause)
Constructs a new cache configuration exception with the specified detail message and cause.- Parameters:
message
- the detail messagecause
- the cause
-
-
Method Detail
-
invalidMaximumSize
public static CacheConfigurationException invalidMaximumSize(long size)
Creates a configuration exception for invalid maximum size.- Parameters:
size
- the invalid size value- Returns:
- a new CacheConfigurationException
-
invalidMaximumWeight
public static CacheConfigurationException invalidMaximumWeight(long weight)
Creates a configuration exception for invalid maximum weight.- Parameters:
weight
- the invalid weight value- Returns:
- a new CacheConfigurationException
-
missingWeigher
public static CacheConfigurationException missingWeigher()
Creates a configuration exception for missing weigher function.- Returns:
- a new CacheConfigurationException
-
conflictingSettings
public static CacheConfigurationException conflictingSettings(String setting1, String setting2)
Creates a configuration exception for conflicting settings.- Parameters:
setting1
- the first conflicting settingsetting2
- the second conflicting setting- Returns:
- a new CacheConfigurationException
-
-