Class CorporationInvite
java.lang.Object
us.teaminceptus.novaconomy.api.corporation.CorporationInvite
- All Implemented Interfaces:
ConfigurationSerializable
Utility class for a Corporation Invite
-
Constructor Summary
ConstructorsConstructorDescriptionCorporationInvite(@NotNull Corporation from, @NotNull Business to) Constructs a CorporationInvite with a Date ofSystem.currentTimeMillis().CorporationInvite(@NotNull Corporation from, @NotNull Business to, @NotNull Date invited) Constructs a CorporationInvite. -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept()Accepts this invite, adding the Business to the Corporation.voiddecline()Declines this invite, removing the Business from the Corporation's invite list.static @NotNull CorporationInvitedeserialize(@NotNull Map<String, Object> serial) Deserializes a CorporationInvite from a Map.boolean@NotNull CorporationgetFrom()Fetches the Corporation that sent the invite.@NotNull DateFetches the timestamp of when the invite was sent.@NotNull BusinessgetTo()Fetches the Business that was invited.inthashCode()@NotNull StringtoString()
-
Constructor Details
-
CorporationInvite
Constructs a CorporationInvite with a Date ofSystem.currentTimeMillis().- Parameters:
from- Corporation that sent the inviteto- Business that was invited
-
CorporationInvite
public CorporationInvite(@NotNull @NotNull Corporation from, @NotNull @NotNull Business to, @NotNull @NotNull Date invited) Constructs a CorporationInvite.- Parameters:
from- Corporation that sent the inviteto- Business that was invitedinvited- Date of when the invite was sent
-
-
Method Details
-
getFrom
Fetches the Corporation that sent the invite.- Returns:
- Corporation that the invite is from
-
getTo
Fetches the Business that was invited.- Returns:
- Business that was invited
-
getInvitedTimestamp
Fetches the timestamp of when the invite was sent.- Returns:
- Date of when the invite was sent
-
accept
Accepts this invite, adding the Business to the Corporation.- Throws:
IllegalStateException- if the Business already has a parent corporation or is no longer invited
-
decline
Declines this invite, removing the Business from the Corporation's invite list.- Throws:
IllegalStateException- if the Business is no longer invited
-
toString
-
equals
-
hashCode
public int hashCode() -
deserialize
@NotNull public static @NotNull CorporationInvite deserialize(@NotNull @NotNull Map<String, Object> serial) throws IllegalArgumentExceptionDeserializes a CorporationInvite from a Map.- Parameters:
serial- Serialized CorporationInvite- Returns:
- Deserialized CorporationInvite
- Throws:
IllegalArgumentException- if the serial map is null
-
serialize
- Specified by:
serializein interfaceConfigurationSerializable
-