From 8996f50616bf02eb0b5b53abafe7cb41271a529a Mon Sep 17 00:00:00 2001 From: Wojtek Zieba Date: Tue, 23 Jan 2024 17:53:22 +0100 Subject: [PATCH] fix: restore previous *Metadata constructors To not introduce a breaking chage --- .../parselyandroid/ParselyMetadata.java | 19 +++++++++++++++++++ .../parselyandroid/ParselyVideoMetadata.java | 17 +++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/parsely/src/main/java/com/parsely/parselyandroid/ParselyMetadata.java b/parsely/src/main/java/com/parsely/parselyandroid/ParselyMetadata.java index c90c261c..0ff048f8 100644 --- a/parsely/src/main/java/com/parsely/parselyandroid/ParselyMetadata.java +++ b/parsely/src/main/java/com/parsely/parselyandroid/ParselyMetadata.java @@ -52,6 +52,25 @@ public ParselyMetadata( this.pageType = pageType; } + public ParselyMetadata( + @Nullable ArrayList authors, + @Nullable String link, + @Nullable String section, + @Nullable ArrayList tags, + @Nullable String thumbUrl, + @Nullable String title, + @Nullable Calendar pubDate + ) { + this.authors = authors; + this.link = link; + this.section = section; + this.tags = tags; + this.thumbUrl = thumbUrl; + this.title = title; + this.pubDate = pubDate; + this.pageType = null; + } + /** * Turn this object into a Map * diff --git a/parsely/src/main/java/com/parsely/parselyandroid/ParselyVideoMetadata.java b/parsely/src/main/java/com/parsely/parselyandroid/ParselyVideoMetadata.java index 109233fe..c096d37e 100644 --- a/parsely/src/main/java/com/parsely/parselyandroid/ParselyVideoMetadata.java +++ b/parsely/src/main/java/com/parsely/parselyandroid/ParselyVideoMetadata.java @@ -44,6 +44,23 @@ public ParselyVideoMetadata( this.durationSeconds = durationSeconds; } + public ParselyVideoMetadata( + @Nullable ArrayList authors, + @NonNull String videoId, + @Nullable String section, + @Nullable ArrayList tags, + @Nullable String thumbUrl, + @Nullable String title, + @Nullable Calendar pubDate, + @NonNull int durationSeconds + ) { + super(authors, videoId, section, tags, thumbUrl, title, pubDate, null); + if (videoId == null) { + throw new NullPointerException("videoId cannot be null"); + } + this.durationSeconds = durationSeconds; + } + /** * Turn this object into a Map *