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 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 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(BooleanRestriction booleanRestriction)
booleanRestriction
- BooleanRestrictionpublic static BooleanRestriction toBooleanRestriction(BooleanRestrictionEntity booleanRestrictionEntity)
booleanRestrictionEntity
- boolean restriction entity to convert fromIllegalArgumentException
- if no BooleanLogic enum constant could be found for BooleanRestrictionEntity.getBooleanLogic()
.public static PropertyRestrictionEntity toPropertyRestrictionEntity(PropertyRestriction propertyRestriction)
propertyRestriction
- PropertyRestrictionpublic static PropertyRestriction toPropertyRestriction(PropertyRestrictionEntity propertyRestrictionEntity)
propertyRestrictionEntity
- property restriction entity to convert frompublic static PropertyEntity toPropertyEntity(Property property)
property
- Property to convert frompublic static Property toProperty(PropertyEntity propertyEntity)
propertyEntity
- PropertyEntity to convert from.IllegalArgumentException
- if the property value type is unknownpublic static SearchRestrictionEntity toSearchRestrictionEntity(SearchRestriction searchRestriction)
searchRestriction
- search restriction to convertpublic static 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 © 2021 Atlassian. All rights reserved.