You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by il...@apache.org on 2014/03/20 14:50:09 UTC
[3/9] Consistently using package name to differentiate V3 and V4
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bab03624/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/V3URIBuilderImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/V3URIBuilderImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/V3URIBuilderImpl.java
deleted file mode 100644
index 3f61660..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/V3URIBuilderImpl.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.uri;
-
-import org.apache.olingo.client.api.utils.URIUtils;
-import java.util.Map;
-
-import org.apache.commons.lang3.StringUtils;
-import org.apache.olingo.client.api.V3Configuration;
-import org.apache.olingo.client.api.uri.QueryOption;
-import org.apache.olingo.client.api.uri.SegmentType;
-import org.apache.olingo.client.api.uri.V3URIBuilder;
-
-public class V3URIBuilderImpl extends AbstractURIBuilder<V3URIBuilder> implements V3URIBuilder {
-
- private static final long serialVersionUID = -3506851722447870532L;
-
- private final V3Configuration configuration;
-
- public V3URIBuilderImpl(final V3Configuration configuration, final String serviceRoot) {
- super(serviceRoot);
- this.configuration = configuration;
- }
-
- @Override
- protected V3URIBuilder getThis() {
- return this;
- }
-
- @Override
- protected char getBoundOperationSeparator() {
- return '/';
- }
-
- @Override
- protected char getDerivedEntityTypeSeparator() {
- return '/';
- }
-
- @Override
- public V3URIBuilder appendLinksSegment(final String segmentValue) {
- segments.add(new Segment(SegmentType.LINKS, SegmentType.LINKS.getValue()));
- segments.add(new Segment(SegmentType.ENTITYSET, segmentValue));
-
- return getThis();
- }
-
- @Override
- protected String noKeysWrapper() {
- return StringUtils.EMPTY;
- }
-
- @Override
- public V3URIBuilder appendKeySegment(final Object val) {
- if (configuration.isKeyAsSegment()) {
- final String segValue = URIUtils.escape(val);
- segments.add(new Segment(SegmentType.KEY_AS_SEGMENT, segValue));
- } else {
- super.appendKeySegment(val);
- }
-
- return getThis();
- }
-
- @Override
- public V3URIBuilder appendKeySegment(final Map<String, Object> segmentValues) {
- if (!configuration.isKeyAsSegment()) {
- super.appendKeySegment(segmentValues);
- }
-
- return getThis();
- }
-
- @Override
- public V3URIBuilder inlineCount(final InlineCount inlineCount) {
- return addQueryOption(QueryOption.INLINECOUNT, inlineCount.name());
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bab03624/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/V4URIBuilderImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/V4URIBuilderImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/V4URIBuilderImpl.java
deleted file mode 100644
index d24df81..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/V4URIBuilderImpl.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.uri;
-
-import org.apache.commons.lang3.StringUtils;
-import org.apache.olingo.client.api.uri.QueryOption;
-import org.apache.olingo.client.api.uri.SegmentType;
-import org.apache.olingo.client.api.uri.V4URIBuilder;
-
-public class V4URIBuilderImpl extends AbstractURIBuilder<V4URIBuilder> implements V4URIBuilder {
-
- private static final long serialVersionUID = -3506851722447870532L;
-
- public V4URIBuilderImpl(final String serviceRoot) {
- super(serviceRoot);
- }
-
- @Override
- protected V4URIBuilder getThis() {
- return this;
- }
-
- @Override
- protected String noKeysWrapper() {
- return "()";
- }
-
- @Override
- protected char getBoundOperationSeparator() {
- return '.';
- }
-
- @Override
- protected char getDerivedEntityTypeSeparator() {
- return '.';
- }
-
- @Override
- public V4URIBuilder appendSingletonSegment(final String segmentValue) {
- segments.add(new Segment(SegmentType.SINGLETON, segmentValue));
- return getThis();
- }
-
- @Override
- public V4URIBuilder appendEntityIdSegment(final String segmentValue) {
- segments.add(new Segment(SegmentType.ENTITY, null));
- return addQueryOption(QueryOption.ID, segmentValue);
- }
-
- @Override
- public V4URIBuilder appendRefSegment() {
- segments.add(new Segment(SegmentType.REF, SegmentType.REF.getValue()));
- return getThis();
- }
-
- @Override
- public V4URIBuilder appendCrossjoinSegment(final String... segmentValues) {
- StringBuilder segValue = new StringBuilder(SegmentType.CROSS_JOIN.getValue()).
- append('(').append(StringUtils.join(segmentValues, ",")).append(')');
- segments.add(new Segment(SegmentType.CROSS_JOIN, segValue.toString()));
- return getThis();
- }
-
- @Override
- public V4URIBuilder count(final boolean value) {
- return addQueryOption(QueryOption.COUNT, Boolean.toString(value));
- }
-
- @Override
- public V4URIBuilder appendAllSegment() {
- segments.add(new Segment(SegmentType.ALL, SegmentType.ALL.getValue()));
- return getThis();
- }
-
- @Override
- public V4URIBuilder id(final String idValue) {
- return addQueryOption(QueryOption.ID, idValue);
- }
-
- @Override
- public V4URIBuilder search(final String expression) {
- return addQueryOption(QueryOption.SEARCH, expression);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bab03624/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/AbstractComparingFilter.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/AbstractComparingFilter.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/AbstractComparingFilter.java
deleted file mode 100644
index 702128e..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/AbstractComparingFilter.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.uri.filter;
-
-import org.apache.olingo.client.api.uri.filter.FilterArg;
-import org.apache.olingo.client.api.uri.filter.URIFilter;
-
-abstract class AbstractComparingFilter implements URIFilter {
-
- private final FilterArg left;
-
- private final FilterArg right;
-
- AbstractComparingFilter(final FilterArg left, final FilterArg right) {
- this.left = left;
- this.right = right;
- }
-
- protected abstract String getOp();
-
- @Override
- public String build() {
- return new StringBuilder().
- append('(').append(left.build()).
- append(' ').append(getOp()).append(' ').
- append(right.build()).append(')').
- toString();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bab03624/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/AbstractFilterArgFactory.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/AbstractFilterArgFactory.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/AbstractFilterArgFactory.java
deleted file mode 100644
index 96d8fb0..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/AbstractFilterArgFactory.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.uri.filter;
-
-import org.apache.olingo.client.api.uri.filter.FilterArg;
-import org.apache.olingo.client.api.uri.filter.FilterArgFactory;
-
-/**
- * OData filter arguments factory.
- */
-abstract class AbstractFilterArgFactory implements FilterArgFactory {
-
- @Override
- public FilterArg _null() {
- return new FilterConst("null");
- }
-
- @Override
- public FilterArg property(final String propertyPath) {
- return new FilterProperty(propertyPath);
- }
-
- @Override
- public FilterArg literal(final Object value) {
- return new FilterLiteral(value);
- }
-
- @Override
- public FilterArg add(final FilterArg first, final FilterArg second) {
- return new FilterOp("add", first, second);
- }
-
- @Override
- public FilterArg sub(final FilterArg first, final FilterArg second) {
- return new FilterOp("add", first, second);
- }
-
- @Override
- public FilterArg mul(final FilterArg first, final FilterArg second) {
- return new FilterOp("mul", first, second);
- }
-
- @Override
- public FilterArg div(final FilterArg first, final FilterArg second) {
- return new FilterOp("div", first, second);
- }
-
- @Override
- public FilterArg mod(final FilterArg first, final FilterArg second) {
- return new FilterOp("mod", first, second);
- }
-
- @Override
- public FilterArg endswith(final FilterArg first, final FilterArg second) {
- return new FilterFunction("endswith", first, second);
- }
-
- @Override
- public FilterArg startswith(final FilterArg first, final FilterArg second) {
- return new FilterFunction("startswith", first, second);
- }
-
- @Override
- public FilterArg length(final FilterArg param) {
- return new FilterFunction("length", param);
- }
-
- @Override
- public FilterArg indexof(final FilterArg first, final FilterArg second) {
- return new FilterFunction("indexof", first, second);
- }
-
- @Override
- public FilterArg replace(final FilterArg first, final FilterArg second, final FilterArg third) {
- return new FilterFunction("replace", first, second, third);
- }
-
- @Override
- public FilterArg substring(final FilterArg arg, final FilterArg pos) {
- return new FilterFunction("substring", arg, pos);
- }
-
- @Override
- public FilterArg substring(final FilterArg arg, final FilterArg pos, final FilterArg length) {
- return new FilterFunction("substring", arg, pos, length);
- }
-
- @Override
- public FilterArg tolower(final FilterArg param) {
- return new FilterFunction("tolower", param);
- }
-
- @Override
- public FilterArg toupper(final FilterArg param) {
- return new FilterFunction("toupper", param);
- }
-
- @Override
- public FilterArg trim(final FilterArg param) {
- return new FilterFunction("trim", param);
- }
-
- @Override
- public FilterArg concat(final FilterArg first, final FilterArg second) {
- return new FilterFunction("concat", first, second);
- }
-
- @Override
- public FilterArg day(final FilterArg param) {
- return new FilterFunction("day", param);
- }
-
- @Override
- public FilterArg hour(final FilterArg param) {
- return new FilterFunction("hour", param);
- }
-
- @Override
- public FilterArg minute(final FilterArg param) {
- return new FilterFunction("minute", param);
- }
-
- @Override
- public FilterArg month(final FilterArg param) {
- return new FilterFunction("month", param);
- }
-
- @Override
- public FilterArg second(final FilterArg param) {
- return new FilterFunction("second", param);
- }
-
- @Override
- public FilterArg year(final FilterArg param) {
- return new FilterFunction("year", param);
- }
-
- @Override
- public FilterArg round(final FilterArg param) {
- return new FilterFunction("round", param);
- }
-
- @Override
- public FilterArg floor(final FilterArg param) {
- return new FilterFunction("floor", param);
- }
-
- @Override
- public FilterArg ceiling(final FilterArg param) {
- return new FilterFunction("ceiling", param);
- }
-
- @Override
- public FilterArg isof(final FilterArg type) {
- return new FilterFunction("isof", type);
- }
-
- @Override
- public FilterArg isof(final FilterArg expression, final FilterArg type) {
- return new FilterFunction("isof", expression, type);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bab03624/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/AbstractFilterFactory.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/AbstractFilterFactory.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/AbstractFilterFactory.java
deleted file mode 100644
index b939e91..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/AbstractFilterFactory.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.uri.filter;
-
-import org.apache.olingo.client.api.uri.filter.FilterArg;
-import org.apache.olingo.client.api.uri.filter.FilterFactory;
-import org.apache.olingo.client.api.uri.filter.URIFilter;
-
-abstract class AbstractFilterFactory implements FilterFactory {
-
- private static final long serialVersionUID = -6141317149802621836L;
-
- @Override
- public URIFilter match(final FilterArg arg) {
- return new MatchFilter(arg);
- }
-
- @Override
- public URIFilter eq(final String key, final Object value) {
- return new EqFilter(getArgFactory().property(key), getArgFactory().literal(value));
- }
-
- @Override
- public URIFilter eq(final FilterArg left, final FilterArg right) {
- return new EqFilter(left, right);
- }
-
- @Override
- public URIFilter ne(final String key, final Object value) {
- return new NeFilter(getArgFactory().property(key), getArgFactory().literal(value));
- }
-
- @Override
- public URIFilter ne(final FilterArg left, final FilterArg right) {
- return new NeFilter(left, right);
- }
-
- @Override
- public URIFilter gt(final String key, final Object value) {
- return new GtFilter(getArgFactory().property(key), getArgFactory().literal(value));
- }
-
- @Override
- public URIFilter gt(final FilterArg left, final FilterArg right) {
- return new GtFilter(left, right);
- }
-
- @Override
- public URIFilter ge(final String key, final Object value) {
- return new GeFilter(getArgFactory().property(key), getArgFactory().literal(value));
- }
-
- @Override
- public URIFilter ge(final FilterArg left, final FilterArg right) {
- return new GeFilter(left, right);
- }
-
- @Override
- public URIFilter lt(final String key, final Object value) {
- return new LtFilter(getArgFactory().property(key), getArgFactory().literal(value));
- }
-
- @Override
- public URIFilter lt(final FilterArg left, final FilterArg right) {
- return new LtFilter(left, right);
- }
-
- @Override
- public URIFilter le(final String key, final Object value) {
- return new LeFilter(getArgFactory().property(key), getArgFactory().literal(value));
- }
-
- @Override
- public URIFilter le(final FilterArg left, final FilterArg right) {
- return new LeFilter(left, right);
- }
-
- @Override
- public URIFilter and(final URIFilter left, final URIFilter right) {
- return new AndFilter(left, right);
- }
-
- @Override
- public URIFilter or(final URIFilter left, final URIFilter right) {
- return new OrFilter(left, right);
- }
-
- @Override
- public URIFilter not(final URIFilter filter) {
- return new NotFilter(filter);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bab03624/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/AndFilter.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/AndFilter.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/AndFilter.java
deleted file mode 100644
index 173ea21..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/AndFilter.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.uri.filter;
-
-import org.apache.olingo.client.api.uri.filter.URIFilter;
-
-public class AndFilter implements URIFilter {
-
- private final URIFilter left;
-
- private final URIFilter right;
-
- public AndFilter(final URIFilter left, final URIFilter right) {
- this.left = left;
- this.right = right;
- }
-
- @Override
- public String build() {
- return new StringBuilder().
- append('(').append(left.build()).
- append(" and ").
- append(right.build()).append(')').
- toString();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bab03624/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/EqFilter.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/EqFilter.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/EqFilter.java
deleted file mode 100644
index 7ba0f93..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/EqFilter.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.uri.filter;
-
-import org.apache.olingo.client.api.uri.filter.FilterArg;
-
-public class EqFilter extends AbstractComparingFilter {
-
- EqFilter(final FilterArg left, final FilterArg right) {
- super(left, right);
- }
-
- @Override
- protected String getOp() {
- return "eq";
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bab03624/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/FilterConst.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/FilterConst.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/FilterConst.java
deleted file mode 100644
index 117815a..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/FilterConst.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.uri.filter;
-
-import org.apache.olingo.client.api.uri.filter.FilterArg;
-
-/**
- * Filter property path; obtain instances via <tt>FilterArgFactory</tt>.
- *
- * @see org.apache.olingo.client.api.uri.filter.FilterArgFactory
- */
-public class FilterConst implements FilterArg {
-
- private final String value;
-
- FilterConst(final String value) {
- this.value = value;
- }
-
- @Override
- public String build() {
- return value;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bab03624/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/FilterFunction.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/FilterFunction.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/FilterFunction.java
deleted file mode 100644
index 47cd719..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/FilterFunction.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.uri.filter;
-
-import org.apache.olingo.client.api.uri.filter.FilterArg;
-import org.apache.commons.lang3.StringUtils;
-
-public class FilterFunction implements FilterArg {
-
- private final String function;
-
- private final FilterArg[] params;
-
- FilterFunction(final String function, final FilterArg... params) {
- this.function = function;
- this.params = params;
- }
-
- @Override
- public String build() {
- final String[] strParams = params == null || params.length == 0 ? new String[0] : new String[params.length];
- for (int i = 0; i < strParams.length; i++) {
- strParams[i] = params[i].build();
- }
-
- return new StringBuilder(function).
- append('(').
- append(strParams.length == 0 ? StringUtils.EMPTY : StringUtils.join(strParams, ',')).
- append(')').
- toString();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bab03624/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/FilterLambda.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/FilterLambda.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/FilterLambda.java
deleted file mode 100644
index 18f783a..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/FilterLambda.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.uri.filter;
-
-import org.apache.olingo.client.api.uri.filter.FilterArg;
-import org.apache.olingo.client.api.uri.filter.URIFilter;
-
-public class FilterLambda implements FilterArg {
-
- private final FilterArg collection;
-
- private final String operator;
-
- private final URIFilter expression;
-
- FilterLambda(final FilterArg collection, final String operator, final URIFilter expression) {
- this.collection = collection;
- this.operator = operator;
- this.expression = expression;
- }
-
- @Override
- public String build() {
- return new StringBuilder(collection.build()).
- append('/').
- append(operator).
- append(expression.build()).
- toString();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bab03624/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/FilterLiteral.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/FilterLiteral.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/FilterLiteral.java
deleted file mode 100644
index 2f353f1..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/FilterLiteral.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.uri.filter;
-
-import org.apache.olingo.client.api.uri.filter.FilterArg;
-import org.apache.olingo.client.api.utils.URIUtils;
-
-/**
- * Filter value literals; obtain instances via <tt>FilterArgFactory</tt>.
- *
- * @see FilterArgFactory
- */
-public class FilterLiteral implements FilterArg {
-
- private final Object value;
-
- FilterLiteral(final Object value) {
- this.value = value;
- }
-
- @Override
- public String build() {
- return URIUtils.escape(value);
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bab03624/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/FilterOp.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/FilterOp.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/FilterOp.java
deleted file mode 100644
index 5cdced7..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/FilterOp.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.uri.filter;
-
-import org.apache.olingo.client.api.uri.filter.FilterArg;
-
-public class FilterOp implements FilterArg {
-
- private final String op;
-
- private final FilterArg first;
-
- private final FilterArg second;
-
- FilterOp(final String op, final FilterArg first, final FilterArg second) {
- this.op = op;
- this.first = first;
- this.second = second;
- }
-
- @Override
- public String build() {
- return new StringBuilder().
- append('(').append(first.build()).
- append(' ').append(op).append(' ').
- append(second.build()).append(')').
- toString();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bab03624/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/FilterProperty.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/FilterProperty.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/FilterProperty.java
deleted file mode 100644
index 53b2ca7..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/FilterProperty.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.uri.filter;
-
-import org.apache.olingo.client.api.uri.filter.FilterArg;
-
-/**
- * Filter property path; obtain instances via <tt>FilterArgFactory</tt>.
- *
- * @see FilterArgFactory
- */
-public class FilterProperty implements FilterArg {
-
- private final String propertyPath;
-
- FilterProperty(final String value) {
- this.propertyPath = value;
- }
-
- @Override
- public String build() {
- return propertyPath;
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bab03624/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/GeFilter.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/GeFilter.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/GeFilter.java
deleted file mode 100644
index 439920f..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/GeFilter.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.uri.filter;
-
-import org.apache.olingo.client.api.uri.filter.FilterArg;
-
-public class GeFilter extends AbstractComparingFilter {
-
- GeFilter(final FilterArg left, final FilterArg right) {
- super(left, right);
- }
-
- @Override
- protected String getOp() {
- return "ge";
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bab03624/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/GtFilter.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/GtFilter.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/GtFilter.java
deleted file mode 100644
index 34eb2c2..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/GtFilter.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.uri.filter;
-
-import org.apache.olingo.client.api.uri.filter.FilterArg;
-
-public class GtFilter extends AbstractComparingFilter {
-
- GtFilter(final FilterArg left, final FilterArg right) {
- super(left, right);
- }
-
- @Override
- protected String getOp() {
- return "gt";
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bab03624/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/HasFilter.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/HasFilter.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/HasFilter.java
deleted file mode 100644
index b6029db..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/HasFilter.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.uri.filter;
-
-import org.apache.olingo.client.api.uri.filter.FilterArg;
-
-public class HasFilter extends AbstractComparingFilter {
-
- HasFilter(final FilterArg left, final FilterArg right) {
- super(left, right);
- }
-
- @Override
- protected String getOp() {
- return "has";
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bab03624/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/LeFilter.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/LeFilter.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/LeFilter.java
deleted file mode 100644
index 36452c3..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/LeFilter.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.uri.filter;
-
-import org.apache.olingo.client.api.uri.filter.FilterArg;
-
-public class LeFilter extends AbstractComparingFilter {
-
- LeFilter(final FilterArg left, final FilterArg right) {
- super(left, right);
- }
-
- @Override
- protected String getOp() {
- return "le";
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bab03624/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/LtFilter.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/LtFilter.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/LtFilter.java
deleted file mode 100644
index 8dd963f..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/LtFilter.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.uri.filter;
-
-import org.apache.olingo.client.api.uri.filter.FilterArg;
-
-public class LtFilter extends AbstractComparingFilter {
-
- LtFilter(final FilterArg left, final FilterArg right) {
- super(left, right);
- }
-
- @Override
- protected String getOp() {
- return "lt";
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bab03624/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/MatchFilter.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/MatchFilter.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/MatchFilter.java
deleted file mode 100644
index 0706fc1..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/MatchFilter.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.uri.filter;
-
-import org.apache.olingo.client.api.uri.filter.FilterArg;
-import org.apache.olingo.client.api.uri.filter.URIFilter;
-
-public class MatchFilter implements URIFilter {
-
- private final FilterArg arg;
-
- MatchFilter(final FilterArg arg) {
- this.arg = arg;
- }
-
- @Override
- public String build() {
- return arg.build();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bab03624/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/NeFilter.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/NeFilter.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/NeFilter.java
deleted file mode 100644
index c3a5849..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/NeFilter.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.uri.filter;
-
-import org.apache.olingo.client.api.uri.filter.FilterArg;
-
-public class NeFilter extends AbstractComparingFilter {
-
- NeFilter(final FilterArg left, final FilterArg right) {
- super(left, right);
- }
-
- @Override
- protected String getOp() {
- return "ne";
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bab03624/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/NotFilter.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/NotFilter.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/NotFilter.java
deleted file mode 100644
index 911cd66..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/NotFilter.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.uri.filter;
-
-import org.apache.olingo.client.api.uri.filter.URIFilter;
-
-public class NotFilter implements URIFilter {
-
- private final URIFilter filter;
-
- public NotFilter(final URIFilter left) {
- this.filter = left;
- }
-
- @Override
- public String build() {
- return new StringBuilder("not (").append(filter.build()).append(')').toString();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bab03624/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/OrFilter.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/OrFilter.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/OrFilter.java
deleted file mode 100644
index 31b0d4f..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/OrFilter.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.uri.filter;
-
-import org.apache.olingo.client.api.uri.filter.URIFilter;
-
-public class OrFilter implements URIFilter {
-
- private final URIFilter left;
-
- private final URIFilter right;
-
- public OrFilter(final URIFilter left, final URIFilter right) {
- this.left = left;
- this.right = right;
- }
-
- @Override
- public String build() {
- return new StringBuilder().
- append('(').append(left.build()).
- append(" or ").
- append(right.build()).append(')').
- toString();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bab03624/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/V3FilterArgFactoryImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/V3FilterArgFactoryImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/V3FilterArgFactoryImpl.java
deleted file mode 100644
index e208f11..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/V3FilterArgFactoryImpl.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.uri.filter;
-
-import org.apache.olingo.client.api.uri.filter.FilterArg;
-import org.apache.olingo.client.api.uri.filter.V3FilterArgFactory;
-
-public class V3FilterArgFactoryImpl extends AbstractFilterArgFactory implements V3FilterArgFactory {
-
- @Override
- public FilterArg substringof(final FilterArg first, final FilterArg second) {
- return new FilterFunction("substringof", first, second);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bab03624/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/V3FilterFactoryImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/V3FilterFactoryImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/V3FilterFactoryImpl.java
deleted file mode 100644
index 1feb9d7..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/V3FilterFactoryImpl.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.uri.filter;
-
-import org.apache.olingo.client.api.uri.filter.V3FilterArgFactory;
-import org.apache.olingo.client.api.uri.filter.V3FilterFactory;
-
-public class V3FilterFactoryImpl extends AbstractFilterFactory implements V3FilterFactory {
-
- private static final long serialVersionUID = 1092594961118334631L;
-
- @Override
- public V3FilterArgFactory getArgFactory() {
- return new V3FilterArgFactoryImpl();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bab03624/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/V4FilterArgFactoryImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/V4FilterArgFactoryImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/V4FilterArgFactoryImpl.java
deleted file mode 100644
index b21f307..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/V4FilterArgFactoryImpl.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.uri.filter;
-
-import org.apache.olingo.client.api.uri.filter.FilterArg;
-import org.apache.olingo.client.api.uri.filter.URIFilter;
-import org.apache.olingo.client.api.uri.filter.V4FilterArgFactory;
-
-public class V4FilterArgFactoryImpl extends AbstractFilterArgFactory implements V4FilterArgFactory {
-
- @Override
- public FilterArg contains(final FilterArg first, final FilterArg second) {
- return new FilterFunction("contains", first, second);
- }
-
- @Override
- public FilterArg fractionalseconds(final FilterArg param) {
- return new FilterFunction("fractionalseconds", param);
- }
-
- @Override
- public FilterArg date(final FilterArg param) {
- return new FilterFunction("date", param);
- }
-
- @Override
- public FilterArg time(final FilterArg param) {
- return new FilterFunction("time", param);
- }
-
- @Override
- public FilterArg totaloffsetminutes(final FilterArg param) {
- return new FilterFunction("totaloffsetminutes", param);
- }
-
- @Override
- public FilterArg now() {
- return new FilterFunction("now");
- }
-
- @Override
- public FilterArg mindatetime() {
- return new FilterFunction("mindatetime");
- }
-
- @Override
- public FilterArg maxdatetime() {
- return new FilterFunction("maxdatetime");
- }
-
- @Override
- public FilterArg totalseconds(final FilterArg param) {
- return new FilterFunction("totalseconds", param);
- }
-
- @Override
- public FilterArg cast(final FilterArg type) {
- return new FilterFunction("cast", type);
- }
-
- @Override
- public FilterArg cast(final FilterArg expression, final FilterArg type) {
- return new FilterFunction("cast", expression, type);
- }
-
- @Override
- public FilterArg geoDistance(final FilterArg first, final FilterArg second) {
- return new FilterFunction("geo.distance", first, second);
- }
-
- @Override
- public FilterArg geoIntersects(final FilterArg first, final FilterArg second) {
- return new FilterFunction("geo.intersects", first, second);
- }
-
- @Override
- public FilterArg geoLength(final FilterArg first, final FilterArg second) {
- return new FilterFunction("geo.length", first, second);
- }
-
- @Override
- public FilterArg any(final FilterArg collection, final URIFilter expression) {
- return new FilterLambda(collection, "any", expression);
- }
-
- @Override
- public FilterArg all(final FilterArg collection, final URIFilter expression) {
- return new FilterLambda(collection, "all", expression);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bab03624/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/V4FilterFactoryImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/V4FilterFactoryImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/V4FilterFactoryImpl.java
deleted file mode 100644
index 342938d..0000000
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/filter/V4FilterFactoryImpl.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.client.core.uri.filter;
-
-import org.apache.olingo.client.api.uri.filter.FilterArg;
-import org.apache.olingo.client.api.uri.filter.URIFilter;
-import org.apache.olingo.client.api.uri.filter.V4FilterArgFactory;
-import org.apache.olingo.client.api.uri.filter.V4FilterFactory;
-import org.apache.olingo.commons.api.edm.EdmEnumType;
-
-public class V4FilterFactoryImpl extends AbstractFilterFactory implements V4FilterFactory {
-
- private static final long serialVersionUID = -5358934829490623191L;
-
- @Override
- public V4FilterArgFactory getArgFactory() {
- return new V4FilterArgFactoryImpl();
- }
-
- @Override
- public URIFilter has(final String key, final EdmEnumType enumType, final String memberName) {
- return has(getArgFactory().property(key), enumType, memberName);
- }
-
- @Override
- public URIFilter has(final FilterArg left, final EdmEnumType enumType, final String memberName) {
- return new HasFilter(left, new FilterProperty(enumType.toUriLiteral(memberName)));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bab03624/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/v3/FilterArgFactoryImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/v3/FilterArgFactoryImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/v3/FilterArgFactoryImpl.java
new file mode 100644
index 0000000..c4c176c
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/v3/FilterArgFactoryImpl.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.uri.v3;
+
+import org.apache.olingo.client.api.uri.FilterArg;
+import org.apache.olingo.client.api.uri.v3.FilterArgFactory;
+import org.apache.olingo.client.core.uri.AbstractFilterArgFactory;
+import org.apache.olingo.client.core.uri.FilterFunction;
+
+public class FilterArgFactoryImpl extends AbstractFilterArgFactory implements FilterArgFactory {
+
+ @Override
+ public FilterArg substringof(final FilterArg first, final FilterArg second) {
+ return new FilterFunction("substringof", first, second);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bab03624/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/v3/FilterFactoryImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/v3/FilterFactoryImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/v3/FilterFactoryImpl.java
new file mode 100644
index 0000000..a26cd51
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/v3/FilterFactoryImpl.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.uri.v3;
+
+import org.apache.olingo.client.api.uri.v3.FilterArgFactory;
+import org.apache.olingo.client.api.uri.v3.FilterFactory;
+import org.apache.olingo.client.core.uri.AbstractFilterFactory;
+
+public class FilterFactoryImpl extends AbstractFilterFactory implements FilterFactory {
+
+ private static final long serialVersionUID = 1092594961118334631L;
+
+ @Override
+ public FilterArgFactory getArgFactory() {
+ return new FilterArgFactoryImpl();
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bab03624/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/v3/URIBuilderImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/v3/URIBuilderImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/v3/URIBuilderImpl.java
new file mode 100644
index 0000000..ced9a6e
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/v3/URIBuilderImpl.java
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.uri.v3;
+
+import org.apache.olingo.client.api.utils.URIUtils;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.olingo.client.api.v3.Configuration;
+import org.apache.olingo.client.api.uri.QueryOption;
+import org.apache.olingo.client.api.uri.SegmentType;
+import org.apache.olingo.client.api.uri.v3.URIBuilder;
+import org.apache.olingo.client.core.uri.AbstractURIBuilder;
+
+public class URIBuilderImpl extends AbstractURIBuilder<URIBuilder> implements URIBuilder {
+
+ private static final long serialVersionUID = -3506851722447870532L;
+
+ private final Configuration configuration;
+
+ public URIBuilderImpl(final Configuration configuration, final String serviceRoot) {
+ super(serviceRoot);
+ this.configuration = configuration;
+ }
+
+ @Override
+ protected URIBuilder getThis() {
+ return this;
+ }
+
+ @Override
+ protected char getBoundOperationSeparator() {
+ return '/';
+ }
+
+ @Override
+ protected char getDerivedEntityTypeSeparator() {
+ return '/';
+ }
+
+ @Override
+ public URIBuilder appendLinksSegment(final String segmentValue) {
+ segments.add(new Segment(SegmentType.LINKS, SegmentType.LINKS.getValue()));
+ segments.add(new Segment(SegmentType.ENTITYSET, segmentValue));
+
+ return getThis();
+ }
+
+ @Override
+ protected String noKeysWrapper() {
+ return StringUtils.EMPTY;
+ }
+
+ @Override
+ public URIBuilder appendKeySegment(final Object val) {
+ if (configuration.isKeyAsSegment()) {
+ final String segValue = URIUtils.escape(val);
+ segments.add(new Segment(SegmentType.KEY_AS_SEGMENT, segValue));
+ } else {
+ super.appendKeySegment(val);
+ }
+
+ return getThis();
+ }
+
+ @Override
+ public URIBuilder appendKeySegment(final Map<String, Object> segmentValues) {
+ if (!configuration.isKeyAsSegment()) {
+ super.appendKeySegment(segmentValues);
+ }
+
+ return getThis();
+ }
+
+ @Override
+ public URIBuilder inlineCount(final InlineCount inlineCount) {
+ return addQueryOption(QueryOption.INLINECOUNT, inlineCount.name());
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bab03624/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/v4/FilterArgFactoryImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/v4/FilterArgFactoryImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/v4/FilterArgFactoryImpl.java
new file mode 100644
index 0000000..39298f3
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/v4/FilterArgFactoryImpl.java
@@ -0,0 +1,110 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.uri.v4;
+
+import org.apache.olingo.client.api.uri.FilterArg;
+import org.apache.olingo.client.api.uri.URIFilter;
+import org.apache.olingo.client.api.uri.v4.FilterArgFactory;
+import org.apache.olingo.client.core.uri.AbstractFilterArgFactory;
+import org.apache.olingo.client.core.uri.FilterFunction;
+import org.apache.olingo.client.core.uri.FilterLambda;
+
+public class FilterArgFactoryImpl extends AbstractFilterArgFactory implements FilterArgFactory {
+
+ @Override
+ public FilterArg contains(final FilterArg first, final FilterArg second) {
+ return new FilterFunction("contains", first, second);
+ }
+
+ @Override
+ public FilterArg fractionalseconds(final FilterArg param) {
+ return new FilterFunction("fractionalseconds", param);
+ }
+
+ @Override
+ public FilterArg date(final FilterArg param) {
+ return new FilterFunction("date", param);
+ }
+
+ @Override
+ public FilterArg time(final FilterArg param) {
+ return new FilterFunction("time", param);
+ }
+
+ @Override
+ public FilterArg totaloffsetminutes(final FilterArg param) {
+ return new FilterFunction("totaloffsetminutes", param);
+ }
+
+ @Override
+ public FilterArg now() {
+ return new FilterFunction("now");
+ }
+
+ @Override
+ public FilterArg mindatetime() {
+ return new FilterFunction("mindatetime");
+ }
+
+ @Override
+ public FilterArg maxdatetime() {
+ return new FilterFunction("maxdatetime");
+ }
+
+ @Override
+ public FilterArg totalseconds(final FilterArg param) {
+ return new FilterFunction("totalseconds", param);
+ }
+
+ @Override
+ public FilterArg cast(final FilterArg type) {
+ return new FilterFunction("cast", type);
+ }
+
+ @Override
+ public FilterArg cast(final FilterArg expression, final FilterArg type) {
+ return new FilterFunction("cast", expression, type);
+ }
+
+ @Override
+ public FilterArg geoDistance(final FilterArg first, final FilterArg second) {
+ return new FilterFunction("geo.distance", first, second);
+ }
+
+ @Override
+ public FilterArg geoIntersects(final FilterArg first, final FilterArg second) {
+ return new FilterFunction("geo.intersects", first, second);
+ }
+
+ @Override
+ public FilterArg geoLength(final FilterArg first, final FilterArg second) {
+ return new FilterFunction("geo.length", first, second);
+ }
+
+ @Override
+ public FilterArg any(final FilterArg collection, final URIFilter expression) {
+ return new FilterLambda(collection, "any", expression);
+ }
+
+ @Override
+ public FilterArg all(final FilterArg collection, final URIFilter expression) {
+ return new FilterLambda(collection, "all", expression);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bab03624/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/v4/FilterFactoryImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/v4/FilterFactoryImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/v4/FilterFactoryImpl.java
new file mode 100644
index 0000000..2acf1c3
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/v4/FilterFactoryImpl.java
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.uri.v4;
+
+import org.apache.olingo.client.api.uri.FilterArg;
+import org.apache.olingo.client.api.uri.URIFilter;
+import org.apache.olingo.client.api.uri.v4.FilterArgFactory;
+import org.apache.olingo.client.api.uri.v4.FilterFactory;
+import org.apache.olingo.client.core.uri.AbstractFilterFactory;
+import org.apache.olingo.client.core.uri.FilterProperty;
+import org.apache.olingo.client.core.uri.HasFilter;
+import org.apache.olingo.commons.api.edm.EdmEnumType;
+
+public class FilterFactoryImpl extends AbstractFilterFactory implements FilterFactory {
+
+ private static final long serialVersionUID = -5358934829490623191L;
+
+ @Override
+ public FilterArgFactory getArgFactory() {
+ return new FilterArgFactoryImpl();
+ }
+
+ @Override
+ public URIFilter has(final String key, final EdmEnumType enumType, final String memberName) {
+ return has(getArgFactory().property(key), enumType, memberName);
+ }
+
+ @Override
+ public URIFilter has(final FilterArg left, final EdmEnumType enumType, final String memberName) {
+ return new HasFilter(left, new FilterProperty(enumType.toUriLiteral(memberName)));
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bab03624/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/v4/URIBuilderImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/v4/URIBuilderImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/v4/URIBuilderImpl.java
new file mode 100644
index 0000000..ae4284d
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/v4/URIBuilderImpl.java
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.uri.v4;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.olingo.client.api.uri.QueryOption;
+import org.apache.olingo.client.api.uri.SegmentType;
+import org.apache.olingo.client.api.uri.v4.URIBuilder;
+import org.apache.olingo.client.core.uri.AbstractURIBuilder;
+
+public class URIBuilderImpl extends AbstractURIBuilder<URIBuilder> implements URIBuilder {
+
+ private static final long serialVersionUID = -3506851722447870532L;
+
+ public URIBuilderImpl(final String serviceRoot) {
+ super(serviceRoot);
+ }
+
+ @Override
+ protected URIBuilder getThis() {
+ return this;
+ }
+
+ @Override
+ protected String noKeysWrapper() {
+ return "()";
+ }
+
+ @Override
+ protected char getBoundOperationSeparator() {
+ return '.';
+ }
+
+ @Override
+ protected char getDerivedEntityTypeSeparator() {
+ return '.';
+ }
+
+ @Override
+ public URIBuilder appendSingletonSegment(final String segmentValue) {
+ segments.add(new Segment(SegmentType.SINGLETON, segmentValue));
+ return getThis();
+ }
+
+ @Override
+ public URIBuilder appendEntityIdSegment(final String segmentValue) {
+ segments.add(new Segment(SegmentType.ENTITY, null));
+ return addQueryOption(QueryOption.ID, segmentValue);
+ }
+
+ @Override
+ public URIBuilder appendRefSegment() {
+ segments.add(new Segment(SegmentType.REF, SegmentType.REF.getValue()));
+ return getThis();
+ }
+
+ @Override
+ public URIBuilder appendCrossjoinSegment(final String... segmentValues) {
+ StringBuilder segValue = new StringBuilder(SegmentType.CROSS_JOIN.getValue()).
+ append('(').append(StringUtils.join(segmentValues, ",")).append(')');
+ segments.add(new Segment(SegmentType.CROSS_JOIN, segValue.toString()));
+ return getThis();
+ }
+
+ @Override
+ public URIBuilder count(final boolean value) {
+ return addQueryOption(QueryOption.COUNT, Boolean.toString(value));
+ }
+
+ @Override
+ public URIBuilder appendAllSegment() {
+ segments.add(new Segment(SegmentType.ALL, SegmentType.ALL.getValue()));
+ return getThis();
+ }
+
+ @Override
+ public URIBuilder id(final String idValue) {
+ return addQueryOption(QueryOption.ID, idValue);
+ }
+
+ @Override
+ public URIBuilder search(final String expression) {
+ return addQueryOption(QueryOption.SEARCH, expression);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bab03624/lib/client-core/src/main/java/org/apache/olingo/client/core/v3/ConfigurationImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/v3/ConfigurationImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/v3/ConfigurationImpl.java
new file mode 100644
index 0000000..04ec3f7
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/v3/ConfigurationImpl.java
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.v3;
+
+import org.apache.olingo.client.api.v3.Configuration;
+import org.apache.olingo.client.core.AbstractConfiguration;
+
+public class ConfigurationImpl extends AbstractConfiguration implements Configuration {
+
+ private static final long serialVersionUID = -8719958537946884777L;
+
+ private static final String KEY_AS_SEGMENT = "keyAsSegment";
+
+ protected ConfigurationImpl() {
+ super();
+ }
+
+ /**
+ * Checks whether URIs contain entity key between parentheses (standard) or instead as additional segment. Example:
+ * http://services.odata.org/V4/OData/OData.svc/Products(0) or http://services.odata.org/V4/OData/OData.svc/Products/0
+ *
+ * @return whether URIs shall be built with entity key between parentheses (standard) or instead as additional
+ * segment.
+ */
+ @Override
+ public boolean isKeyAsSegment() {
+ return (Boolean) getProperty(KEY_AS_SEGMENT, false);
+ }
+
+ /**
+ * Sets whether URIs shall be built with entity key between parentheses (standard) or instead as additional segment.
+ * Example: http://services.odata.org/V4/OData/OData.svc/Products(0) or
+ * http://services.odata.org/V4/OData/OData.svc/Products/0
+ *
+ * @param value 'TRUE' to use this feature.
+ */
+ @Override
+ public void setKeyAsSegment(final boolean value) {
+ setProperty(KEY_AS_SEGMENT, value);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata4/blob/bab03624/lib/client-core/src/main/java/org/apache/olingo/client/core/v3/ODataClientImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/v3/ODataClientImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/v3/ODataClientImpl.java
new file mode 100644
index 0000000..b7f0c3b
--- /dev/null
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/v3/ODataClientImpl.java
@@ -0,0 +1,150 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.client.core.v3;
+
+import org.apache.olingo.client.api.v3.ODataClient;
+import org.apache.olingo.client.api.v3.Configuration;
+import org.apache.olingo.client.api.communication.header.HeaderName;
+import org.apache.olingo.client.api.communication.header.ODataHeaders;
+import org.apache.olingo.client.api.communication.request.batch.v3.BatchRequestFactory;
+import org.apache.olingo.client.api.communication.request.cud.v3.CUDRequestFactory;
+import org.apache.olingo.client.api.communication.request.invoke.v3.InvokeRequestFactory;
+import org.apache.olingo.client.api.communication.request.retrieve.v3.RetrieveRequestFactory;
+import org.apache.olingo.client.api.communication.request.streamed.v3.StreamedRequestFactory;
+import org.apache.olingo.client.api.op.ODataSerializer;
+import org.apache.olingo.client.api.op.v3.ODataDeserializer;
+import org.apache.olingo.client.api.op.v3.ODataBinder;
+import org.apache.olingo.client.api.op.v3.ODataReader;
+import org.apache.olingo.client.api.uri.v3.URIBuilder;
+import org.apache.olingo.client.api.uri.v3.FilterFactory;
+import org.apache.olingo.client.core.AbstractODataClient;
+import org.apache.olingo.client.core.communication.header.ODataHeadersImpl;
+import org.apache.olingo.client.core.communication.request.batch.v3.BatchRequestFactoryImpl;
+import org.apache.olingo.client.core.communication.request.cud.v3.CUDRequestFactoryImpl;
+import org.apache.olingo.client.core.communication.request.invoke.v3.InvokeRequestFactoryImpl;
+import org.apache.olingo.client.core.communication.request.retrieve.v3.RetrieveRequestFactoryImpl;
+import org.apache.olingo.client.core.communication.request.streamed.v3.StreamedRequestFactoryImpl;
+import org.apache.olingo.client.core.op.impl.v3.ODataBinderImpl;
+import org.apache.olingo.client.core.op.impl.v3.ODataDeserializerImpl;
+import org.apache.olingo.client.core.op.impl.v3.ODataReaderImpl;
+import org.apache.olingo.client.core.op.impl.v3.ODataSerializerImpl;
+import org.apache.olingo.client.core.uri.v3.URIBuilderImpl;
+import org.apache.olingo.client.core.uri.v3.FilterFactoryImpl;
+import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
+
+public class ODataClientImpl extends AbstractODataClient implements ODataClient {
+
+ private static final long serialVersionUID = -1655712193243609209L;
+
+ private final Configuration configuration = new ConfigurationImpl();
+
+ private final FilterFactory filterFactory = new FilterFactoryImpl();
+
+ private final ODataDeserializer deserializer = new ODataDeserializerImpl(this);
+
+ private final ODataSerializer serializer = new ODataSerializerImpl(this);
+
+ private final ODataReader reader = new ODataReaderImpl(this);
+
+ private final ODataBinder binder = new ODataBinderImpl(this);
+
+ private final RetrieveRequestFactory retrieveReqFact = new RetrieveRequestFactoryImpl(this);
+
+ private final CUDRequestFactory cudReqFact = new CUDRequestFactoryImpl(this);
+
+ private final StreamedRequestFactory streamedReqFact = new StreamedRequestFactoryImpl(this);
+
+ private final InvokeRequestFactory invokeReqFact = new InvokeRequestFactoryImpl(this);
+
+ private final BatchRequestFactory batchReqFact = new BatchRequestFactoryImpl(this);
+
+ @Override
+ public ODataServiceVersion getServiceVersion() {
+ return ODataServiceVersion.V30;
+ }
+
+ @Override
+ public ODataHeaders getVersionHeaders() {
+ final ODataHeadersImpl odataHeaders = new ODataHeadersImpl();
+ odataHeaders.setHeader(HeaderName.minDataServiceVersion, ODataServiceVersion.V30.toString());
+ odataHeaders.setHeader(HeaderName.maxDataServiceVersion, ODataServiceVersion.V30.toString());
+ odataHeaders.setHeader(HeaderName.dataServiceVersion, ODataServiceVersion.V30.toString());
+ return odataHeaders;
+ }
+
+ @Override
+ public Configuration getConfiguration() {
+ return configuration;
+ }
+
+ @Override
+ public URIBuilder getURIBuilder(final String serviceRoot) {
+ return new URIBuilderImpl(configuration, serviceRoot);
+ }
+
+ @Override
+ public FilterFactory getFilterFactory() {
+ return filterFactory;
+ }
+
+ @Override
+ public ODataDeserializer getDeserializer() {
+ return deserializer;
+ }
+
+ @Override
+ public ODataSerializer getSerializer() {
+ return serializer;
+ }
+
+ @Override
+ public ODataReader getReader() {
+ return reader;
+ }
+
+ @Override
+ public ODataBinder getBinder() {
+ return binder;
+ }
+
+ @Override
+ public RetrieveRequestFactory getRetrieveRequestFactory() {
+ return retrieveReqFact;
+ }
+
+ @Override
+ public CUDRequestFactory getCUDRequestFactory() {
+ return cudReqFact;
+ }
+
+ @Override
+ public StreamedRequestFactory getStreamedRequestFactory() {
+ return streamedReqFact;
+ }
+
+ @Override
+ public InvokeRequestFactory getInvokeRequestFactory() {
+ return invokeReqFact;
+ }
+
+ @Override
+ public BatchRequestFactory getBatchRequestFactory() {
+ return batchReqFact;
+ }
+}