-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integer dictionary support in fragment inputs (#7341)
- Loading branch information
1 parent
659bc73
commit a8e0a79
Showing
7 changed files
with
53 additions
and
9 deletions.
There are no files selected for viewing
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
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
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
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
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
23 changes: 23 additions & 0 deletions
23
.../src/main/scala/pl/touk/nussknacker/engine/management/sample/dict/IntegerDictionary.scala
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package pl.touk.nussknacker.engine.management.sample.dict | ||
|
||
import pl.touk.nussknacker.engine.api.dict.embedded.EmbeddedDictDefinition | ||
import pl.touk.nussknacker.engine.api.dict.{DictDefinition, DictInstance, ReturningKeyWithoutTransformation} | ||
import pl.touk.nussknacker.engine.api.typed.typing | ||
import pl.touk.nussknacker.engine.api.typed.typing.Typed | ||
|
||
object IntegerDictionary { | ||
val id: String = "integer_dict" | ||
|
||
val definition: DictDefinition = new EmbeddedDictDefinition with ReturningKeyWithoutTransformation { | ||
override def valueType(dictId: String): typing.SingleTypingResult = Typed.typedClass[java.lang.Integer] | ||
|
||
override def labelByKey: Map[String, String] = Map( | ||
"-2147483648" -> "large (negative) number", | ||
"42" -> "small number", | ||
"2147483647" -> "big number" | ||
) | ||
|
||
} | ||
|
||
val instance: DictInstance = DictInstance(id, definition) | ||
} |
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