public class HardwareWalletSpecification extends Object
Specification to provide the following to HardwareWallets:
| Constructor and Description |
|---|
HardwareWalletSpecification(Class hardwareWalletClass)
Static binding
|
HardwareWalletSpecification(String className)
Constructor for dynamic binding
|
| Modifier and Type | Method and Description |
|---|---|
String |
getClassName() |
String |
getDescription() |
String |
getHost()
Get the host name of the server providing socket access to the device (e.g.
|
String |
getName() |
Object |
getParameter(String key) |
int |
getPort()
Get the port number of the server providing direct socket data (e.g.
|
com.google.common.base.Optional<Integer> |
getProductId() |
com.google.common.base.Optional<String> |
getSerialNumber() |
com.google.common.base.Optional<Integer> |
getVendorId() |
boolean |
isUsb() |
static <T extends HardwareWallet> |
newSocketSpecification(Class<T> hardwareWalletClass,
String host,
int port)
Builder for hardware wallets communicating over sockets using static binding
|
static HardwareWalletSpecification |
newSocketSpecification(String className,
String host,
int port)
Builder for hardware wallets communicating over sockets using dynamic binding
|
static <T extends HardwareWallet> |
newUsbSpecification(Class<T> hardwareWalletClass,
com.google.common.base.Optional<Integer> vendorId,
com.google.common.base.Optional<Integer> productId,
com.google.common.base.Optional<String> serialNumber)
Builder for hardware wallets communicating over USB HID using static binding
|
static HardwareWalletSpecification |
newUsbSpecification(String className,
com.google.common.base.Optional<Integer> vendorId,
com.google.common.base.Optional<Integer> productId,
com.google.common.base.Optional<String> serialNumber)
Builder for hardware wallets communicating over USB HID using dynamic binding
|
void |
setDescription(String description) |
void |
setHost(String host)
Set the host name of the server providing socket access to the device
|
void |
setName(String name) |
void |
setPort(int port)
Set the port number of the server providing direct socket data (e.g.
|
void |
setProductId(com.google.common.base.Optional<Integer> productId) |
void |
setSerialNumber(com.google.common.base.Optional<String> serialNumber) |
void |
setSpecificParameters(Map<String,Object> specificParameters) |
void |
setUsb(boolean isUsb) |
void |
setVendorId(com.google.common.base.Optional<Integer> vendorId) |
public HardwareWalletSpecification(String className)
Constructor for dynamic binding
className - The hardware wallet class name (e.g. "org.example.hw.ExampleHardwareWallet")public HardwareWalletSpecification(Class hardwareWalletClass)
hardwareWalletClass - The hardware wallet classpublic static HardwareWalletSpecification newSocketSpecification(String className, String host, int port)
Builder for hardware wallets communicating over sockets using dynamic binding
className - The hardware wallet class name (e.g. "org.example.hw.ExampleSocketHardwareWallet")host - The host nameport - The port numberpublic static <T extends HardwareWallet> HardwareWalletSpecification newSocketSpecification(Class<T> hardwareWalletClass, String host, int port)
Builder for hardware wallets communicating over sockets using static binding
hardwareWalletClass - The hardware wallet classhost - The host nameport - The port numberpublic static HardwareWalletSpecification newUsbSpecification(String className, com.google.common.base.Optional<Integer> vendorId, com.google.common.base.Optional<Integer> productId, com.google.common.base.Optional<String> serialNumber)
Builder for hardware wallets communicating over USB HID using dynamic binding
className - The class name of the HardwareWallet implemention (e.g. "org.example.hw.ExampleUsbHardwareWallet")vendorId - The vendor ID (uses default if absent)productId - The product ID (uses default if absent)serialNumber - The device serial number (accepts any if absent)public static <T extends HardwareWallet> HardwareWalletSpecification newUsbSpecification(Class<T> hardwareWalletClass, com.google.common.base.Optional<Integer> vendorId, com.google.common.base.Optional<Integer> productId, com.google.common.base.Optional<String> serialNumber)
Builder for hardware wallets communicating over USB HID using static binding
hardwareWalletClass - The hardware wallet classvendorId - The vendor ID (uses default if absent)productId - The product ID (uses default if absent)serialNumber - The device serial number (accepts any if absent)public String getClassName()
public Object getParameter(String key)
key - The key into the parameter map (recommend using the provided standard static entries)public void setSpecificParameters(Map<String,Object> specificParameters)
specificParameters - The map of hardware wallet specific parameterspublic boolean isUsb()
public void setUsb(boolean isUsb)
isUsb - True for USB hardwarepublic com.google.common.base.Optional<Integer> getVendorId()
public void setVendorId(com.google.common.base.Optional<Integer> vendorId)
vendorId - The USB vendor ID. If absent then the device-specific default is used.public com.google.common.base.Optional<Integer> getProductId()
public void setProductId(com.google.common.base.Optional<Integer> productId)
productId - The USB product ID. If absent then the device-specific default is used.public com.google.common.base.Optional<String> getSerialNumber()
public void setSerialNumber(com.google.common.base.Optional<String> serialNumber)
serialNumber - The USB serial number. If absent then any serial number will be accepted.public String getHost()
public void setHost(String host)
host - The host namepublic int getPort()
public void setPort(int port)
port - The port numberpublic String getName()
public void setName(String name)
name - The hardware wallet name (may be presented to the user)public String getDescription()
public void setDescription(String description)
description - the hardwareWallet descriptionCopyright © 2013–2016 Bitcoin Solutions Ltd. All rights reserved.