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 ReadonlyAttachment
makeAttachment(@NotNull org.json.JSONObject json)
Converts a attachment json into aReadonlyAttachment
static @NotNull ReadonlyEmbed
makeEmbed(@NotNull org.json.JSONObject json)
Converts an embed json into aReadonlyEmbed
static WebhookEmbed.EmbedAuthor
makeEmbedAuthor(@Nullable org.json.JSONObject json)
Converts an author json into aWebhookEmbed.EmbedAuthor
static WebhookEmbed.EmbedField
makeEmbedField(@Nullable org.json.JSONObject json)
Converts a field json into aWebhookEmbed.EmbedField
static WebhookEmbed.EmbedFooter
makeEmbedFooter(@Nullable org.json.JSONObject json)
Converts a footer json into aWebhookEmbed.EmbedFooter
static ReadonlyEmbed.EmbedImage
makeEmbedImage(@Nullable org.json.JSONObject json)
Converts a image/thumbnail json into aReadonlyEmbed.EmbedImage
static ReadonlyEmbed.EmbedProvider
makeEmbedProvider(@Nullable org.json.JSONObject json)
Converts a provider json into aReadonlyEmbed.EmbedProvider
static WebhookEmbed.EmbedTitle
makeEmbedTitle(@NotNull org.json.JSONObject json)
Converts an embed json into aWebhookEmbed.EmbedTitle
static ReadonlyEmbed.EmbedVideo
makeEmbedVideo(@Nullable org.json.JSONObject json)
Converts a video json into aReadonlyEmbed.EmbedVideo
static @NotNull ReadonlyMessage
makeMessage(@NotNull org.json.JSONObject json)
Converts a message json into aReadonlyMessage
static @NotNull ReadonlyUser
makeUser(@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
-
-