Minor: use Map.of()

Signed-off-by: hrj <harshad.rj@gmail.com>
This commit is contained in:
hrj
2021-04-14 09:38:02 +05:30
parent 321bc67897
commit d3a2c6fa35
6 changed files with 36 additions and 48 deletions

View File

@@ -7,7 +7,6 @@ import java.awt.Font
import java.awt.Color
import lc.captchas.interfaces.ChallengeProvider
import lc.captchas.interfaces.Challenge
import scala.jdk.CollectionConverters.MapHasAsJava
import java.util.{List => JavaList, Map => JavaMap}
class FilterChallenge extends ChallengeProvider {
@@ -18,13 +17,11 @@ class FilterChallenge extends ChallengeProvider {
}
def supportedParameters(): JavaMap[String, JavaList[String]] = {
val supportedParams = Map(
"supportedLevels" -> JavaList.of("medium", "hard"),
"supportedMedia" -> JavaList.of("image/png"),
"supportedInputType" -> JavaList.of("text")
).asJava
supportedParams
JavaMap.of(
"supportedLevels",JavaList.of("medium", "hard"),
"supportedMedia", JavaList.of("image/png"),
"supportedInputType", JavaList.of("text")
)
}
def returnChallenge(): Challenge = {

View File

@@ -9,7 +9,6 @@ import java.awt.image.BufferedImage
import java.awt.Color
import lc.captchas.interfaces.ChallengeProvider
import lc.captchas.interfaces.Challenge
import scala.jdk.CollectionConverters.MapHasAsJava
import java.util.{List => JavaList, Map => JavaMap}
class LabelCaptcha extends ChallengeProvider {
@@ -30,13 +29,11 @@ class LabelCaptcha extends ChallengeProvider {
}
def supportedParameters(): JavaMap[String, JavaList[String]] = {
val supportedParams = Map(
"supportedLevels" -> JavaList.of("hard"),
"supportedMedia" -> JavaList.of("image/png"),
"supportedInputType" -> JavaList.of("text")
).asJava
supportedParams
JavaMap.of(
"supportedLevels", JavaList.of("hard"),
"supportedMedia", JavaList.of("image/png"),
"supportedInputType", JavaList.of("text")
)
}
def returnChallenge(): Challenge =

View File

@@ -10,7 +10,6 @@ import javax.imageio.stream.MemoryCacheImageOutputStream;
import lc.captchas.interfaces.ChallengeProvider
import lc.captchas.interfaces.Challenge
import lc.misc.GifSequenceWriter
import scala.jdk.CollectionConverters.MapHasAsJava
import java.util.{List => JavaList, Map => JavaMap}
class Drop {
@@ -38,13 +37,11 @@ class RainDropsCP extends ChallengeProvider {
}
def supportedParameters(): JavaMap[String, JavaList[String]] = {
val supportedParams = Map(
"supportedLevels" -> JavaList.of("medium", "easy"),
"supportedMedia" -> JavaList.of("image/gif"),
"supportedInputType" -> JavaList.of("text")
).asJava
supportedParams
JavaMap.of(
"supportedLevels", JavaList.of("medium", "easy"),
"supportedMedia", JavaList.of("image/gif"),
"supportedInputType", JavaList.of("text")
)
}
private def extendDrops(drops: Array[Drop], steps: Int, xOffset: Int) = {