All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.mstream.trader.datafeed.stocks.StocksRepository Maven / Gradle / Ivy

The newest version!
package io.mstream.trader.datafeed.stocks;


import io.mstream.trader.commons.utils.repository.SingleRepository;
import org.joda.money.Money;

import java.time.LocalDate;


public interface StocksRepository
        extends SingleRepository {
    
    class Key {
        
        private final Stock stock;
        
        private final LocalDate date;
        
        public Key(Stock stock, LocalDate date) {
            
            this.stock = stock;
            this.date = date;
        }
        
        @Override
        public int hashCode() {
            
            int result = stock != null ?
                    stock.hashCode() :
                    0;
            result = 31 * result + (date != null ?
                    date.hashCode() :
                    0);
            return result;
        }
        
        @Override
        public boolean equals(Object o) {
            
            if (this == o) { return true; }
            if (o == null || getClass() != o.getClass()) { return false; }
            
            Key key = (Key) o;
            
            if (stock != null ?
                    !stock.equals(key.stock) :
                    key.stock != null) { return false; }
            return date != null ?
                    date.equals(key.date) :
                    key.date == null;
            
        }
        
        public Stock getStock() {
            
            return stock;
        }
        
        public LocalDate getDate() {
            
            return date;
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy