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

com.sap.cloud.sdk.services.recastai.botresponses.SlimButton Maven / Gradle / Ivy

Go to download

Integration of SAP Conversational AI, aka Recast AI (Beta release, still subject to change - up to discontinuation of module).

There is a newer version: 2.28.0
Show newest version
/*
 * Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved.
 */

package com.sap.cloud.sdk.services.recastai.botresponses;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

import com.google.common.annotations.Beta;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;

/**
 * This is the simplest button to be sent and only allows postback type. To be used in the QuickReplies.
 */
@Beta
public class SlimButton
{
    @SerializedName( "title" )
    @Expose
    private final String title;

    @SerializedName( "value" )
    @Expose
    private final String value;

    /**
     * Function creates a new slim button
     * 
     * @param title
     *            the title to be displayed
     * @param value
     *            value which is returned when button is clicked,
     */
    public SlimButton( @Nonnull final String title, @Nonnull final String value )
    {
        this.title = title;
        this.value = value;
    }

    /**
     * Returns the title of the button.
     * 
     * @return a string representation of the title
     */
    @Nullable
    public String getTitle()
    {
        return title;
    }

    /**
     * Gets the value of the button, in case of a slim button this will be a text, but can also be an URL in other
     * instances.
     * 
     * @return string representation of the return value of the button
     */
    @Nullable
    public String getValue()
    {
        return value;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy