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

com.basistech.rosette.apimodel.CategoryLabel Maven / Gradle / Ivy

The newest version!
// Generated by delombok at Fri Nov 15 11:56:46 CST 2024
/*
* Copyright 2018 Basis Technology Corp.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.basistech.rosette.apimodel;

import com.basistech.rosette.annotations.JacksonMixin;

@JacksonMixin
public final class CategoryLabel {
    /**
     */
    private final String label;
    /**
     */
    private final Double confidence;
    /**
     */
    private final Double score;

    @SuppressWarnings("all")
    CategoryLabel(final String label, final Double confidence, final Double score) {
        this.label = label;
        this.confidence = confidence;
        this.score = score;
    }


    @SuppressWarnings("all")
    public static class CategoryLabelBuilder {
        @SuppressWarnings("all")
        private String label;
        @SuppressWarnings("all")
        private Double confidence;
        @SuppressWarnings("all")
        private Double score;

        @SuppressWarnings("all")
        CategoryLabelBuilder() {
        }

        /**
         * @return {@code this}.
         */
        @SuppressWarnings("all")
        public CategoryLabel.CategoryLabelBuilder label(final String label) {
            this.label = label;
            return this;
        }

        /**
         * @return {@code this}.
         */
        @SuppressWarnings("all")
        public CategoryLabel.CategoryLabelBuilder confidence(final Double confidence) {
            this.confidence = confidence;
            return this;
        }

        /**
         * @return {@code this}.
         */
        @SuppressWarnings("all")
        public CategoryLabel.CategoryLabelBuilder score(final Double score) {
            this.score = score;
            return this;
        }

        @SuppressWarnings("all")
        public CategoryLabel build() {
            return new CategoryLabel(this.label, this.confidence, this.score);
        }

        @Override
        @SuppressWarnings("all")
        public String toString() {
            return "CategoryLabel.CategoryLabelBuilder(label=" + this.label + ", confidence=" + this.confidence + ", score=" + this.score + ")";
        }
    }

    @SuppressWarnings("all")
    public static CategoryLabel.CategoryLabelBuilder builder() {
        return new CategoryLabel.CategoryLabelBuilder();
    }

    /**
     * @return the label.
     */
    @SuppressWarnings("all")
    public String getLabel() {
        return this.label;
    }

    /**
     * @return the confidence score  (0.0-1.0)
     */
    @SuppressWarnings("all")
    public Double getConfidence() {
        return this.confidence;
    }

    /**
     * @return the raw score (-INF-INF)
     */
    @SuppressWarnings("all")
    public Double getScore() {
        return this.score;
    }

    @Override
    @SuppressWarnings("all")
    public boolean equals(final Object o) {
        if (o == this) return true;
        if (!(o instanceof CategoryLabel)) return false;
        final CategoryLabel other = (CategoryLabel) o;
        final Object this$confidence = this.getConfidence();
        final Object other$confidence = other.getConfidence();
        if (this$confidence == null ? other$confidence != null : !this$confidence.equals(other$confidence)) return false;
        final Object this$score = this.getScore();
        final Object other$score = other.getScore();
        if (this$score == null ? other$score != null : !this$score.equals(other$score)) return false;
        final Object this$label = this.getLabel();
        final Object other$label = other.getLabel();
        if (this$label == null ? other$label != null : !this$label.equals(other$label)) return false;
        return true;
    }

    @Override
    @SuppressWarnings("all")
    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        final Object $confidence = this.getConfidence();
        result = result * PRIME + ($confidence == null ? 43 : $confidence.hashCode());
        final Object $score = this.getScore();
        result = result * PRIME + ($score == null ? 43 : $score.hashCode());
        final Object $label = this.getLabel();
        result = result * PRIME + ($label == null ? 43 : $label.hashCode());
        return result;
    }

    @Override
    @SuppressWarnings("all")
    public String toString() {
        return "CategoryLabel(label=" + this.getLabel() + ", confidence=" + this.getConfidence() + ", score=" + this.getScore() + ")";
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy