Index

A B C D E F G H I L M N O P R S T V W 
All Classes and Interfaces|All Packages

A

allowed(LogLevel) - Method in class com.petarmc.lib.log.PLog
 

B

body - Variable in class com.petarmc.lib.net.HttpResponse
The body of the response as a string.

C

ChatMatch - Class in com.petarmc.lib.chat
Represents a successful pattern match from a chat message.
ChatMatch(String, Matcher, String) - Constructor for class com.petarmc.lib.chat.ChatMatch
 
ChatMatchHandler - Interface in com.petarmc.lib.chat
Functional interface for handling chat pattern matches.
ChatPatternMatcher - Class in com.petarmc.lib.chat
A reusable chat pattern matching system that allows registration of regex patterns and exact string matches with associated handlers.
ChatPatternMatcher() - Constructor for class com.petarmc.lib.chat.ChatPatternMatcher
 
ChatPatternMatcher.PatternEntry - Class in com.petarmc.lib.chat
 
clear() - Method in class com.petarmc.lib.chat.ChatPatternMatcher
Remove all registered patterns and exact matches.
client - Variable in class com.petarmc.lib.net.HttpClientWrapper
 
com.petarmc.lib - package com.petarmc.lib
 
com.petarmc.lib.chat - package com.petarmc.lib.chat
 
com.petarmc.lib.log - package com.petarmc.lib.log
 
com.petarmc.lib.net - package com.petarmc.lib.net
 
com.petarmc.lib.task - package com.petarmc.lib.task
 

D

debug(String) - Method in class com.petarmc.lib.log.PLog
Logs a debug-level message.
debug(String) - Method in interface com.petarmc.lib.log.PLogger
Logs a debug-level message.
DEBUG - Enum constant in enum class com.petarmc.lib.log.LogLevel
Debug-level messages, intended for detailed developer debugging.

E

error(String) - Method in class com.petarmc.lib.log.PLog
Logs an error-level message.
error(String) - Method in interface com.petarmc.lib.log.PLogger
Logs an error-level message.
error(String, Throwable) - Method in class com.petarmc.lib.log.PLog
Logs an error-level message along with a Throwable.
error(String, Throwable) - Method in interface com.petarmc.lib.log.PLogger
Logs an error-level message along with a Throwable.
ERROR - Enum constant in enum class com.petarmc.lib.log.LogLevel
Error-level messages, indicating a failure or critical issue.
exactMatches - Variable in class com.petarmc.lib.chat.ChatPatternMatcher
 
ExactMatchHandler - Interface in com.petarmc.lib.chat
Functional interface for handling exact chat message matches.
executor - Variable in class com.petarmc.lib.net.HttpClientWrapper
 

F

format(String, String) - Method in class com.petarmc.lib.log.PLog
 

G

get(Class<?>) - Static method in class com.petarmc.lib.log.Log
Returns a logger instance for the specified class.
get(String) - Static method in class com.petarmc.lib.log.Log
Returns a logger instance with the specified name.
get(String) - Method in class com.petarmc.lib.net.HttpClientWrapper
Sends an async GET request to the specified URL.
getGroup(int) - Method in class com.petarmc.lib.chat.ChatMatch
Get a captured group by index
getGroupCount() - Method in class com.petarmc.lib.chat.ChatMatch
Get the number of captured groups
getMatcher() - Method in class com.petarmc.lib.chat.ChatMatch
 
getName() - Method in class com.petarmc.lib.log.PLog
Returns the name of this logger.
getName() - Method in interface com.petarmc.lib.log.PLogger
Returns the name of this logger, typically representing the source or context of the log messages.
getOriginalMessage() - Method in class com.petarmc.lib.chat.ChatMatch
 
getPatternId() - Method in class com.petarmc.lib.chat.ChatMatch
 
