Class PositionCreationResultDTO

java.lang.Object
tech.cassandre.trading.bot.dto.position.PositionCreationResultDTO

public final class PositionCreationResultDTO extends Object
Position creation result for PositionDTO. If successful (isSuccessful() == true), you can get the position with getPosition(). if not successful (isSuccessful() == false), you can get: - The error message with getErrorMessage(). - The exception causing the error with getException().
  • Constructor Details

    • PositionCreationResultDTO

      public PositionCreationResultDTO(PositionDTO newPosition)
      Constructor for successful position creation.
      Parameters:
      newPosition - position
    • PositionCreationResultDTO

      public PositionCreationResultDTO(String newErrorMessage, Exception newException)
      Constructor for unsuccessful position creation.
      Parameters:
      newErrorMessage - error message
      newException - exception
  • Method Details

    • isSuccessful

      public boolean isSuccessful()
      Getter successful.
      Returns:
      successful
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getPosition

      public PositionDTO getPosition()
      Position (filled if position is successful).
    • getErrorMessage

      public String getErrorMessage()
      Error message (filled if position creation failed).
    • getException

      public Exception getException()
      Exception (filled if position creation failed).