Class ComparisonUtils
java.lang.Object
dev.ua.theroer.magicutils.commands.ComparisonUtils
Helper methods for comparing argument values without Bukkit dependencies.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringextractName(Object obj) Extract name via getName() or toString().static UUIDextractUuid(Object obj) Extract UUID via common patterns (UUID, OfflinePlayer, getUniqueId).static booleanisEqual(Object first, Object second, CompareMode mode) Compare two objects using the configured mode.static booleanisSender(Object sender, Object value, CompareMode mode) Check if a value represents the sender using the chosen mode.
-
Method Details
-
isEqual
Compare two objects using the configured mode.- Parameters:
first- left valuesecond- right valuemode- compare strategy- Returns:
- true if equal under the chosen mode
-
isSender
Check if a value represents the sender using the chosen mode.- Parameters:
sender- command sendervalue- value to comparemode- compare strategy- Returns:
- true if matches sender
-
extractUuid
-
extractName
-