globalLevel - Static variable in class com.petarmc.lib.log.LogConfig
The global log level.
globalPrefix - Static variable in class com.petarmc.lib.log.LogConfig
A prefix to add to every log message, e.g., "[MyMod]".

H

handler - Variable in class com.petarmc.lib.chat.ChatPatternMatcher.PatternEntry
 
headers - Variable in class com.petarmc.lib.net.HttpResponse
The HTTP headers of the response.
HttpClientWrapper - Class in com.petarmc.lib.net
A simple wrapper around Java's HttpClient with support for retries and asycn execution.
HttpClientWrapper(int) - Constructor for class com.petarmc.lib.net.HttpClientWrapper
Creates a new HttpClientWrapper with a specified maximum number of retries.
HttpResponse - Class in com.petarmc.lib.net
Represents an HTTP response with status code, body, and headers.
HttpResponse(int, String, Map<String, List<String>>) - Constructor for class com.petarmc.lib.net.HttpResponse
Constructs a new HttpResponse.

I

includeThread - Static variable in class com.petarmc.lib.log.LogConfig
If true, the current thread name will be included in log messages.
includeTimestamp - Static variable in class com.petarmc.lib.log.LogConfig
If true, timestamps will be included in log messages.
info(String) - Method in class com.petarmc.lib.log.PLog
Logs an info-level message.
info(String) - Method in interface com.petarmc.lib.log.PLogger
Logs an info-level msg.
INFO - Enum constant in enum class com.petarmc.lib.log.LogLevel
Info-level messages, for general informational purposes.
init() - Static method in class com.petarmc.lib.Petarlib
 
inject(PLogger) - Static method in class com.petarmc.lib.log.Log
Injects a custom logger to be returned by all Log.get(java.lang.Class<?>) calls.
injected - Static variable in class com.petarmc.lib.log.Log
 
isSuccess() - Method in class com.petarmc.lib.net.HttpResponse
Returns true if the status code indicates a successful response (200-299).

L

log - Static variable in class com.petarmc.lib.net.HttpClientWrapper
 
log - Static variable in class com.petarmc.lib.Petarlib
 
log - Static variable in class com.petarmc.lib.task.TaskScheduler
 
Log - Class in com.petarmc.lib.log
Utility class for obtaining logger instances.
Log() - Constructor for class com.petarmc.lib.log.Log
 
LogConfig - Class in com.petarmc.lib.log
Configuration settings for the logging system.
LogConfig() - Constructor for class com.petarmc.lib.log.LogConfig
 
logFilePath - Static variable in class com.petarmc.lib.log.LogConfig
The path of the log file when LogConfig.logToFile is true.
LogLevel - Enum Class in com.petarmc.lib.log
Represents the different log levels supported by the logging system.
LogLevel() - Constructor for enum class com.petarmc.lib.log.LogLevel
 
logToFile - Static variable in class com.petarmc.lib.log.LogConfig
If true, log messages will also be written to a file.

M

matcher - Variable in class com.petarmc.lib.chat.ChatMatch
 
maxRetries - Variable in class com.petarmc.lib.net.HttpClientWrapper
 

N

name - Variable in class com.petarmc.lib.log.PLog
 
NONE - Enum constant in enum class com.petarmc.lib.log.LogLevel
No logging.

O

onExactMatch(String, String) - Method in interface com.petarmc.lib.chat.ExactMatchHandler
Called when a chat message exactly matches a registered string.
onMatch(ChatMatch) - Method in interface com.petarmc.lib.chat.ChatMatchHandler
Called when a chat message matches a registered pattern.
originalMessage - Variable in class com.petarmc.lib.chat.ChatMatch
 

P

pattern - Variable in class com.petarmc.lib.chat.ChatPatternMatcher.PatternEntry
 
PatternEntry(String, Pattern, ChatMatchHandler) - Constructor for class com.petarmc.lib.chat.ChatPatternMatcher.PatternEntry
 
patternId - Variable in class com.petarmc.lib.chat.ChatMatch
 
patternId - Variable in class com.petarmc.lib.chat.ChatPatternMatcher.PatternEntry
 
patterns - Variable in class com.petarmc.lib.chat.ChatPatternMatcher
 
Petarlib - Class in com.petarmc.lib
 
Petarlib() - Constructor for class com.petarmc.lib.Petarlib
 
PLog - Class in com.petarmc.lib.log
PerformanceLog implementation that logs messages to the console and optionally to a file.
PLog(String) - Constructor for class com.petarmc.lib.log.PLog
Creates a new PerformanceLog instance with the given name.
PLogger - Interface in com.petarmc.lib.log
Interface for a simple logger with multiple log levels.
post(HttpRequest) - Method in class com.petarmc.lib.net.HttpClientWrapper
Sends an async POST request using the provided HttpRequest.
processMessage(String) - Method in class com.petarmc.lib.chat.ChatPatternMatcher
Process a chat message against all registered patterns and exact matches.

R

registerExactMatch(String, String, ExactMatchHandler) - Method in class com.petarmc.lib.chat.ChatPatternMatcher
Register an exact string match with a handler.
registerPattern(String, String, int, ChatMatchHandler) - Method in class com.petarmc.lib.chat.ChatPatternMatcher
Register a regex pattern with flags.
registerPattern(String, String, ChatMatchHandler) - Method in class com.petarmc.lib.chat.ChatPatternMatcher
Register a regex pattern with a handler.
registerPattern(String, Pattern, ChatMatchHandler) - Method in class com.petarmc.lib.chat.ChatPatternMatcher
Register a regex pattern with a handler.
removeExactMatch(String) - Method in class com.petarmc.lib.chat.ChatPatternMatcher
Remove a specific exact match.
removePattern(String) - Method in class com.petarmc.lib.chat.ChatPatternMatcher
Remove a specific pattern by ID.
runAsync(Runnable) - Method in class com.petarmc.lib.task.TaskScheduler
Runs a task asynchronously.
runDelayed(Runnable, long) - Method in class com.petarmc.lib.task.TaskScheduler
Runs a task after a specified delay in ms.

S

scheduler - Variable in class com.petarmc.lib.task.TaskScheduler
 
sendWithRetry(HttpRequest, int) - Method in class com.petarmc.lib.net.HttpClientWrapper
 
shutdown() - Method in class com.petarmc.lib.net.HttpClientWrapper
Shuts down the executor used for async HTTP requests.
shutdown() - Method in class com.petarmc.lib.task.TaskScheduler
Shuts down the scheduler, waiting up to 5 seconds before forcing shutdown.
statusCode - Variable in class com.petarmc.lib.net.HttpResponse
The HTTP status code of the response.

T

TaskScheduler - Class in com.petarmc.lib.task
Schedules and executes tasks async or with a delay.
TaskScheduler(int) - Constructor for class com.petarmc.lib.task.TaskScheduler
Creates a TaskScheduler with a fixed number of threads.
toString() - Method in class com.petarmc.lib.net.HttpResponse
Returns a string representation of the HttpResponse, including status code and body length.

V

valueOf(String) - Static method in enum class com.petarmc.lib.log.LogLevel
Returns the enum constant of this class with the specified name.
values() - Static method in enum class com.petarmc.lib.log.LogLevel
Returns an array containing the constants of this enum class, in the order they are declared.

W

warn(String) - Method in class com.petarmc.lib.log.PLog
Logs a warning-level message.
warn(String) - Method in interface com.petarmc.lib.log.PLogger
Logs a warning-level message.
WARN - Enum constant in enum class com.petarmc.lib.log.LogLevel
Warning-level messages, indicating a potential problem.
writeToFile(String) - Method in class com.petarmc.lib.log.PLog
 
A B C D E F G H I L M N O P R S T V W 
All Classes and Interfaces|All Packages