|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.crowd.plugin.rest.util.SearchRestrictionEntityTranslator
public class SearchRestrictionEntityTranslator
Utility class to convert from a SearchRestriction interface to one of SearchRestrictionEntity classes.
Nested Class Summary | |
---|---|
static class |
SearchRestrictionEntityTranslator.SupportedType
Represents a supported value type. |
Field Summary | |
---|---|
static java.lang.String |
TIME_FORMAT
The format used for times in the REST plugin. |
Constructor Summary | |
---|---|
SearchRestrictionEntityTranslator()
|
Method Summary | |
---|---|
static java.lang.String |
asTimeString(java.util.Date date)
Converts the given Date object to a String using. |
static java.util.Date |
fromTimeString(java.lang.String time)
Converts the given date and time String to a Date object. |
static BooleanRestriction |
toBooleanRestriction(BooleanRestrictionEntity booleanRestrictionEntity)
Converts from a BooleanRestrictionEntity to a BooleanRestriction. |
static BooleanRestrictionEntity |
toBooleanRestrictionEntity(BooleanRestriction booleanRestriction)
Converts from a BooleanRestriction to a BooleanRestrictionEntity. |
static Property |
toProperty(PropertyEntity propertyEntity)
Converts from a PropertyEntity to a Property. |
static PropertyEntity |
toPropertyEntity(Property property)
Converts from a Property to a PropertyEntity. |
static PropertyRestriction |
toPropertyRestriction(PropertyRestrictionEntity propertyRestrictionEntity)
Converts from a PropertyRestrictionEntity to a PropertyRestriction. |
static PropertyRestrictionEntity |
toPropertyRestrictionEntity(PropertyRestriction propertyRestriction)
Converts from a PropertyRestriction to a PropertyRestrictionEntity. |
static SearchRestriction |
toSearchRestriction(SearchRestrictionEntity searchRestrictionEntity)
Converts from a SearchRestrictionEntity to a SearchRestriction. |
static SearchRestrictionEntity |
toSearchRestrictionEntity(SearchRestriction searchRestriction)
Converts from a SearchRestriction a SearchRestrictionEntity. |
static java.lang.Object |
valueFromString(SearchRestrictionEntityTranslator.SupportedType supportedType,
java.lang.String value)
Converts from a String to a value type. |
static java.lang.String |
valueToString(java.lang.Object value)
Converts the value to a String. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String TIME_FORMAT
Constructor Detail |
---|
public SearchRestrictionEntityTranslator()
Method Detail |
---|
public static BooleanRestrictionEntity toBooleanRestrictionEntity(BooleanRestriction booleanRestriction)
booleanRestriction
- BooleanRestriction
public static BooleanRestriction toBooleanRestriction(BooleanRestrictionEntity booleanRestrictionEntity)
booleanRestrictionEntity
- boolean restriction entity to convert from
java.lang.IllegalArgumentException
- if no BooleanLogic enum constant could be found for BooleanRestrictionEntity.getBooleanLogic()
.public static PropertyRestrictionEntity toPropertyRestrictionEntity(PropertyRestriction propertyRestriction)
propertyRestriction
- PropertyRestriction
public static PropertyRestriction toPropertyRestriction(PropertyRestrictionEntity propertyRestrictionEntity)
propertyRestrictionEntity
- property restriction entity to convert from
public static PropertyEntity toPropertyEntity(Property property)
property
- Property to convert from
public static Property toProperty(PropertyEntity propertyEntity)
propertyEntity
- PropertyEntity to convert from.
java.lang.IllegalArgumentException
- if the property value type is unknownpublic static SearchRestrictionEntity toSearchRestrictionEntity(SearchRestriction searchRestriction)
searchRestriction
- search restriction to convert
public static SearchRestriction toSearchRestriction(SearchRestrictionEntity searchRestrictionEntity)
searchRestrictionEntity
- search restriction entity to convert from
public static java.lang.String valueToString(java.lang.Object value)
value
- value
public static java.lang.Object valueFromString(SearchRestrictionEntityTranslator.SupportedType supportedType, java.lang.String value)
supportedType
- the supported type of the valuevalue
- value
public static java.lang.String asTimeString(java.util.Date date)
"yyyy-MM-dd\'T\'HH:mm:ss.SSSZ".
date
- a Date
SimpleDateFormat
public static java.util.Date fromTimeString(java.lang.String time) throws java.lang.IllegalArgumentException
"yyyy-MM-dd\'T\'HH:mm:ss.SSSZ".
time
- a String representation of a date and time
java.lang.RuntimeException
- if there is an error parsing the date
java.lang.IllegalArgumentException
- if the input string is not in the expected formatSimpleDateFormat
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |