Class PermissionUserGroupInfo.Builder
java.lang.Object
eu.cloudnetservice.driver.permission.PermissionUserGroupInfo.Builder
- Enclosing class:
- PermissionUserGroupInfo
A builder for permission user group infos.
- Since:
- 4.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Constructs the new permission user group info from this builder.Sets the group of this group info.properties(@NonNull Document properties) Sets the properties of the new permission user.Sets the given time-out to the absolute time at which this permission should expire.Sets the time-out for this group info.timeOutMillis(long timeOutMillis) Sets the given milliseconds to the absolute time at which this permission should expire.
-
Field Details
-
group
-
timeOutMillis
private long timeOutMillis -
properties
-
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
group
Sets the group of this group info.- Parameters:
group- the name of the group info.- Returns:
- the same instance as used to call the method, for chaining.
- Throws:
NullPointerException- if the given group is null.
-
timeOutMillis
Sets the given milliseconds to the absolute time at which this permission should expire.- Parameters:
timeOutMillis- the time-out for this user group.- Returns:
- the same instance as used to call the method, for chaining.
-
timeOut
@NonNull public @NonNull PermissionUserGroupInfo.Builder timeOut(long timeout, @NonNull @NonNull TimeUnit unit) Sets the given time-out to the absolute time at which this permission should expire. The time-out is added to the current time millisSystem.currentTimeMillis().- Parameters:
timeout- the time-out for this group info.unit- the unit of the given time out.- Returns:
- the same instance as used to call the method, for chaining.
- Throws:
NullPointerException- if the given unit is null.
-
timeOut
@NonNull public @NonNull PermissionUserGroupInfo.Builder timeOut(@NonNull @NonNull Duration duration) Sets the time-out for this group info. The time-out is added to the current time millisSystem.currentTimeMillis().- Parameters:
duration- the duration the group lasts for.- Returns:
- the same instance as used to call the method, for chaining.
- Throws:
NullPointerException- if the given duration is null.
-
properties
@NonNull public @NonNull PermissionUserGroupInfo.Builder properties(@NonNull @NonNull Document properties) Sets the properties of the new permission user.- Parameters:
properties- the properties for the new user.- Returns:
- the same instance as used to call the method, for chaining.
- Throws:
NullPointerException- if the given properties are null.
-
build
Constructs the new permission user group info from this builder.- Returns:
- the new user group info.
- Throws:
NullPointerException- if the group name is missing.
-