Created
May 2, 2013 15:09
-
-
Save debop/5502873 to your computer and use it in GitHub Desktop.
InRange
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
| /** 지정한 값이 두 속성 값 사이에 존재하는지 여부 */ | |
| public static Criterion getIsInRangeCriterion(final String loPropertyName, | |
| final String hiPropertyName, | |
| Object value, | |
| boolean includeLo, | |
| boolean includeHi) { | |
| Guard.shouldNotBeNull(value, "value"); | |
| Criterion loCriteria = (includeLo) ? le(loPropertyName, value) | |
| : lt(loPropertyName, value); | |
| Criterion hiCritiera = (includeHi) ? ge(hiPropertyName, value) | |
| : gt(hiPropertyName, value); | |
| return conjunction() | |
| .add(disjunction() | |
| .add(isNull(loPropertyName)) | |
| .add(loCriteria)) | |
| .add(disjunction() | |
| .add(isNull(hiPropertyName)) | |
| .add(hiCritiera)); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment