congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
OrderId
Code IndexAdd Tabnine to your IDE (free)

How to use
OrderId
in
co.vaughnvernon.nanotrader.domain.model.order

Best Java code snippets using co.vaughnvernon.nanotrader.domain.model.order.OrderId (Showing top 16 results out of 315)

origin: VaughnVernon/IDDD_NYSE

public static OrderId unique() {
  return new OrderId(UUID.randomUUID().toString().toUpperCase());
}
origin: VaughnVernon/IDDD_NYSE

@Override
public int hashCode() {
  int hashCodeValue =
    + (95123 * 89)
    + this.id().hashCode();
  return hashCodeValue;
}
origin: VaughnVernon/IDDD_NYSE

public OrderId(String anId) {
  super();
  this.setId(anId);
}
origin: VaughnVernon/IDDD_NYSE

public void testPaymentTotalAmount() throws Exception {
  final Money cost = new Money("1000.00");
  final Money fee = new Money("9.99");
  Payment payment =
      new Payment(
          AccountId.unique(),
          OrderId.unique(),
          "This is a test",
          cost,
          fee,
          new Date());
  assertEquals(cost, payment.cost());
  assertEquals(fee, payment.fee());
  assertEquals(cost.addedTo(fee), payment.totalAmount());
}
origin: VaughnVernon/IDDD_NYSE

@Override
public int hashCode() {
  int hashCodeValue =
    + (45321 * 61)
    + this.accountId().hashCode()
    + this.orderId().hashCode();
  return hashCodeValue;
}
origin: VaughnVernon/IDDD_NYSE

@Override
public boolean equals(Object anObject) {
  boolean equalObjects = false;
  if (anObject != null && this.getClass() == anObject.getClass()) {
    BuyOrder typedObject = (BuyOrder) anObject;
    equalObjects =
        this.accountId().equals(typedObject.accountId()) &&
        this.orderId().equals(typedObject.orderId());
  }
  return equalObjects;
}
origin: VaughnVernon/IDDD_NYSE

public void testSaveWithOverwrite() throws Exception {
  Account account = this.accountFixture();
  this.repository.save(account);
  assertTrue(account.holdings().isEmpty());
  Account changedAccount = this.repository.accountOf(account.accountId());
  Holding holding = new Holding(
      account.accountId(),
      OrderId.unique(),
      new TickerSymbol("GOOG"),
      2,
      new Money("1490.25"),
      new Date());
  changedAccount.reconcileWith(holding);
  this.repository.save(changedAccount);
  changedAccount = this.repository.accountOf(account.accountId());
  assertFalse(changedAccount.holdings().isEmpty());
  assertEquals(1, changedAccount.holdings().size());
}
origin: VaughnVernon/IDDD_NYSE

@Override
public int hashCode() {
  int hashCodeValue =
    + (87643 * 107)
    + this.accountId().hashCode()
    + this.cost().hashCode()
    + this.description().hashCode()
    + this.fee().hashCode()
    + this.orderId().hashCode()
    + this.paidOn().hashCode();
  return hashCodeValue;
}
origin: VaughnVernon/IDDD_NYSE

@Override
public boolean equals(Object anObject) {
  boolean equalObjects = false;
  if (anObject != null && this.getClass() == anObject.getClass()) {
    Payment typedObject = (Payment) anObject;
    equalObjects =
        this.accountId().equals(typedObject.accountId()) &&
        this.cost().equals(typedObject.cost()) &&
        this.description().equals(typedObject.description()) &&
        this.fee().equals(typedObject.fee()) &&
        this.orderId().equals(typedObject.orderId()) &&
        this.paidOn().equals(typedObject.paidOn());
  }
  return equalObjects;
}
origin: VaughnVernon/IDDD_NYSE

public BuyOrder(
    AccountId anAccountId,
    Quote aQuote,
    int aQuantityOfSharesOrdered,
    Money anOrderFee) {
  super();
  this.setAccountId(anAccountId);
  this.setExecution(new PurchaseExecution(aQuantityOfSharesOrdered));
  this.setOrderId(OrderId.unique());
  this.setQuote(aQuote);
  DomainEventPublisher.instance().publish(
      new BuyOrderPlaced(
          this.accountId(),
          this.orderId(),
          this.quote(),
          this.execution().quantityOfSharesOrdered(),
          this.execution().openDate(),
          aQuote.price().multipliedBy(aQuantityOfSharesOrdered),
          anOrderFee));
}
origin: VaughnVernon/IDDD_NYSE

@Override
public boolean equals(Object anObject) {
  boolean equalObjects = false;
  if (anObject != null && this.getClass() == anObject.getClass()) {
    OrderId typedObject = (OrderId) anObject;
    equalObjects =
        this.id().equals(typedObject.id());
  }
  return equalObjects;
}
origin: VaughnVernon/IDDD_NYSE

@Override
public int hashCode() {
  int hashCodeValue =
    + (72721 * 97)
    + this.accountId().hashCode()
    + this.acquiredOn().hashCode()
    + this.numberOfShares()
    + this.orderId().hashCode()
    + this.tickerSymbol().hashCode()
    + this.totalValue().hashCode();
  return hashCodeValue;
}
origin: VaughnVernon/IDDD_NYSE

@Override
public boolean equals(Object anObject) {
  boolean equalObjects = false;
  if (anObject != null && this.getClass() == anObject.getClass()) {
    Holding typedObject = (Holding) anObject;
    equalObjects =
        this.accountId().equals(typedObject.accountId()) &&
        this.acquiredOn().equals(typedObject.acquiredOn()) &&
        this.numberOfShares() == typedObject.numberOfShares() &&
        this.orderId().equals(typedObject.orderId()) &&
        this.tickerSymbol().equals(typedObject.tickerSymbol()) &&
        this.totalValue().equals(typedObject.totalValue());
  }
  return equalObjects;
}
origin: VaughnVernon/IDDD_NYSE

@Override
public BuyOrder orderOf(OrderId anOrderId) {
  return this.orders().get(anOrderId.id());
}
origin: VaughnVernon/IDDD_NYSE

@Override
public void remove(BuyOrder aOrder) {
  this.orders().remove(aOrder.orderId().id());
}
origin: VaughnVernon/IDDD_NYSE

@Override
public void save(BuyOrder aOrder) {
  this.orders().put(aOrder.orderId().id(), aOrder);
}
co.vaughnvernon.nanotrader.domain.model.orderOrderId

Most used methods

  • unique
  • <init>
  • equals
  • hashCode
  • id
  • setId

Popular in Java

  • Creating JSON documents from java classes using gson
  • notifyDataSetChanged (ArrayAdapter)
  • getSupportFragmentManager (FragmentActivity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Join (org.hibernate.mapping)
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now