Class Corporation.Builder
java.lang.Object
us.teaminceptus.novaconomy.api.corporation.Corporation.Builder
- Enclosing class:
- Corporation
Builder class used to create Corporations
-
Method Summary
Modifier and TypeMethodDescription@NotNull Corporationbuild()Builds the Corporation.Sets the icon of the Corporation.Sets the name of the Corporation.setOwner(@NotNull OfflinePlayer owner) Sets the owner of the Corporation.
-
Method Details
-
setName
Sets the name of the Corporation.- Parameters:
name- Corporation Name- Returns:
- this class, for chaining
- Throws:
IllegalArgumentException- if name is null or longer thanCorporation.MAX_NAME_LENGTH
-
setOwner
public Corporation.Builder setOwner(@NotNull @NotNull OfflinePlayer owner) throws IllegalArgumentException Sets the owner of the Corporation.- Parameters:
owner- Corporation Owner- Returns:
- this class, for chaining
- Throws:
IllegalArgumentException- if owner is null
-
setIcon
Sets the icon of the Corporation.- Parameters:
icon- Corporation Icon- Returns:
- this class, for chaining
- Throws:
IllegalArgumentException- if icon is null
-
build
@NotNull public @NotNull Corporation build() throws IllegalStateException, UnsupportedOperationExceptionBuilds the Corporation.- Returns:
- New Corporation
- Throws:
IllegalStateException- if one or more arguments is nullUnsupportedOperationException- if corporation with name already exists
-