net.sourceforge.domian.specification
Class DateStringSpecification
java.lang.Object
net.sourceforge.domian.specification.AbstractSpecification<java.lang.String>
net.sourceforge.domian.specification.DateStringSpecification
- All Implemented Interfaces:
- LeafSpecification<java.lang.String>, Specification<java.lang.String>, ValueBoundSpecification<java.lang.String>
final class DateStringSpecification
- extends AbstractSpecification<java.lang.String>
- implements ValueBoundSpecification<java.lang.String>
Specification for approval of strings representing a date.
The date must be a valid one.
This specification is value bound.
The value is a date pattern which must be given in a
java.text.SimpleDateFormat
date format.
Candidate string objects must be successfully parsed using this date pattern value to be approved by this specification.
- Since:
- 0.1
- Author:
- Eirik Torske
- See Also:
java.text.SimpleDateFormat
Methods inherited from class net.sourceforge.domian.specification.AbstractSpecification |
and, containsSimpleCompositesOnly, containsValueBoundSpecificationsOnly, createValueBoundSpecification, getAllSpecifications, getNegatedSpecification, getNumberOfLevelsOfNegations, getType, hasConjunction, hasDisjunction, intersectsWith, invert, isDisjointWith, isGeneralizationOf, isIntersectionOf, isInvertible, isOddNumber, isSpecialCaseOf, or, purify, toString, where |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
simpleDateFormat
private final java.text.SimpleDateFormat simpleDateFormat
DateStringSpecification
DateStringSpecification(java.lang.String datePattern)
getValue
public java.lang.String getValue()
- Specified by:
getValue
in interface ValueBoundSpecification<java.lang.String>
- Returns:
- a string representation of the
simpleDateFormat
member object
isSatisfiedBy
public java.lang.Boolean isSatisfiedBy(java.lang.String candidate)
- Specified by:
isSatisfiedBy
in interface Specification<java.lang.String>
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
equals
public boolean equals(java.lang.Object otherObject)
- Overrides:
equals
in class java.lang.Object
lengthOfYearStringIsNotEqualToLengthOfYearPatternString
private static boolean lengthOfYearStringIsNotEqualToLengthOfYearPatternString(java.util.Date date,
java.text.SimpleDateFormat datePattern)
Copyright © 2006-2010. All Rights Reserved.