Package org.eclipse.keyple.plugin.stub
Class StubSmartCard.Builder
java.lang.Object
org.eclipse.keyple.plugin.stub.StubSmartCard.Builder
- All Implemented Interfaces:
StubSmartCard.BuildStep
,StubSmartCard.CommandStep
,StubSmartCard.PowerOnDataStep
,StubSmartCard.ProtocolStep
,StubSmartCard.SimulatedCommandStep
- Enclosing class:
- StubSmartCard
public static class StubSmartCard.Builder
extends Object
implements StubSmartCard.PowerOnDataStep, StubSmartCard.ProtocolStep, StubSmartCard.CommandStep, StubSmartCard.BuildStep, StubSmartCard.SimulatedCommandStep
Builder class for
StubSmartCard
.- Since:
- 2.0.0
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build theStubSmartCard
withApduResponseProvider
(ApduResponseProviderSpi apduResponseProvider) Provide simulated command/response to theStubSmartCard
using a custom provider implementing ofApduResponseProviderSpi
.withPowerOnData
(byte[] powerOnData) Define simulated power-on data for theStubSmartCard
to buildwithProtocol
(String protocol) Define simulated protocol for theStubSmartCard
to buildwithSimulatedCommand
(String command, String response) Add simulated command/response to theStubSmartCard
to build.
-
Method Details
-
withSimulatedCommand
Add simulated command/response to theStubSmartCard
to build. Command and response should be hexadecimal.- Specified by:
withSimulatedCommand
in interfaceStubSmartCard.CommandStep
- Specified by:
withSimulatedCommand
in interfaceStubSmartCard.SimulatedCommandStep
- Parameters:
command
- hexadecimal command to respond to (can be a regexp to match multiple apdu)response
- hexadecimal response- Returns:
- next step of builder
- Since:
- 2.0.0
-
build
Build theStubSmartCard
- Specified by:
build
in interfaceStubSmartCard.BuildStep
- Specified by:
build
in interfaceStubSmartCard.CommandStep
- Specified by:
build
in interfaceStubSmartCard.SimulatedCommandStep
- Returns:
- new instance a StubSmartCard
- Since:
- 2.0.0
-
withPowerOnData
Define simulated power-on data for theStubSmartCard
to build- Specified by:
withPowerOnData
in interfaceStubSmartCard.PowerOnDataStep
- Parameters:
powerOnData
- (not nullable) byte of array- Returns:
- next step of builder
- Since:
- 2.0.0
-
withProtocol
Define simulated protocol for theStubSmartCard
to build- Specified by:
withProtocol
in interfaceStubSmartCard.ProtocolStep
- Parameters:
protocol
- (not nullable) protocol name- Returns:
- next step of builder
- Since:
- 2.0.0
-
withApduResponseProvider
public StubSmartCard.BuildStep withApduResponseProvider(ApduResponseProviderSpi apduResponseProvider) Provide simulated command/response to theStubSmartCard
using a custom provider implementing ofApduResponseProviderSpi
.- Specified by:
withApduResponseProvider
in interfaceStubSmartCard.CommandStep
- Parameters:
apduResponseProvider
- hexadecimal command to respond to (can be a regexp to match multiple apdu)- Returns:
- next step of builder
- Since:
- 2.1.0
-