Enum ExchangeFactory

java.lang.Object
java.lang.Enum<ExchangeFactory>
org.knowm.xchange.ExchangeFactory
All Implemented Interfaces:
Serializable, Comparable<ExchangeFactory>, java.lang.constant.Constable

public enum ExchangeFactory
extends Enum<ExchangeFactory>
Factory to provide the following to Exchange:
  • Manages the creation of specific Exchange implementations using runtime dependencies
  • Enum Constant Details

  • Method Details

    • values

      public static ExchangeFactory[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static ExchangeFactory valueOf​(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • createExchange

      public Exchange createExchange​(String exchangeClassName)
      Create an Exchange object with default ExchangeSpecification

      The factory is parameterized with the name of the exchange implementation class. This must be a class extending Exchange.

      Parameters:
      exchangeClassName - the fully-qualified class name of the exchange
      Returns:
      a new exchange instance configured with the default ExchangeSpecification
    • createExchange

      public <T extends Exchange> T createExchange​(Class<T> exchangeClass)
      Create an Exchange object with default ExchangeSpecification

      The factory is parameterized with the name of the exchange implementation class. This must be a class extending Exchange.

      Parameters:
      exchangeClass - the class of the exchange
      Returns:
      a new exchange instance configured with the default ExchangeSpecification
    • createExchange

      public Exchange createExchange​(String exchangeClassName, String apiKey, String secretKey)
      Create an Exchange object with default ExchangeSpecification with authentication info and API keys provided through parameters

      The factory is parameterized with the name of the exchange implementation class. This must be a class extending Exchange.

      Parameters:
      exchangeClassName - the fully-qualified class name of the exchange
      apiKey - the public API key
      secretKey - the secret API key
      Returns:
      a new exchange instance configured with the default ExchangeSpecification
    • createExchange

      public <T extends Exchange> T createExchange​(Class<T> exchangeClass, String apiKey, String secretKey)
      Create an Exchange object with default ExchangeSpecification with authentication info and API keys provided through parameters

      The factory is parameterized with the name of the exchange implementation class. This must be a class extending Exchange.

      Parameters:
      exchangeClass - the class of the exchange
      apiKey - the public API key
      secretKey - the secret API key
      Returns:
      a new exchange instance configured with the default ExchangeSpecification
    • createExchange

      public Exchange createExchange​(ExchangeSpecification exchangeSpecification)
      Create an Exchange object default ExchangeSpecification
      Parameters:
      exchangeSpecification - the exchange specification
      Returns:
      a new exchange instance configured with the provided ExchangeSpecification
    • createExchangeWithoutSpecification

      public Exchange createExchangeWithoutSpecification​(String exchangeClassName)
      Create an Exchange object without default ExchangeSpecification

      The factory is parameterized with the name of the exchange implementation class. This must be a class extending Exchange.

      Parameters:
      exchangeClassName - the fully-qualified class name of the exchange
      Returns:
      a new exchange instance configured with the default ExchangeSpecification
    • createExchangeWithoutSpecification

      public <T extends Exchange> T createExchangeWithoutSpecification​(Class<T> exchangeClass)
      Create an Exchange object without default ExchangeSpecification

      The factory is parameterized with the name of the exchange implementation class. This must be a class extending Exchange.

      Parameters:
      exchangeClass - the class of the exchange
      Returns:
      a new exchange instance configured with the default ExchangeSpecification