Class InviteRequest

java.lang.Object
com.codename1.analytics.invite.InviteRequest

public final class InviteRequest extends Object

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.

InviteRequest.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.

  • Field Details

    • MAX_PAYLOAD_LENGTH

      public static final int MAX_PAYLOAD_LENGTH
      The longest accepted InviteRequest.Builder.payload.
      See Also:
    • MAX_TITLE_LENGTH

      public static final int MAX_TITLE_LENGTH
      The longest accepted InviteRequest.Builder.title.
      See Also:
    • MAX_DESCRIPTION_LENGTH

      public static final int MAX_DESCRIPTION_LENGTH
      The longest accepted InviteRequest.Builder.description.
      See Also:
    • MAX_TOKEN_LENGTH

      public static final int MAX_TOKEN_LENGTH
      The longest accepted InviteRequest.Builder.campaign or InviteRequest.Builder.channel.
      See Also:
  • 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