-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
85 additions
and
54 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,22 @@ | ||
package ba.sake.formson | ||
|
||
import java.nio.file.Path | ||
import scala.collection.immutable.SeqMap | ||
|
||
enum FormValue(val tpe: String) { | ||
case Str(value: String) extends FormValue("simple value") | ||
case File(value: Path) extends FormValue("file") | ||
case ByteArray(value: Array[Byte]) extends FormValue("byte array") | ||
} | ||
|
||
/** Represents a raw form data map. Values are not encoded. | ||
/** Represents a raw form data map. Keys are ordered by insertion order. Values are not encoded. | ||
*/ | ||
type FormDataMap = Map[String, Seq[FormValue]] | ||
type FormDataMap = SeqMap[String, Seq[FormValue]] | ||
|
||
enum FormData(val tpe: String): | ||
|
||
case Simple(value: FormValue) extends FormData("simple value") | ||
|
||
case Sequence(values: Seq[FormData]) extends FormData("sequence") | ||
|
||
case Obj(values: Map[String, FormData]) extends FormData("object") | ||
case Obj(values: SeqMap[String, FormData]) extends FormData("object") |
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
Oops, something went wrong.