All Downloads are FREE. Search and download functionalities are using the official Maven repository.

tw.yukina.notion.sdk.model.common.rich.mention.PageMention Maven / Gradle / Ivy

There is a newer version: 1.0.1
Show newest version
package tw.yukina.notion.sdk.model.common.rich.mention;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import lombok.*;
import org.jetbrains.annotations.NotNull;
import tw.yukina.notion.sdk.model.common.unit.PageUnit;

@Getter
@Setter
@ToString
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@JsonIgnoreProperties(ignoreUnknown = true)
@JsonDeserialize(using = JsonDeserializer.None.class)
public class PageMention extends Mention {
    private static final String PAGE_FIELD = "page";

    private PageUnit page;

    @NotNull
    public static PageMention of(String pageId){
        PageUnit page = new PageUnit();
        page.setPageId(pageId);
        PageMention pageMention = new PageMention();
        pageMention.setMentionType(MentionType.PAGE);
        pageMention.setPage(page);
        return pageMention;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy