package com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes;

import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.NodeType;
import com.knecon.fforesight.service.layoutparser.processor.model.graph.textblock.TextBlock;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.FieldDefaults;
import lombok.experimental.SuperBuilder;

@Data
@SuperBuilder
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@FieldDefaults(level = AccessLevel.PRIVATE)
public class Headline extends AbstractSemanticNode {

    TextBlock leafTextBlock;


    @Override
    public NodeType getType() {

        return NodeType.HEADLINE;
    }


    @Override
    public boolean isLeaf() {

        return true;
    }


    @Override
    public TextBlock getTextBlock() {

        return leafTextBlock;
    }


    @Override
    public String toString() {

        return getTreeId() + ": " + NodeType.HEADLINE + ": " + leafTextBlock.buildSummary();
    }


    @Override
    public Headline getHeadline() {

        return this;
    }

}
