Class FolderConfigItemChange<T>
java.lang.Object
tech.guilhermekaua.spigotboot.config.folder.FolderConfigItemChange<T>
- Type Parameters:
T- the item type
Represents a change to a folder config item.
This class captures all information about a single item change: what folder config it belongs to, what type of change occurred, and the before/after values.
-
Constructor Summary
ConstructorsConstructorDescriptionFolderConfigItemChange(@NotNull String folderConfigName, @NotNull Class<T> itemType, @NotNull String id, @NotNull ItemChangeType type, T oldItem, T newItem) Creates a new folder config item change. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> FolderConfigItemChange<T>Creates an ADDED change.@NotNull StringGets the folder config name.@NotNull StringgetId()Gets the item ID.Gets the item type class.Gets the new item value.Gets the old item value.@NotNull ItemChangeTypegetType()Gets the type of change.static <T> FolderConfigItemChange<T>modified(@NotNull String folderConfigName, @NotNull Class<T> itemType, @NotNull String id, T oldItem, T newItem) Creates a MODIFIED change.static <T> FolderConfigItemChange<T>removed(@NotNull String folderConfigName, @NotNull Class<T> itemType, @NotNull String id, T oldItem) Creates a REMOVED change.toString()
-
Constructor Details
-
FolderConfigItemChange
public FolderConfigItemChange(@NotNull @NotNull String folderConfigName, @NotNull @NotNull Class<T> itemType, @NotNull @NotNull String id, @NotNull @NotNull ItemChangeType type, @Nullable T oldItem, @Nullable T newItem) Creates a new folder config item change.- Parameters:
folderConfigName- the folder config nameitemType- the item type classid- the item IDtype- the type of changeoldItem- the old item (null for ADDED)newItem- the new item (null for REMOVED)
-
-
Method Details
-
added
public static <T> FolderConfigItemChange<T> added(@NotNull @NotNull String folderConfigName, @NotNull @NotNull Class<T> itemType, @NotNull @NotNull String id, @NotNull T newItem) Creates an ADDED change.- Type Parameters:
T- the item type- Parameters:
folderConfigName- the folder config nameitemType- the item type classid- the item IDnewItem- the new item- Returns:
- the change
-
modified
public static <T> FolderConfigItemChange<T> modified(@NotNull @NotNull String folderConfigName, @NotNull @NotNull Class<T> itemType, @NotNull @NotNull String id, @NotNull T oldItem, @NotNull T newItem) Creates a MODIFIED change.- Type Parameters:
T- the item type- Parameters:
folderConfigName- the folder config nameitemType- the item type classid- the item IDoldItem- the old itemnewItem- the new item- Returns:
- the change
-
removed
public static <T> FolderConfigItemChange<T> removed(@NotNull @NotNull String folderConfigName, @NotNull @NotNull Class<T> itemType, @NotNull @NotNull String id, @NotNull T oldItem) Creates a REMOVED change.- Type Parameters:
T- the item type- Parameters:
folderConfigName- the folder config nameitemType- the item type classid- the item IDoldItem- the removed item- Returns:
- the change
-
getFolderConfigName
Gets the folder config name.- Returns:
- the folder config name
-
getItemType
Gets the item type class.- Returns:
- the item type
-
getId
Gets the item ID.- Returns:
- the item ID
-
getType
Gets the type of change.- Returns:
- the change type
-
getOldItem
Gets the old item value.- Returns:
- the old item, or null for ADDED changes
-
getNewItem
Gets the new item value.- Returns:
- the new item, or null for REMOVED changes
-
toString
-