Class DiscoveredPrinter

Object
com.zebra.sdk.printer.discovery.DiscoveredPrinter
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
DiscoveredPrinterDriver, DiscoveredPrinterNetwork, DiscoveredUsbPrinter

public abstract class DiscoveredPrinter extends Object implements Serializable
Container holding information about a discovered printer.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final String
    MAC address, IP Address, or local name of printer.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an object holding information about a discovered printer.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns true if two discovered printer objects have the same address, otherwise it returns false.
    abstract Connection
    Creates a connection based on the information in the DiscoveredPrinter response.
    This method will return a Map of all settings obtained via the chosen discovery method.
    int
    Returns a hash code for this DiscoveredPrinter.
    For TCP, this returns the IP Address.
    For driver, this returns the local printer name.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • address

      public final String address
      MAC address, IP Address, or local name of printer.
  • Constructor Details

    • DiscoveredPrinter

      public DiscoveredPrinter(String address)
      Creates an object holding information about a discovered printer.
      Parameters:
      address - MAC address, IP Address, or local name of printer.
  • Method Details

    • getConnection

      public abstract Connection getConnection()
      Creates a connection based on the information in the DiscoveredPrinter response.
      Returns:
      a Connection to the discovered printer
    • toString

      public String toString()
      For TCP, this returns the IP Address.
      For driver, this returns the local printer name.
      Overrides:
      toString in class Object
      See Also:
    • getDiscoveryDataMap

      public Map<String,String> getDiscoveryDataMap()
      This method will return a Map of all settings obtained via the chosen discovery method.
      The names of the settings will vary depending upon the type of connection to the printer. The following example shows how to list all the properties of the discovered printer with the respective value.
       for (String settingsKey : printer.getDiscoveryDataMap().keySet()) {
           System.out.println("Key: " + settingsKey + " Value: " + printer.getDiscoveryDataMap().get(settingsKey));
       }
       
      Returns:
      Map<String, String> containing available attributes of the discovered printer.
    • equals

      public boolean equals(Object o)
      Returns true if two discovered printer objects have the same address, otherwise it returns false.
      Overrides:
      equals in class Object
      Parameters:
      o - DiscoveredPrinter object to compare against.
      See Also:
    • hashCode

      public int hashCode()
      Returns a hash code for this DiscoveredPrinter.
      Overrides:
      hashCode in class Object
      See Also: