public class SearchRestrictionEntityTranslator extends Object
Modifier and Type | Class and Description |
---|---|
static class |
SearchRestrictionEntityTranslator.SupportedType
Represents a supported value type.
|
Modifier and Type | Field and Description |
---|---|
static String |
TIME_FORMAT
The format used for times in the REST plugin.
|
Constructor and Description |
---|
SearchRestrictionEntityTranslator() |
Modifier and Type | Method and Description |
---|---|
static String |
asTimeString(Date date)
Converts the given Date object to a String using.
|
static Date |
fromTimeString(String time)
Converts the given date and time String to a Date object.
|
static com.atlassian.crowd.search.query.entity.restriction.BooleanRestriction |
toBooleanRestriction(BooleanRestrictionEntity booleanRestrictionEntity)
Converts from a BooleanRestrictionEntity to a BooleanRestriction.
|
static BooleanRestrictionEntity |
toBooleanRestrictionEntity(com.atlassian.crowd.search.query.entity.restriction.BooleanRestriction booleanRestriction)
Converts from a BooleanRestriction to a BooleanRestrictionEntity.
|
static com.atlassian.crowd.search.query.entity.restriction.Property |
toProperty(PropertyEntity propertyEntity)
Converts from a PropertyEntity to a Property.
|
static PropertyEntity |
toPropertyEntity(com.atlassian.crowd.search.query.entity.restriction.Property property)
Converts from a Property to a PropertyEntity.
|
static com.atlassian.crowd.search.query.entity.restriction.PropertyRestriction |
toPropertyRestriction(PropertyRestrictionEntity propertyRestrictionEntity)
Converts from a PropertyRestrictionEntity to a PropertyRestriction.
|
static PropertyRestrictionEntity |
toPropertyRestrictionEntity(com.atlassian.crowd.search.query.entity.restriction.PropertyRestriction propertyRestriction)
Converts from a PropertyRestriction to a PropertyRestrictionEntity.
|
static com.atlassian.crowd.embedded.api.SearchRestriction |
toSearchRestriction(SearchRestrictionEntity searchRestrictionEntity)
Converts from a SearchRestrictionEntity to a SearchRestriction.
|
static SearchRestrictionEntity |
toSearchRestrictionEntity(com.atlassian.crowd.embedded.api.SearchRestriction searchRestriction)
Converts from a SearchRestriction a SearchRestrictionEntity.
|
static Object |
valueFromString(SearchRestrictionEntityTranslator.SupportedType supportedType,
String value)
Converts from a String to a value type.
|
static String |
valueToString(Object value)
Converts the value to a String.
|
public static final String TIME_FORMAT
public static BooleanRestrictionEntity toBooleanRestrictionEntity(com.atlassian.crowd.search.query.entity.restriction.BooleanRestriction booleanRestriction)
booleanRestriction
- BooleanRestrictionpublic static com.atlassian.crowd.search.query.entity.restriction.BooleanRestriction toBooleanRestriction(BooleanRestrictionEntity booleanRestrictionEntity)
booleanRestrictionEntity
- boolean restriction entity to convert fromIllegalArgumentException
- if no BooleanLogic enum constant could be found for com.atlassian.crowd.integration.rest.entity.BooleanRestrictionEntity#getBooleanLogic()
.public static PropertyRestrictionEntity toPropertyRestrictionEntity(com.atlassian.crowd.search.query.entity.restriction.PropertyRestriction propertyRestriction)
propertyRestriction
- PropertyRestrictionpublic static com.atlassian.crowd.search.query.entity.restriction.PropertyRestriction toPropertyRestriction(PropertyRestrictionEntity propertyRestrictionEntity)
propertyRestrictionEntity
- property restriction entity to convert frompublic static PropertyEntity toPropertyEntity(com.atlassian.crowd.search.query.entity.restriction.Property property)
property
- Property to convert frompublic static com.atlassian.crowd.search.query.entity.restriction.Property toProperty(PropertyEntity propertyEntity)
propertyEntity
- PropertyEntity to convert from.IllegalArgumentException
- if the property value type is unknownpublic static SearchRestrictionEntity toSearchRestrictionEntity(com.atlassian.crowd.embedded.api.SearchRestriction searchRestriction)
searchRestriction
- search restriction to convertpublic static com.atlassian.crowd.embedded.api.SearchRestriction toSearchRestriction(SearchRestrictionEntity searchRestrictionEntity)
searchRestrictionEntity
- search restriction entity to convert frompublic static String valueToString(Object value)
value
- valuepublic static Object valueFromString(SearchRestrictionEntityTranslator.SupportedType supportedType, String value)
supportedType
- the supported type of the valuevalue
- valuepublic static String asTimeString(Date date)
"yyyy-MM-dd\'T\'HH:mm:ss.SSSZ".
date
- a DateSimpleDateFormat
public static Date fromTimeString(String time) throws IllegalArgumentException
"yyyy-MM-dd\'T\'HH:mm:ss.SSSZ".
time
- a String representation of a date and timeRuntimeException
- if there is an error parsing the dateIllegalArgumentException
- if the input string is not in the expected formatSimpleDateFormat
Copyright © 2003–2016 Atlassian. All rights reserved.