package com.alterdekim.hearthhack.xml;

import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlText;
import lombok.*;

@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class XMLTag {
    @JacksonXmlProperty(isAttribute = true)
    private Integer enumID;
    @JacksonXmlProperty(isAttribute = true)
    private String type;
    @JacksonXmlProperty(isAttribute = true)
    private Integer value;
    @JacksonXmlText
    private String val;

    public String getRawValue() {
        return val != null ? val : String.valueOf(value);
    }
}
