public class URIBuilderImpl extends Object implements URIBuilder
| Modifier and Type | Class and Description |
|---|---|
protected static class |
URIBuilderImpl.Segment |
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,String> |
customQueryOptions
Insertion-order map of custom query options.
|
protected static org.slf4j.Logger |
LOG
Logger.
|
protected Map<String,String> |
parameters
Insertion-order map of parameter aliases.
|
protected Map<String,String> |
queryOptions
Insertion-order map of query options.
|
protected List<URIBuilderImpl.Segment> |
segments |
| Constructor and Description |
|---|
URIBuilderImpl(Configuration configuration,
String serviceRoot)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
URIBuilder |
addCustomQueryOption(String customName,
String customValue)
Adds/Replaces the specified custom query option to the URI.
|
URIBuilder |
addParameterAlias(String alias,
String exp)
Adds the specified (custom) parameter alias to the URI.
|
URIBuilder |
addQueryOption(QueryOption option,
String value)
Adds the specified query option to the URI.
|
URIBuilder |
addQueryOption(String option,
String value,
boolean replace)
Adds/Replaces the specified (custom) query option to the URI.
|
URIBuilder |
appendActionCallSegment(String action)
Appends action segment to the URI.
|
URIBuilder |
appendAllSegment()
Appends all segment to the URI.
|
URIBuilder |
appendBatchSegment()
Appends batch segment to the URI.
|
URIBuilder |
appendCountSegment()
Appends count segment to the URI.
|
URIBuilder |
appendCrossjoinSegment(String... segmentValues)
Appends cross join segment to the URI.
|
URIBuilder |
appendDerivedEntityTypeSegment(String segmentValue)
Appends derived entity type segment to the URI.
|
URIBuilder |
appendEntityIdSegment(String segmentValue)
Appends entity-id segment to the URI.
|
URIBuilder |
appendEntitySetSegment(String segmentValue)
Appends EntitySet segment to the URI.
|
URIBuilder |
appendKeySegment(EdmEnumType enumType,
String memberName)
Appends enum key segment to the URI.
|
URIBuilder |
appendKeySegment(Map<String,Object> segmentValues)
Appends key segment to the URI, for multiple keys.
|
URIBuilder |
appendKeySegment(Map<String,org.apache.commons.lang3.tuple.Pair<EdmEnumType,String>> enumValues,
Map<String,Object> segmentValues)
Appends key segment to the URI, for multiple keys.
|
URIBuilder |
appendKeySegment(Object val)
Appends key segment to the URI.
|
URIBuilder |
appendMetadataSegment()
Appends metadata segment to the URI.
|
URIBuilder |
appendNavigationSegment(String segmentValue)
Appends navigation segment to the URI.
|
URIBuilder |
appendOperationCallSegment(String operation)
Appends operation (action or function) segment to the URI.
|
URIBuilder |
appendPropertySegment(String segmentValue)
Appends property segment to the URI.
|
URIBuilder |
appendRefSegment()
Appends ref segment to the URI.
|
URIBuilder |
appendSingletonSegment(String segmentValue)
Appends Singleton segment to the URI.
|
URIBuilder |
appendValueSegment()
Appends value segment to the URI.
|
URI |
build()
Build OData URI.
|
protected String |
buildMultiKeySegment(Map<String,Object> segmentValues,
boolean escape,
char sperator) |
URIBuilder |
count()
Adds count query option.
|
URIBuilder |
count(boolean value)
Appends count query option.
|
URIBuilder |
expand(String... expandItems)
Adds expand query option.
|
URIBuilder |
expandWithOptions(String expandItem,
boolean pathRef,
boolean pathCount,
Map<QueryOption,Object> options)
The set of expanded entities can be refined through the application of expand options, expressed as a
semicolon-separated list of system query options, enclosed in parentheses, see [OData-URL].
|
URIBuilder |
expandWithOptions(String expandItem,
Map<QueryOption,Object> options)
The set of expanded entities can be refined through the application of expand options, expressed as a
semicolon-separated list of system query options, enclosed in parentheses, see [OData-URL].
|
URIBuilder |
expandWithSelect(String expandItem,
String... selectItems)
Properties of related entities can be specified by including the $select query option within the $expand.
|
URIBuilder |
filter(String filter)
Adds filter query option.
|
URIBuilder |
filter(URIFilter filter)
Adds filter for filter query option.
|
URIBuilder |
format(String format)
Adds format query option.
|
protected char |
getBoundOperationSeparator() |
protected String |
getOperationInvokeMarker() |
URIBuilder |
id(String idValue)
Adds id query option.
|
protected String |
noKeysWrapper() |
URIBuilder |
orderBy(String order)
Adds orderby query option.
|
URIBuilder |
replaceQueryOption(QueryOption option,
String value)
Adds/replaces the specified query option to the URI.
|
URIBuilder |
search(String expression)
Appends search query option.
|
URIBuilder |
search(URISearch search)
Appends search query option.
|
URIBuilder |
select(String... selectItems)
Adds select query option.
|
URIBuilder |
skip(int skip)
Adds skip query option.
|
URIBuilder |
skipToken(String skipToken)
Adds skiptoken query option.
|
URIBuilder |
top(int top)
Adds top query option.
|
String |
toString() |
protected static final org.slf4j.Logger LOG
protected final List<URIBuilderImpl.Segment> segments
protected final Map<String,String> customQueryOptions
public URIBuilderImpl(Configuration configuration, String serviceRoot)
serviceRoot - absolute URL (schema, host and port included) representing the location of the root of the data
service.public URIBuilder addQueryOption(QueryOption option, String value)
URIBuilderaddQueryOption in interface URIBuilderoption - query option.value - query option value.public URIBuilder replaceQueryOption(QueryOption option, String value)
URIBuilderreplaceQueryOption in interface URIBuilderoption - query option.value - query option value.public URIBuilder addQueryOption(String option, String value, boolean replace)
URIBuilderaddQueryOption in interface URIBuilderoption - query option.value - query option value.replace - if true then replace existing one.public URIBuilder addParameterAlias(String alias, String exp)
URIBuilderaddParameterAlias in interface URIBuilderalias - parameter alias.exp - expression value.public URIBuilder appendEntitySetSegment(String segmentValue)
URIBuilderappendEntitySetSegment in interface URIBuildersegmentValue - segment value.public URIBuilder appendKeySegment(Object val)
URIBuilderappendKeySegment in interface URIBuilderval - segment value.public URIBuilder appendKeySegment(Map<String,Object> segmentValues)
URIBuilderappendKeySegment in interface URIBuildersegmentValues - segment values.public URIBuilder appendPropertySegment(String segmentValue)
URIBuilderappendPropertySegment in interface URIBuildersegmentValue - segment value.public URIBuilder appendNavigationSegment(String segmentValue)
URIBuilderappendNavigationSegment in interface URIBuildersegmentValue - segment value.public URIBuilder appendDerivedEntityTypeSegment(String segmentValue)
URIBuilderappendDerivedEntityTypeSegment in interface URIBuildersegmentValue - segment value.public URIBuilder appendValueSegment()
URIBuilderappendValueSegment in interface URIBuilderpublic URIBuilder appendCountSegment()
URIBuilderappendCountSegment in interface URIBuilderpublic URIBuilder appendActionCallSegment(String action)
URIBuilderappendActionCallSegment in interface URIBuilderaction - Action namepublic URIBuilder appendOperationCallSegment(String operation)
URIBuilderappendOperationCallSegment in interface URIBuilderoperation - Operation (action or function) namepublic URIBuilder appendMetadataSegment()
URIBuilderappendMetadataSegment in interface URIBuilderpublic URIBuilder appendBatchSegment()
URIBuilderappendBatchSegment in interface URIBuilderpublic URIBuilder count()
URIBuildercount in interface URIBuilderpublic URIBuilder expand(String... expandItems)
URIBuilderexpand in interface URIBuilderexpandItems - items to be expanded in-lineQueryOption.EXPANDpublic URIBuilder format(String format)
URIBuilderformat in interface URIBuilderformat - media type acceptable in a response.QueryOption.FORMATpublic URIBuilder filter(URIFilter filter)
URIBuilderfilter in interface URIBuilderfilter - filter instance (to be obtained via FilterFactory);
note that build() method will be immediately invoked.QueryOption.FILTER,
URIFilter,
FilterFactorypublic URIBuilder filter(String filter)
URIBuilderfilter in interface URIBuilderfilter - filter string.QueryOption.FILTERpublic URIBuilder select(String... selectItems)
URIBuilderselect in interface URIBuilderselectItems - select itemsQueryOption.SELECTpublic URIBuilder orderBy(String order)
URIBuilderorderBy in interface URIBuilderorder - order string.QueryOption.ORDERBYpublic URIBuilder top(int top)
URIBuildertop in interface URIBuildertop - maximum number of entities to be returned.QueryOption.TOPpublic URIBuilder skip(int skip)
URIBuilderskip in interface URIBuilderskip - number of entities to be skipped into the response.QueryOption.SKIPpublic URIBuilder skipToken(String skipToken)
URIBuilderskipToken in interface URIBuilderskipToken - opaque token.QueryOption.SKIPTOKENpublic URI build()
URIBuilderbuild in interface URIBuilderprotected String buildMultiKeySegment(Map<String,Object> segmentValues, boolean escape, char sperator)
public URIBuilder appendKeySegment(EdmEnumType enumType, String memberName)
URIBuilderappendKeySegment in interface URIBuilderenumType - enum typememberName - enum member namepublic URIBuilder appendKeySegment(Map<String,org.apache.commons.lang3.tuple.Pair<EdmEnumType,String>> enumValues, Map<String,Object> segmentValues)
URIBuilderappendKeySegment in interface URIBuilderenumValues - enum segment values.segmentValues - segment values.protected String noKeysWrapper()
protected char getBoundOperationSeparator()
protected String getOperationInvokeMarker()
public URIBuilder appendSingletonSegment(String segmentValue)
URIBuilderappendSingletonSegment in interface URIBuildersegmentValue - segment value.public URIBuilder appendEntityIdSegment(String segmentValue)
URIBuilderappendEntityIdSegment in interface URIBuildersegmentValue - segment valuepublic URIBuilder appendRefSegment()
URIBuilderappendRefSegment in interface URIBuilderpublic URIBuilder appendCrossjoinSegment(String... segmentValues)
URIBuilderappendCrossjoinSegment in interface URIBuildersegmentValues - segment values.public URIBuilder appendAllSegment()
URIBuilderappendAllSegment in interface URIBuilderpublic URIBuilder id(String idValue)
URIBuilderid in interface URIBuilderidValue - opaque token.QueryOption.IDpublic URIBuilder search(URISearch search)
URIBuildersearch in interface URIBuildersearch - search expressionQueryOption.SEARCHpublic URIBuilder search(String expression)
URIBuildersearch in interface URIBuilderexpression - search expressionQueryOption.SEARCHpublic URIBuilder count(boolean value)
URIBuildercount in interface URIBuildervalue - true or falseQueryOption.COUNTpublic URIBuilder expandWithOptions(String expandItem, Map<QueryOption,Object> options)
URIBuilderexpandWithOptions in interface URIBuilderexpandItem - item to be expanded.options - System query options. Allowed query options are: $filter, $select, $orderby, $skip, $top, $count,
$search, $expand, and $levels.QueryOption.EXPANDpublic URIBuilder expandWithOptions(String expandItem, boolean pathRef, boolean pathCount, Map<QueryOption,Object> options)
URIBuilderexpandWithOptions in interface URIBuilderexpandItem - item to be expanded.pathRef - include the /$ref at the end of the $expand item's path;if true pathCount MUST be falsepathCount - include /$count at the end of the $expand item's path;if true pathRef MUST be falseoptions - System query options. Allowed query options are: $filter, $select, $orderby, $skip, $top, $count,
$search, $expand, and $levels.QueryOption.EXPANDpublic URIBuilder expandWithSelect(String expandItem, String... selectItems)
URIBuilderexpandWithSelect in interface URIBuilderexpandItem - related entity name.selectItems - properties to be selected.QueryOption.EXPAND,
QueryOption.SELECTpublic URIBuilder addCustomQueryOption(String customName, String customValue)
URIBuilderaddCustomQueryOption in interface URIBuilderCopyright © 2023. All rights reserved.