Class SearchRestrictionEntityTranslator
- java.lang.Object
- 
- com.atlassian.confluence.functest.rest.admin.crowd.SearchRestrictionEntityTranslator
 
- 
 public class SearchRestrictionEntityTranslator extends Object Utility class to convert from a SearchRestriction interface to one of SearchRestrictionEntity classes.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classSearchRestrictionEntityTranslator.SupportedTypeRepresents a supported value type.
 - 
Field SummaryFields Modifier and Type Field Description static StringTIME_FORMATThe format used for times in the REST plugin.
 - 
Constructor SummaryConstructors Constructor Description SearchRestrictionEntityTranslator()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static StringasTimeString(Date date)Converts the given Date object to a String using.static DatefromTimeString(String time)Converts the given date and time String to a Date object.static com.atlassian.crowd.search.query.entity.restriction.BooleanRestrictiontoBooleanRestriction(BooleanRestrictionEntity booleanRestrictionEntity)Converts from a BooleanRestrictionEntity to a BooleanRestriction.static BooleanRestrictionEntitytoBooleanRestrictionEntity(com.atlassian.crowd.search.query.entity.restriction.BooleanRestriction booleanRestriction)Converts from a BooleanRestriction to a BooleanRestrictionEntity.static com.atlassian.crowd.search.query.entity.restriction.PropertytoProperty(PropertyEntity propertyEntity)Converts from a PropertyEntity to a Property.static PropertyEntitytoPropertyEntity(com.atlassian.crowd.search.query.entity.restriction.Property property)Converts from a Property to a PropertyEntity.static com.atlassian.crowd.search.query.entity.restriction.PropertyRestrictiontoPropertyRestriction(PropertyRestrictionEntity propertyRestrictionEntity)Converts from a PropertyRestrictionEntity to a PropertyRestriction.static PropertyRestrictionEntitytoPropertyRestrictionEntity(com.atlassian.crowd.search.query.entity.restriction.PropertyRestriction propertyRestriction)Converts from a PropertyRestriction to a PropertyRestrictionEntity.static com.atlassian.crowd.embedded.api.SearchRestrictiontoSearchRestriction(SearchRestrictionEntity searchRestrictionEntity)Converts from a SearchRestrictionEntity to a SearchRestriction.static SearchRestrictionEntitytoSearchRestrictionEntity(com.atlassian.crowd.embedded.api.SearchRestriction searchRestriction)Converts from a SearchRestriction a SearchRestrictionEntity.static ObjectvalueFromString(SearchRestrictionEntityTranslator.SupportedType supportedType, String value)Converts from a String to a value type.static StringvalueToString(Object value)Converts the value to a String.
 
- 
- 
- 
Field Detail- 
TIME_FORMATpublic static final String TIME_FORMAT The format used for times in the REST plugin. Conforms to ISO 8601. Format is also used in Jira.- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
toBooleanRestrictionEntitypublic static BooleanRestrictionEntity toBooleanRestrictionEntity(com.atlassian.crowd.search.query.entity.restriction.BooleanRestriction booleanRestriction) Converts from a BooleanRestriction to a BooleanRestrictionEntity.- Parameters:
- booleanRestriction- BooleanRestriction
- Returns:
- BooleanRestrictionEntity
 
 - 
toBooleanRestrictionpublic static com.atlassian.crowd.search.query.entity.restriction.BooleanRestriction toBooleanRestriction(BooleanRestrictionEntity booleanRestrictionEntity) Converts from a BooleanRestrictionEntity to a BooleanRestriction.- Parameters:
- booleanRestrictionEntity- boolean restriction entity to convert from
- Returns:
- BooleanRestriction
- Throws:
- IllegalArgumentException- if no BooleanLogic enum constant could be found for- BooleanRestrictionEntity.getBooleanLogic().
 
 - 
toPropertyRestrictionEntitypublic static PropertyRestrictionEntity toPropertyRestrictionEntity(com.atlassian.crowd.search.query.entity.restriction.PropertyRestriction propertyRestriction) Converts from a PropertyRestriction to a PropertyRestrictionEntity.- Parameters:
- propertyRestriction- PropertyRestriction
- Returns:
- PropertyRestrictionEntity
 
 - 
toPropertyRestrictionpublic static com.atlassian.crowd.search.query.entity.restriction.PropertyRestriction toPropertyRestriction(PropertyRestrictionEntity propertyRestrictionEntity) Converts from a PropertyRestrictionEntity to a PropertyRestriction.- Parameters:
- propertyRestrictionEntity- property restriction entity to convert from
- Returns:
- PropertyRestriction
 
 - 
toPropertyEntitypublic static PropertyEntity toPropertyEntity(com.atlassian.crowd.search.query.entity.restriction.Property property) Converts from a Property to a PropertyEntity.- Parameters:
- property- Property to convert from
- Returns:
- PropertyEntity
 
 - 
toPropertypublic static com.atlassian.crowd.search.query.entity.restriction.Property toProperty(PropertyEntity propertyEntity) Converts from a PropertyEntity to a Property.- Parameters:
- propertyEntity- PropertyEntity to convert from.
- Returns:
- Property
- Throws:
- IllegalArgumentException- if the property value type is unknown
 
 - 
toSearchRestrictionEntitypublic static SearchRestrictionEntity toSearchRestrictionEntity(com.atlassian.crowd.embedded.api.SearchRestriction searchRestriction) Converts from a SearchRestriction a SearchRestrictionEntity.- Parameters:
- searchRestriction- search restriction to convert
- Returns:
- SearchRestrictionEntity
 
 - 
toSearchRestrictionpublic static com.atlassian.crowd.embedded.api.SearchRestriction toSearchRestriction(SearchRestrictionEntity searchRestrictionEntity) Converts from a SearchRestrictionEntity to a SearchRestriction.- Parameters:
- searchRestrictionEntity- search restriction entity to convert from
- Returns:
- SearchRestriction
 
 - 
valueToStringpublic static String valueToString(Object value) Converts the value to a String.- Parameters:
- value- value
- Returns:
- String format of the value
 
 - 
valueFromStringpublic static Object valueFromString(SearchRestrictionEntityTranslator.SupportedType supportedType, String value) Converts from a String to a value type.- Parameters:
- supportedType- the supported type of the value
- value- value
- Returns:
- value type
 
 - 
asTimeStringpublic static String asTimeString(Date date) Converts the given Date object to a String using. The string is in the format"yyyy-MM-dd\'T\'HH:mm:ss.SSSZ" .- Parameters:
- date- a Date
- Returns:
- a String representation of the date and time
- See Also:
- SimpleDateFormat
 
 - 
fromTimeStringpublic static Date fromTimeString(String time) throws IllegalArgumentException Converts the given date and time String to a Date object. The time parameter is expected to be in the format"yyyy-MM-dd\'T\'HH:mm:ss.SSSZ" .- Parameters:
- time- a String representation of a date and time
- Returns:
- a Date
- Throws:
- RuntimeException- if there is an error parsing the date
- IllegalArgumentException- if the input string is not in the expected format
- See Also:
- SimpleDateFormat
 
 
- 
 
-