001// Generated by delombok at Sun Apr 14 14:59:49 CEST 2024
002/*
003 * Copyright (c) 2010-2024 Mark Allen, Norbert Bartels.
004 *
005 * Permission is hereby granted, free of charge, to any person obtaining a copy
006 * of this software and associated documentation files (the "Software"), to deal
007 * in the Software without restriction, including without limitation the rights
008 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
009 * copies of the Software, and to permit persons to whom the Software is
010 * furnished to do so, subject to the following conditions:
011 *
012 * The above copyright notice and this permission notice shall be included in
013 * all copies or substantial portions of the Software.
014 *
015 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
016 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
017 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
018 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
019 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
020 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
021 * THE SOFTWARE.
022 */
023package com.restfb.types.webhook.messaging.nlp;
024
025import com.restfb.Facebook;
026
027public abstract class BaseNlpEntity {
028  @Facebook
029  private Double confidence;
030  @Facebook
031  private String value;
032  @Facebook("_entity")
033  private String entity;
034  /**
035   * body of this entity.
036   */
037  @Facebook("_body")
038  private String body;
039  /**
040   * start position of the entity in the message
041   */
042  @Facebook("_start")
043  private Integer start;
044  /**
045   * end position of the entity in the message
046   */
047  @Facebook("_end")
048  private Integer end;
049
050  /**
051   * returns if the object contains only a nlp entity or if the nlp object contains body, start and end fields, too.
052   * @return {@code true} if the nlp object contains also body, start and end fields, {@code false} otherwise
053   */
054  public boolean isEntityOnly() {
055    return body == null;
056  }
057
058  public <T extends BaseNlpEntity> T as(Class<T> clazz) {
059    return (T) this;
060  }
061
062  @java.lang.SuppressWarnings("all")
063  public Double getConfidence() {
064    return this.confidence;
065  }
066
067  @java.lang.SuppressWarnings("all")
068  public void setConfidence(final Double confidence) {
069    this.confidence = confidence;
070  }
071
072  @java.lang.SuppressWarnings("all")
073  public String getValue() {
074    return this.value;
075  }
076
077  @java.lang.SuppressWarnings("all")
078  public void setValue(final String value) {
079    this.value = value;
080  }
081
082  @java.lang.SuppressWarnings("all")
083  public String getEntity() {
084    return this.entity;
085  }
086
087  @java.lang.SuppressWarnings("all")
088  public void setEntity(final String entity) {
089    this.entity = entity;
090  }
091
092  /**
093   * body of this entity.
094   */
095  @java.lang.SuppressWarnings("all")
096  public String getBody() {
097    return this.body;
098  }
099
100  /**
101   * body of this entity.
102   */
103  @java.lang.SuppressWarnings("all")
104  public void setBody(final String body) {
105    this.body = body;
106  }
107
108  /**
109   * start position of the entity in the message
110   */
111  @java.lang.SuppressWarnings("all")
112  public Integer getStart() {
113    return this.start;
114  }
115
116  /**
117   * start position of the entity in the message
118   */
119  @java.lang.SuppressWarnings("all")
120  public void setStart(final Integer start) {
121    this.start = start;
122  }
123
124  /**
125   * end position of the entity in the message
126   */
127  @java.lang.SuppressWarnings("all")
128  public Integer getEnd() {
129    return this.end;
130  }
131
132  /**
133   * end position of the entity in the message
134   */
135  @java.lang.SuppressWarnings("all")
136  public void setEnd(final Integer end) {
137    this.end = end;
138  }
139}