public final class InviteRequest

  1. Object
  2. InviteRequest

Describes the invite to mint. Immutable; build one with create.

InviteRequest request = InviteRequest.create()
        .campaign("spring")
        .channel("whatsapp")
        .title("Join me")
        .description("I am using this and thought of you.")
        .payload("room-42")
        .build();

title, description and imageUrl drive the preview card the link service renders, which is what makes a shared link look like an invitation in a messaging application rather than a bare address.

Builder.build validates and throws IllegalArgumentException naming the offending field, so a mistake surfaces at the call you can see rather than as a silently dropped value later.

Nested types

class InviteRequest.BuilderBuilds an InviteRequest.

Fields

public static final int MAX_PAYLOAD_LENGTH = 512The longest accepted Builder.payload.
public static final int MAX_TITLE_LENGTH = 128The longest accepted Builder.title.
public static final int MAX_DESCRIPTION_LENGTH = 256The longest accepted Builder.description.
public static final int MAX_TOKEN_LENGTH = 64The longest accepted Builder.campaign or Builder.channel.
public static final int MAX_IMAGE_URL_LENGTH = 512The longest accepted preview image address.
public static final int MAX_PARAM_KEY_LENGTH = 64The longest accepted custom parameter name.
public static final int MAX_PARAM_VALUE_LENGTH = 256The longest accepted custom parameter value.
public static final int MAX_PARAMETERS = 16The most custom parameters an invite may carry.

Methods

public static InviteRequest.Builder create()Starts building a request.
public String getCampaign()The campaign, or null.
public String getChannel()The channel, or null.
public String getPayload()The application defined payload, or null.
public String getTitle()The preview card title, or null.
public String getDescription()The preview card description, or null.
public String getImageUrl()The preview card image address, or null.
public Map<String, String> getParameters()The custom parameters carried to the invited device.

Inherited methods

Field details

MAX_PAYLOAD_LENGTH

public static final int MAX_PAYLOAD_LENGTH = 512
The longest accepted Builder.payload.

MAX_TITLE_LENGTH

public static final int MAX_TITLE_LENGTH = 128
The longest accepted Builder.title.

MAX_DESCRIPTION_LENGTH

public static final int MAX_DESCRIPTION_LENGTH = 256
The longest accepted Builder.description.

MAX_TOKEN_LENGTH

public static final int MAX_TOKEN_LENGTH = 64
The longest accepted Builder.campaign or Builder.channel.

MAX_IMAGE_URL_LENGTH

public static final int MAX_IMAGE_URL_LENGTH = 512
The longest accepted preview image address.

MAX_PARAM_KEY_LENGTH

public static final int MAX_PARAM_KEY_LENGTH = 64
The longest accepted custom parameter name.

MAX_PARAM_VALUE_LENGTH

public static final int MAX_PARAM_VALUE_LENGTH = 256
The longest accepted custom parameter value.

MAX_PARAMETERS

public static final int MAX_PARAMETERS = 16
The most custom parameters an invite may carry.

Method details

create

public static InviteRequest.Builder create()
Starts building a request.

Returns

a new builder

getCampaign

public String getCampaign()
The campaign, or null.

Returns

the campaign

getChannel

public String getChannel()
The channel, or null.

Returns

the channel

getPayload

public String getPayload()
The application defined payload, or null.

Returns

the payload

getTitle

public String getTitle()
The preview card title, or null.

Returns

the title

getDescription

public String getDescription()
The preview card description, or null.

Returns

the description

getImageUrl

public String getImageUrl()
The preview card image address, or null.

Returns

the image address

getParameters

public Map<String, String> getParameters()
The custom parameters carried to the invited device.

Returns

an unmodifiable, insertion ordered map, never null