Skip to content

Commit

Permalink
fix: CollectionName parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
qixils committed Dec 21, 2023
1 parent d8a7589 commit 88dab3c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/java/dev/qixils/quasicord/db/CollectionName.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface CollectionName {
@NonNull String name();
@NonNull String value();
}
2 changes: 1 addition & 1 deletion src/main/java/dev/qixils/quasicord/db/DatabaseManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private static String collectionNameOf(Object object) {
private static String collectionNameOf(Class<?> clazz) {
String collectionName;
if (clazz.isAnnotationPresent(CollectionName.class))
collectionName = clazz.getAnnotation(CollectionName.class).name();
collectionName = clazz.getAnnotation(CollectionName.class).value();
else
collectionName = clazz.getSimpleName();
return collectionName.substring(0, Math.min(collectionName.length(), 127));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* An entry in the locale configuration database collection.
* This stores the selected locale for a user, channel, or guild.
*/
@CollectionName(name = "locale")
@CollectionName("locale")
public class LocaleConfig {

@BsonId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* An entry in the timezone configuration database collection.
* This stores the selected timezone for a user.
*/
@CollectionName(name = "timezone")
@CollectionName("timezone")
public class TimeZoneConfig {

@BsonId
Expand Down

0 comments on commit 88dab3c

Please sign in to comment.