Class Permission.Builder
java.lang.Object
eu.cloudnetservice.driver.permission.Permission.Builder
- Enclosing class:
- Permission
A builder for a Permission.
- Since:
- 4.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the new permission with all previously set options.Sets the name of this permission.potency(int potency) Sets the potency of this permission.timeOutMillis(long timeOutMillis) Sets the given milliseconds to the absolute time at which this permission should expire.timeOutMillis(@NonNull TimeUnit unit, long timeOut) Sets the given time-out to the absolute time at which this permission should expire.
-
Field Details
-
name
-
potency
private int potency -
timeOutMillis
private long timeOutMillis
-
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
name
Sets the name of this permission.- Parameters:
name- the name of the permission.- Returns:
- the same instance as used to call the method, for chaining.
- Throws:
NullPointerException- if the given name is null.
-
potency
Sets the potency of this permission.- Parameters:
potency- the potency of this permission- Returns:
- the same instance as used to call the method, for chaining.
-
timeOutMillis
Sets the given milliseconds to the absolute time at which this permission should expire.- Parameters:
timeOutMillis- the time-out for this permission.- Returns:
- the same instance as used to call the method, for chaining.
-
timeOutMillis
@NonNull public @NonNull Permission.Builder timeOutMillis(@NonNull @NonNull TimeUnit unit, long timeOut) 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:
unit- the unit of the given time out.timeOut- the time-out for this permission.- Returns:
- the same instance as used to call the method, for chaining.
- Throws:
NullPointerException- if the given unit is null.
-
build
Builds the new permission with all previously set options.- Returns:
- the new permission.
- Throws:
NullPointerException- if the name of the permission is missing.
-