This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface BestQuotationSearchService { | |
public Double findBestQuotation(Double loanAmount); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package fr.ddd.ch3.banking | |
import scalaz._ | |
import scala.util.Try | |
import java.util.Date | |
import scala.util.Failure | |
import scala.util.Success | |
import org.joda.time.DateTime._ | |
import scala.collection.mutable.Map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait AccountService { | |
type Valid[A] = OptionT[Future, A] | |
type AccountOperation[A] = Kleisli[Valid, AccountRepository, A] | |
def debit(no: String, amount: Amount): AccountOperation[Account] = ??? | |
def credit(no: String, amount: Amount): AccountOperation[Account] = ??? | |
def transfer(from: String, to: String, amount: Amount) : AccountOperation[(Account,Account)] = for { | |
debitAcc <- debit(from, amount) | |
creditAcc <- credit(to, amount) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait AccountService { | |
def debit(no: String, amount: Amount): Kleisli[Future,AccountRepository, Account] = ??? | |
def credit(no: String, amount: Amount): ReaderT[Future,AccountRepository, Account] = ??? | |
def transfer(from: String, to: String, amount: Amount) : ReaderT[Future,AccountRepository, (Account,Account)] = for { | |
debitAcc <- debit(from, amount) | |
creditAcc <- credit(to, amount) | |
} yield (debitAcc, creditAcc) // If you do not use ReaderT/Kleisli here then you need extra mapping to extract accounts from Future | |
} | |
object AccountService extends AccountService |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package crossover; | |
import org.eclipse.jgit.api.DiffCommand; | |
import org.eclipse.jgit.api.Git; | |
import org.eclipse.jgit.diff.*; | |
import org.eclipse.jgit.internal.storage.file.FileRepository; | |
import org.eclipse.jgit.lib.ObjectId; | |
import org.eclipse.jgit.lib.ObjectReader; | |
import org.eclipse.jgit.lib.Repository; | |
import org.eclipse.jgit.revwalk.RevCommit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package crossover; | |
import org.eclipse.jgit.api.Git; | |
import org.eclipse.jgit.lib.Repository; | |
import org.eclipse.jgit.revwalk.RevCommit; | |
import org.eclipse.jgit.storage.file.FileRepositoryBuilder; | |
import java.io.File; | |
import java.util.Date; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package crossover; | |
import org.eclipse.jgit.api.Git; | |
import org.eclipse.jgit.diff.*; | |
import org.eclipse.jgit.internal.storage.file.FileRepository; | |
import org.eclipse.jgit.lib.ObjectId; | |
import org.eclipse.jgit.lib.ObjectReader; | |
import org.eclipse.jgit.lib.Repository; | |
import org.eclipse.jgit.treewalk.CanonicalTreeParser; | |
import org.eclipse.jgit.treewalk.filter.PathFilter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package crossover; | |
import org.eclipse.jgit.api.Git; | |
import org.eclipse.jgit.diff.*; | |
import org.eclipse.jgit.internal.storage.file.FileRepository; | |
import org.eclipse.jgit.lib.ObjectId; | |
import org.eclipse.jgit.lib.ObjectReader; | |
import org.eclipse.jgit.lib.Repository; | |
import org.eclipse.jgit.treewalk.CanonicalTreeParser; | |
import java.util.List; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package crossover; | |
import java.io.Serializable; | |
import java.util.Collection; | |
import java.util.Date; | |
import java.util.List; | |
import java.util.concurrent.Future; | |
/** | |
* Created by Noor on 3/26/17. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package crossover; | |
import org.tmatesoft.svn.core.SVNProperties; | |
import org.tmatesoft.svn.core.SVNURL; | |
import org.tmatesoft.svn.core.auth.ISVNAuthenticationManager; | |
import org.tmatesoft.svn.core.internal.io.dav.DAVRepositoryFactory; | |
import org.tmatesoft.svn.core.io.SVNRepository; | |
import org.tmatesoft.svn.core.io.SVNRepositoryFactory; | |
import org.tmatesoft.svn.core.wc.SVNWCUtil; | |
import java.io.ByteArrayOutputStream; |
OlderNewer