Class Glance

  • All Implemented Interfaces:
    API

    public class Glance
    extends Object
    implements API
    Author:
    svenkubiak
    • Constructor Detail

      • Glance

        public Glance()
    • Method Detail

      • withToken

        public Glance withToken​(String token)
        Your application's API token (required)
        Parameters:
        token - The pushover API token
        Returns:
        Glance instance
      • withUser

        public Glance withUser​(String user)
        The user/group key (not e-mail address) of your user (or you), viewable when logged into the @see pushover dashboard (required)
        Parameters:
        user - The username
        Returns:
        Glance instance
      • withDevice

        public Glance withDevice​(String device)
        Your user's device name to send the message directly to that device, rather than all of the user's devices (optional)
        Parameters:
        device - The device name
        Returns:
        Glance instance
      • withTitle

        public Glance withTitle​(String title)
        A description of the data being shown, such as "Widgets Sold"
        Parameters:
        title - the title to use
        Returns:
        Glance instance
      • withText

        public Glance withText​(String text)
        The main line of data, used on most screens
        Parameters:
        text - the text to use
        Returns:
        Glance instance
      • withSubtext

        public Glance withSubtext​(String subtext)
        A second line of data
        Parameters:
        subtext - the subtext to use
        Returns:
        Glance instance
      • withCount

        public Glance withCount​(int count)
        Shown on smaller screens; useful for simple counts
        Parameters:
        count - the count to use
        Returns:
        Glance instance
      • withPercent

        public Glance withPercent​(int percent)
        Shown on some screens as a progress bar/circle
        Parameters:
        percent - the percent to use
        Returns:
        GLance instance
      • pushAsync

        public Future<PushoverResponse> pushAsync()
        Sends a glance to pushover asynchronously
        Returns:
        PushoverResponse instance