-
Notifications
You must be signed in to change notification settings - Fork 0
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
SeriousSoftware
committed
Dec 21, 2019
1 parent
345a7b1
commit 46cbb30
Showing
5 changed files
with
26 additions
and
57 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,15 +1,17 @@ | ||
package app.model | ||
|
||
import java.util | ||
import scala.jdk.CollectionConverters._ | ||
|
||
import app.entities.User | ||
case class User(name: String, password: String) { | ||
def getName: String = name | ||
|
||
import scala.jdk.CollectionConverters._ | ||
override def toString: String = s"User{name='$name', password='$password'}" | ||
} | ||
|
||
object Model { | ||
val model: util.ArrayList[User] = new util.ArrayList() | ||
val model = collection.mutable.ArrayBuffer[User]() | ||
|
||
def add(user: User): Unit = model.add(user) | ||
def add(user: User): Unit = model.append(user) | ||
|
||
def list: util.List[String] = model.asScala.map(_.name).asJava | ||
def userList: java.util.List[String] = model.map(_.name).asJava | ||
} |
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 was deleted.
Oops, something went wrong.