Add some missing null check annotations
This commit is contained in:
parent
1312aac349
commit
97121bc719
@ -120,6 +120,7 @@ public interface Track {
|
||||
* @throws NullPointerException if the group is null
|
||||
* @throws IllegalStateException if the group instance was not obtained from LuckPerms.
|
||||
*/
|
||||
@Nonnull
|
||||
DataMutateResult appendGroup(@Nonnull Group group);
|
||||
|
||||
/**
|
||||
@ -132,6 +133,7 @@ public interface Track {
|
||||
* @throws NullPointerException if the group is null
|
||||
* @throws IllegalStateException if the group instance was not obtained from LuckPerms.
|
||||
*/
|
||||
@Nonnull
|
||||
DataMutateResult insertGroup(@Nonnull Group group, int position) throws IndexOutOfBoundsException;
|
||||
|
||||
/**
|
||||
@ -142,6 +144,7 @@ public interface Track {
|
||||
* @throws NullPointerException if the group is null
|
||||
* @throws IllegalStateException if the group instance was not obtained from LuckPerms.
|
||||
*/
|
||||
@Nonnull
|
||||
DataMutateResult removeGroup(@Nonnull Group group);
|
||||
|
||||
/**
|
||||
@ -151,6 +154,7 @@ public interface Track {
|
||||
* @return the result of the operation
|
||||
* @throws NullPointerException if the group is null
|
||||
*/
|
||||
@Nonnull
|
||||
DataMutateResult removeGroup(@Nonnull String group);
|
||||
|
||||
/**
|
||||
|
@ -74,6 +74,7 @@ public interface User extends PermissionHolder {
|
||||
* @throws IllegalStateException if the user is not a member of that group
|
||||
* @throws NullPointerException if the group is null
|
||||
*/
|
||||
@Nonnull
|
||||
DataMutateResult setPrimaryGroup(@Nonnull String group);
|
||||
|
||||
/**
|
||||
|
@ -107,24 +107,28 @@ public final class ApiTrack implements me.lucko.luckperms.api.Track {
|
||||
return this.handle.demote(ApiUser.cast(user), contextSet, Predicates.alwaysTrue(), null);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public DataMutateResult appendGroup(@Nonnull Group group) {
|
||||
Objects.requireNonNull(group, "group");
|
||||
return this.handle.appendGroup(ApiGroup.cast(group));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public DataMutateResult insertGroup(@Nonnull Group group, int position) throws IndexOutOfBoundsException {
|
||||
Objects.requireNonNull(group, "group");
|
||||
return this.handle.insertGroup(ApiGroup.cast(group), position);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public DataMutateResult removeGroup(@Nonnull Group group) {
|
||||
Objects.requireNonNull(group, "group");
|
||||
return this.handle.removeGroup(ApiGroup.cast(group));
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public DataMutateResult removeGroup(@Nonnull String group) {
|
||||
Objects.requireNonNull(group, "group");
|
||||
|
@ -72,6 +72,7 @@ public final class ApiUser extends ApiPermissionHolder implements me.lucko.luckp
|
||||
return this.handle.getPrimaryGroup().getValue();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public DataMutateResult setPrimaryGroup(@Nonnull String group) {
|
||||
Objects.requireNonNull(group, "group");
|
||||
|
Loading…
Reference in New Issue
Block a user