Class EntityFactory
- java.lang.Object
-
- club.minnced.discord.webhook.receive.EntityFactory
-
public class EntityFactory extends Object
Internal factory used to convert JSON representations into java objects.
-
-
Constructor Summary
Constructors Constructor Description EntityFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static @NotNull ReadonlyAttachmentmakeAttachment(@NotNull org.json.JSONObject json)Converts a attachment json into aReadonlyAttachmentstatic @NotNull ReadonlyEmbedmakeEmbed(@NotNull org.json.JSONObject json)Converts an embed json into aReadonlyEmbedstatic WebhookEmbed.EmbedAuthormakeEmbedAuthor(@Nullable org.json.JSONObject json)Converts an author json into aWebhookEmbed.EmbedAuthorstatic WebhookEmbed.EmbedFieldmakeEmbedField(@Nullable org.json.JSONObject json)Converts a field json into aWebhookEmbed.EmbedFieldstatic WebhookEmbed.EmbedFootermakeEmbedFooter(@Nullable org.json.JSONObject json)Converts a footer json into aWebhookEmbed.EmbedFooterstatic ReadonlyEmbed.EmbedImagemakeEmbedImage(@Nullable org.json.JSONObject json)Converts a image/thumbnail json into aReadonlyEmbed.EmbedImagestatic ReadonlyEmbed.EmbedProvidermakeEmbedProvider(@Nullable org.json.JSONObject json)Converts a provider json into aReadonlyEmbed.EmbedProviderstatic WebhookEmbed.EmbedTitlemakeEmbedTitle(@NotNull org.json.JSONObject json)Converts an embed json into aWebhookEmbed.EmbedTitlestatic ReadonlyEmbed.EmbedVideomakeEmbedVideo(@Nullable org.json.JSONObject json)Converts a video json into aReadonlyEmbed.EmbedVideostatic @NotNull ReadonlyMessagemakeMessage(@NotNull org.json.JSONObject json)Converts a message json into aReadonlyMessagestatic @NotNull ReadonlyUsermakeUser(@NotNull org.json.JSONObject json)Converts a user json into aReadonlyUser
-
-
-
Method Detail
-
makeUser
@NotNull public static @NotNull ReadonlyUser makeUser(@NotNull @NotNull org.json.JSONObject json)
Converts a user json into aReadonlyUser- Parameters:
json- The JSON representation- Returns:
ReadonlyUser
-
makeAttachment
@NotNull public static @NotNull ReadonlyAttachment makeAttachment(@NotNull @NotNull org.json.JSONObject json)
Converts a attachment json into aReadonlyAttachment- Parameters:
json- The JSON representation- Returns:
ReadonlyAttachment
-
makeEmbedField
@Nullable public static WebhookEmbed.EmbedField makeEmbedField(@Nullable @Nullable org.json.JSONObject json)
Converts a field json into aWebhookEmbed.EmbedField- Parameters:
json- The JSON representation- Returns:
WebhookEmbed.EmbedField
-
makeEmbedAuthor
@Nullable public static WebhookEmbed.EmbedAuthor makeEmbedAuthor(@Nullable @Nullable org.json.JSONObject json)
Converts an author json into aWebhookEmbed.EmbedAuthor- Parameters:
json- The JSON representation- Returns:
WebhookEmbed.EmbedAuthor
-
makeEmbedFooter
@Nullable public static WebhookEmbed.EmbedFooter makeEmbedFooter(@Nullable @Nullable org.json.JSONObject json)
Converts a footer json into aWebhookEmbed.EmbedFooter- Parameters:
json- The JSON representation- Returns:
WebhookEmbed.EmbedFooter
-
makeEmbedTitle
@Nullable public static WebhookEmbed.EmbedTitle makeEmbedTitle(@NotNull @NotNull org.json.JSONObject json)
Converts an embed json into aWebhookEmbed.EmbedTitle- Parameters:
json- The JSON representation- Returns:
WebhookEmbed.EmbedTitle
-
makeEmbedImage
@Nullable public static ReadonlyEmbed.EmbedImage makeEmbedImage(@Nullable @Nullable org.json.JSONObject json)
Converts a image/thumbnail json into aReadonlyEmbed.EmbedImage- Parameters:
json- The JSON representation- Returns:
ReadonlyEmbed.EmbedImage
-
makeEmbedProvider
@Nullable public static ReadonlyEmbed.EmbedProvider makeEmbedProvider(@Nullable @Nullable org.json.JSONObject json)
Converts a provider json into aReadonlyEmbed.EmbedProvider- Parameters:
json- The JSON representation- Returns:
ReadonlyEmbed.EmbedProvider
-
makeEmbedVideo
@Nullable public static ReadonlyEmbed.EmbedVideo makeEmbedVideo(@Nullable @Nullable org.json.JSONObject json)
Converts a video json into aReadonlyEmbed.EmbedVideo- Parameters:
json- The JSON representation- Returns:
ReadonlyEmbed.EmbedVideo
-
makeEmbed
@NotNull public static @NotNull ReadonlyEmbed makeEmbed(@NotNull @NotNull org.json.JSONObject json)
Converts an embed json into aReadonlyEmbed- Parameters:
json- The JSON representation- Returns:
ReadonlyEmbed
-
makeMessage
@NotNull public static @NotNull ReadonlyMessage makeMessage(@NotNull @NotNull org.json.JSONObject json)
Converts a message json into aReadonlyMessage- Parameters:
json- The JSON representation- Returns:
ReadonlyMessage
-
-