Created
January 18, 2011 01:11
-
-
Save wfaler/783831 to your computer and use it in GitHub Desktop.
validator2.scala
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
/** | |
* Checks uniqueness of a Widget for create | |
*/ | |
class UniqueValidator(func: => Long) extends Validator { | |
def getKey = "id" | |
def getReplaceModel = List[Tuple2[String, Any]]() | |
def isValid: Boolean = { | |
if (Widgets.find(func) == None) return true | |
else return false | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment