This file contains hidden or 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
interface Article{ | |
fun applyTo(consumer: ArticleConsumer) | |
} | |
class ItaArticle(val itaData1: String, val itaData2: Int) : Article { | |
override fun applyTo(consumer: ArticleConsumer) { | |
consumer.use(this) | |
} | |
} |
This file contains hidden or 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
sealed trait Article | |
case class ItaArticle(id: Int, itaData1: String, itaData2: Int) extends Article | |
case class DeuArticle(id: Int, deuData1: Int, deuData2: Int) extends Article | |
case class EspArticle(id: Int, espData1: Float, espData2: String) extends Article | |
case class ArticleNotFound() extends Article |
This file contains hidden or 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
def doSomething(article: Article) : Unit = { | |
article match { | |
case ita: ItaArticle => print(ita.itaData1) | |
case deu: DeuArticle => print(deu.deuData2) | |
case spa: SpaArticle => print(spa.spaData3) | |
case nf: ArticleNotFound => print("None") | |
} | |
} |
This file contains hidden or 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
def doSomething(article: Article) : Unit = { | |
article match { | |
case ita: ItaArticle => print(ita.itaData1) | |
case deu: DeuArticle => print(deu.deuData2) | |
} | |
} |
This file contains hidden or 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
def doSomething(article: Article) : Unit = { | |
article match { | |
case ita: ItaArticle => print(ita.itaData1) | |
case deu: DeuArticle => print(deu.deuData2) | |
case nf: ArticleNotFound => print("None") | |
} | |
} |
This file contains hidden or 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
sealed trait Article | |
case class ItaArticle(id: Int, itaData1: String, itaData2: Int) extends Article | |
case class DeuArticle(id: Int, deuData1: Int, deuData2: Int) extends Article | |
case class ArticleNotFound() extends Article |
This file contains hidden or 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
{ | |
"openapi": "3.0.0", | |
"info": { | |
"title": "POS API", | |
"version": "1" | |
}, | |
"servers": [ | |
{ | |
"url": "http://api/drug/{version}", | |
"variables": { |
This file contains hidden or 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
#%RAML 1.0 | |
title: g3 Point of sale API | |
version: v1 | |
baseUri: api/{version} | |
types: | |
ResourceCreated: | |
type: object | |
description: The kind of information returned when a new resource is created | |
properties: |
This file contains hidden or 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
<plugin> | |
<groupId>org.raml.jaxrs</groupId> | |
<artifactId>raml-to-jaxrs-maven-plugin</artifactId> | |
<version>3.0.4</version> | |
<dependencies> | |
<dependency> | |
<groupId>org.raml.jaxrs</groupId> | |
<artifactId>jaxrs-code-generator</artifactId> | |
<version>3.0.4</version> | |
</dependency> |
This file contains hidden or 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
... | |
[Theory] | |
[InlineData("1-1,1-1,1-1,1-1,1-1,1-1,1-1,1-1,1-1,1-1", "2,2,2,2,2,2,2,2,2,2", "20")] // All open frames | |
[InlineData("10,10,10,10,10,10,10,10,10,10-10-10", "30,30,30,30,30,30,30,30,30,30", "300")] // All strikes | |
... |