http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/111239d7/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/ODataBinderImpl.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/ODataBinderImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/ODataBinderImpl.java index b14ea6b..86d1847 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/ODataBinderImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/ODataBinderImpl.java @@ -44,23 +44,23 @@ import org.apache.olingo.commons.api.data.ValueType; import org.apache.olingo.commons.api.domain.CommonODataEntity; import org.apache.olingo.commons.api.domain.CommonODataEntitySet; import org.apache.olingo.commons.api.domain.CommonODataProperty; +import org.apache.olingo.commons.api.domain.ODataAnnotatable; +import org.apache.olingo.commons.api.domain.ODataAnnotation; import org.apache.olingo.commons.api.domain.ODataCollectionValue; +import org.apache.olingo.commons.api.domain.ODataDelta; +import org.apache.olingo.commons.api.domain.ODataDeltaLink; +import org.apache.olingo.commons.api.domain.ODataEntity; +import org.apache.olingo.commons.api.domain.ODataEntitySet; import org.apache.olingo.commons.api.domain.ODataInlineEntity; import org.apache.olingo.commons.api.domain.ODataInlineEntitySet; +import org.apache.olingo.commons.api.domain.ODataLink; import org.apache.olingo.commons.api.domain.ODataLinked; +import org.apache.olingo.commons.api.domain.ODataLinkedComplexValue; +import org.apache.olingo.commons.api.domain.ODataProperty; import org.apache.olingo.commons.api.domain.ODataServiceDocument; +import org.apache.olingo.commons.api.domain.ODataValuable; import org.apache.olingo.commons.api.domain.ODataValue; -import org.apache.olingo.commons.api.domain.v4.ODataAnnotatable; -import org.apache.olingo.commons.api.domain.v4.ODataAnnotation; -import org.apache.olingo.commons.api.domain.v4.ODataDeletedEntity.Reason; -import org.apache.olingo.commons.api.domain.v4.ODataDelta; -import org.apache.olingo.commons.api.domain.v4.ODataDeltaLink; -import org.apache.olingo.commons.api.domain.v4.ODataEntity; -import org.apache.olingo.commons.api.domain.v4.ODataEntitySet; -import org.apache.olingo.commons.api.domain.v4.ODataLink; -import org.apache.olingo.commons.api.domain.v4.ODataLinkedComplexValue; -import org.apache.olingo.commons.api.domain.v4.ODataProperty; -import org.apache.olingo.commons.api.domain.v4.ODataValuable; +import org.apache.olingo.commons.api.domain.ODataDeletedEntity.Reason; import org.apache.olingo.commons.api.edm.EdmComplexType; import org.apache.olingo.commons.api.edm.EdmElement; import org.apache.olingo.commons.api.edm.EdmEnumType; @@ -71,10 +71,10 @@ import org.apache.olingo.commons.api.edm.geo.Geospatial; import org.apache.olingo.commons.core.data.AnnotationImpl; import org.apache.olingo.commons.core.data.LinkedComplexValueImpl; import org.apache.olingo.commons.core.data.PropertyImpl; -import org.apache.olingo.commons.core.domain.v4.ODataAnnotationImpl; -import org.apache.olingo.commons.core.domain.v4.ODataDeletedEntityImpl; -import org.apache.olingo.commons.core.domain.v4.ODataDeltaLinkImpl; -import org.apache.olingo.commons.core.domain.v4.ODataPropertyImpl; +import org.apache.olingo.commons.core.domain.ODataAnnotationImpl; +import org.apache.olingo.commons.core.domain.ODataDeletedEntityImpl; +import org.apache.olingo.commons.core.domain.ODataDeltaLinkImpl; +import org.apache.olingo.commons.core.domain.ODataPropertyImpl; import org.apache.olingo.commons.core.edm.EdmTypeInfo; import org.apache.olingo.commons.core.serialization.ContextURLParser; @@ -133,10 +133,10 @@ public class ODataBinderImpl extends AbstractODataBinder implements ODataBinder propertyValue instanceof LinkedComplexValue ? ValueType.LINKED_COMPLEX : ValueType.COMPLEX, propertyValue); } else if (odataValuable.hasCollectionValue()) { - final ODataCollectionValue<org.apache.olingo.commons.api.domain.v4.ODataValue> collectionValue = + final ODataCollectionValue<org.apache.olingo.commons.api.domain.ODataValue> collectionValue = odataValuable.getCollectionValue(); propertyResource.setType(collectionValue.getTypeName()); - final org.apache.olingo.commons.api.domain.v4.ODataValue value = + final org.apache.olingo.commons.api.domain.ODataValue value = collectionValue.iterator().hasNext() ? collectionValue.iterator().next() : null; ValueType valueType = ValueType.COLLECTION_PRIMITIVE; if (value == null) { @@ -211,22 +211,22 @@ public class ODataBinderImpl extends AbstractODataBinder implements ODataBinder @SuppressWarnings("unchecked") protected Object getValue(final ODataValue value) { Object valueResource; - if (value instanceof org.apache.olingo.commons.api.domain.v4.ODataValue - && ((org.apache.olingo.commons.api.domain.v4.ODataValue) value).isEnum()) { + if (value instanceof org.apache.olingo.commons.api.domain.ODataValue + && ((org.apache.olingo.commons.api.domain.ODataValue) value).isEnum()) { valueResource = - ((org.apache.olingo.commons.api.domain.v4.ODataValue) value).asEnum().getValue(); + ((org.apache.olingo.commons.api.domain.ODataValue) value).asEnum().getValue(); } else { valueResource = super.getValue(value); - if (value instanceof org.apache.olingo.commons.api.domain.v4.ODataValue - && ((org.apache.olingo.commons.api.domain.v4.ODataValue) value).isLinkedComplex()) { + if (value instanceof org.apache.olingo.commons.api.domain.ODataValue + && ((org.apache.olingo.commons.api.domain.ODataValue) value).isLinkedComplex()) { final LinkedComplexValue lcValueResource = new LinkedComplexValueImpl(); lcValueResource.getValue().addAll((List<Property>) valueResource); final ODataLinkedComplexValue linked = - ((org.apache.olingo.commons.api.domain.v4.ODataValue) value).asLinkedComplex(); + ((org.apache.olingo.commons.api.domain.ODataValue) value).asLinkedComplex(); annotations(linked, lcValueResource); links(linked, lcValueResource); @@ -255,7 +255,7 @@ public class ODataBinderImpl extends AbstractODataBinder implements ODataBinder } final ODataAnnotation odataAnnotation = new ODataAnnotationImpl(annotation.getTerm(), - (org.apache.olingo.commons.api.domain.v4.ODataValue) getODataValue(fqn, annotation, null, null)); + (org.apache.olingo.commons.api.domain.ODataValue) getODataValue(fqn, annotation, null, null)); odataAnnotatable.getAnnotations().add(odataAnnotation); } }
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/111239d7/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/ODataReaderImpl.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/ODataReaderImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/ODataReaderImpl.java index 1480556..f9a7893 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/ODataReaderImpl.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/serialization/ODataReaderImpl.java @@ -22,9 +22,9 @@ import java.io.InputStream; import org.apache.olingo.client.api.ODataClient; import org.apache.olingo.client.api.serialization.ODataReader; -import org.apache.olingo.commons.api.domain.v4.ODataEntity; -import org.apache.olingo.commons.api.domain.v4.ODataEntitySet; -import org.apache.olingo.commons.api.domain.v4.ODataProperty; +import org.apache.olingo.commons.api.domain.ODataEntity; +import org.apache.olingo.commons.api.domain.ODataEntitySet; +import org.apache.olingo.commons.api.domain.ODataProperty; import org.apache.olingo.commons.api.format.ODataFormat; import org.apache.olingo.commons.api.serialization.ODataDeserializerException; http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/111239d7/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/URIUtils.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/URIUtils.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/URIUtils.java index 700e7f2..6a83239 100644 --- a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/URIUtils.java +++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/URIUtils.java @@ -431,10 +431,10 @@ public final class URIUtils { value = param.getValue().asComplex().asJavaMap(); } else if (param.getValue().isCollection()) { value = param.getValue().asCollection().asJavaCollection(); - } else if (param.getValue() instanceof org.apache.olingo.commons.api.domain.v4.ODataValue - && ((org.apache.olingo.commons.api.domain.v4.ODataValue) param.getValue()).isEnum()) { + } else if (param.getValue() instanceof org.apache.olingo.commons.api.domain.ODataValue + && ((org.apache.olingo.commons.api.domain.ODataValue) param.getValue()).isEnum()) { - value = ((org.apache.olingo.commons.api.domain.v4.ODataValue) param.getValue()).asEnum().toString(); + value = ((org.apache.olingo.commons.api.domain.ODataValue) param.getValue()).asEnum().toString(); } inlineParams.append(URIUtils.escape(serviceVersion, value)).append(','); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/111239d7/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/EntitySetTest.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/EntitySetTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/EntitySetTest.java index bd0158f..b8282e2 100644 --- a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/EntitySetTest.java +++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/EntitySetTest.java @@ -22,8 +22,8 @@ import org.apache.olingo.client.api.ODataClient; import org.apache.olingo.client.core.AbstractTest; import org.apache.olingo.commons.api.data.EntitySet; import org.apache.olingo.commons.api.data.ResWrap; -import org.apache.olingo.commons.api.domain.v4.ODataEntity; -import org.apache.olingo.commons.api.domain.v4.ODataEntitySet; +import org.apache.olingo.commons.api.domain.ODataEntity; +import org.apache.olingo.commons.api.domain.ODataEntitySet; import org.apache.olingo.commons.api.format.ODataFormat; import org.apache.olingo.commons.api.serialization.ODataDeserializerException; import org.junit.Test; http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/111239d7/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/EntityTest.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/EntityTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/EntityTest.java index 8f6f253..2b2882e 100644 --- a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/EntityTest.java +++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/EntityTest.java @@ -33,15 +33,15 @@ import org.apache.olingo.client.core.AbstractTest; import org.apache.olingo.client.core.EdmEnabledODataClientImpl; import org.apache.olingo.commons.api.data.Entity; import org.apache.olingo.commons.api.data.ResWrap; +import org.apache.olingo.commons.api.domain.ODataAnnotation; +import org.apache.olingo.commons.api.domain.ODataEntity; import org.apache.olingo.commons.api.domain.ODataInlineEntitySet; import org.apache.olingo.commons.api.domain.ODataLink; import org.apache.olingo.commons.api.domain.ODataLinkType; -import org.apache.olingo.commons.api.domain.v4.ODataValue; -import org.apache.olingo.commons.api.domain.v4.ODataAnnotation; -import org.apache.olingo.commons.api.domain.v4.ODataEntity; -import org.apache.olingo.commons.api.domain.v4.ODataLinkedComplexValue; -import org.apache.olingo.commons.api.domain.v4.ODataProperty; -import org.apache.olingo.commons.api.domain.v4.ODataValuable; +import org.apache.olingo.commons.api.domain.ODataLinkedComplexValue; +import org.apache.olingo.commons.api.domain.ODataProperty; +import org.apache.olingo.commons.api.domain.ODataValuable; +import org.apache.olingo.commons.api.domain.ODataValue; import org.apache.olingo.commons.api.edm.Edm; import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException; import org.apache.olingo.commons.api.format.ODataFormat; @@ -329,9 +329,9 @@ public class EntityTest extends AbstractTest { assertTrue(annotation.hasComplexValue()); final ODataLink orders = entity.getNavigationLink("Orders"); - assertFalse(((org.apache.olingo.commons.api.domain.v4.ODataLink) orders).getAnnotations().isEmpty()); + assertFalse(((org.apache.olingo.commons.api.domain.ODataLink) orders).getAnnotations().isEmpty()); - annotation = ((org.apache.olingo.commons.api.domain.v4.ODataLink) orders).getAnnotations().get(0); + annotation = ((org.apache.olingo.commons.api.domain.ODataLink) orders).getAnnotations().get(0); assertEquals("com.contoso.display.style", annotation.getTerm()); assertEquals("com.contoso.display.styleType", annotation.getValue().getTypeName()); assertTrue(annotation.hasComplexValue()); http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/111239d7/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/JSONTest.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/JSONTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/JSONTest.java index d70a07f..3a107a4 100644 --- a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/JSONTest.java +++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/JSONTest.java @@ -41,9 +41,9 @@ import org.apache.olingo.commons.api.data.Delta; import org.apache.olingo.commons.api.data.Property; import org.apache.olingo.commons.api.domain.ODataCollectionValue; import org.apache.olingo.commons.api.domain.ODataComplexValue; -import org.apache.olingo.commons.api.domain.v4.ODataEntity; -import org.apache.olingo.commons.api.domain.v4.ODataProperty; -import org.apache.olingo.commons.api.domain.v4.ODataValue; +import org.apache.olingo.commons.api.domain.ODataEntity; +import org.apache.olingo.commons.api.domain.ODataProperty; +import org.apache.olingo.commons.api.domain.ODataValue; import org.apache.olingo.commons.api.edm.FullQualifiedName; import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion; import org.apache.olingo.commons.api.format.ODataFormat; http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/111239d7/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/PropertyTest.java ---------------------------------------------------------------------- diff --git a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/PropertyTest.java b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/PropertyTest.java index 91d0752..8de5e4f 100644 --- a/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/PropertyTest.java +++ b/lib/client-core/src/test/java/org/apache/olingo/client/core/v4/PropertyTest.java @@ -22,8 +22,8 @@ import org.apache.olingo.client.api.ODataClient; import org.apache.olingo.client.core.AbstractTest; import org.apache.olingo.commons.api.domain.ODataCollectionValue; import org.apache.olingo.commons.api.domain.ODataComplexValue; -import org.apache.olingo.commons.api.domain.v4.ODataProperty; -import org.apache.olingo.commons.api.domain.v4.ODataValue; +import org.apache.olingo.commons.api.domain.ODataProperty; +import org.apache.olingo.commons.api.domain.ODataValue; import org.apache.olingo.commons.api.format.ODataFormat; import org.apache.olingo.commons.api.serialization.ODataDeserializerException; import org.apache.olingo.commons.api.serialization.ODataSerializerException; http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/111239d7/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataAnnotatable.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataAnnotatable.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataAnnotatable.java new file mode 100644 index 0000000..fe10fba --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataAnnotatable.java @@ -0,0 +1,26 @@ +/* + * 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.commons.api.domain; + +import java.util.List; + +public interface ODataAnnotatable { + + List<ODataAnnotation> getAnnotations(); +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/111239d7/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataAnnotation.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataAnnotation.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataAnnotation.java new file mode 100644 index 0000000..ec00417 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataAnnotation.java @@ -0,0 +1,30 @@ +/* + * 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.commons.api.domain; + +public interface ODataAnnotation extends ODataValuable { + + /** + * Returns annotation name. + * + * @return annotation name. + */ + String getTerm(); + +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/111239d7/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataDeletedEntity.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataDeletedEntity.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataDeletedEntity.java new file mode 100644 index 0000000..3b7a1bf --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataDeletedEntity.java @@ -0,0 +1,36 @@ +/* + * 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.commons.api.domain; + +import java.net.URI; + +public interface ODataDeletedEntity { + + enum Reason { + + deleted, + changed; + + } + + URI getId(); + + Reason getReason(); + +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/111239d7/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataDelta.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataDelta.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataDelta.java new file mode 100644 index 0000000..5492750 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataDelta.java @@ -0,0 +1,31 @@ +/* + * 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.commons.api.domain; + +import java.util.List; + +public interface ODataDelta extends ODataEntitySet { + + List<ODataDeletedEntity> getDeletedEntities(); + + List<ODataDeltaLink> getAddedLinks(); + + List<ODataDeltaLink> getDeletedLinks(); + +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/111239d7/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataDeltaLink.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataDeltaLink.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataDeltaLink.java new file mode 100644 index 0000000..757def9 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataDeltaLink.java @@ -0,0 +1,36 @@ +/* + * 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.commons.api.domain; + +import java.net.URI; + +public interface ODataDeltaLink extends ODataAnnotatable { + + URI getSource(); + + void setSource(URI source); + + String getRelationship(); + + void setRelationship(String relationship); + + URI getTarget(); + + void setTarget(URI target); +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/111239d7/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataEntity.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataEntity.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataEntity.java new file mode 100644 index 0000000..bacda58 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataEntity.java @@ -0,0 +1,52 @@ +/* + * 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.commons.api.domain; + +import java.net.URI; +import java.util.List; + +public interface ODataEntity extends CommonODataEntity, ODataAnnotatable { + + @Override + ODataProperty getProperty(String name); + + @Override + List<ODataProperty> getProperties(); + + /** + * To request entity references in place of the actual entities, the client issues a GET request with /$ref appended + * to the resource path. + * <br /> + * If the resource path does not identify an entity or a collection of entities, the service returns 404 Not Found. + * <br /> + * If the resource path terminates on a collection, the response MUST be the format-specific representation of a + * collection of entity references pointing to the related entities. If no entities are related, the response is the + * format-specific representation of an empty collection. + * <br /> + * If the resource path terminates on a single entity, the response MUST be the format-specific representation of an + * entity reference pointing to the related single entity. If the resource path terminates on a single entity and no + * such entity exists, the service returns 404 Not Found. + * + * @return entity reference. + */ + URI getId(); + + void setId(URI id); + +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/111239d7/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataEntitySet.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataEntitySet.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataEntitySet.java new file mode 100644 index 0000000..bce642a --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataEntitySet.java @@ -0,0 +1,42 @@ +/* + * 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.commons.api.domain; + +import java.net.URI; +import java.util.List; + +public interface ODataEntitySet extends CommonODataEntitySet, ODataAnnotatable { + + @Override + List<ODataEntity> getEntities(); + + /** + * Gets delta link if exists. + * + * @return delta link if exists; null otherwise. + */ + URI getDeltaLink(); + + /** + * Sets delta link. + * + * @param deltaLink delta link. + */ + void setDeltaLink(URI deltaLink); +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/111239d7/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataEnumValue.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataEnumValue.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataEnumValue.java new file mode 100644 index 0000000..ef5852d --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataEnumValue.java @@ -0,0 +1,27 @@ +/* + * 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.commons.api.domain; + +public interface ODataEnumValue extends ODataValue { + + String getValue(); + + @Override + String toString(); +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/111239d7/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataLink.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataLink.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataLink.java index b2aea49..574ff0d 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataLink.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataLink.java @@ -18,14 +18,16 @@ */ package org.apache.olingo.commons.api.domain; -import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion; - import java.net.URI; +import java.util.ArrayList; +import java.util.List; + +import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion; /** * OData link. */ -public class ODataLink extends ODataItem { +public class ODataLink extends ODataItem implements ODataAnnotatable{ public static class Builder { @@ -105,6 +107,8 @@ public class ODataLink extends ODataItem { */ protected String mediaETag; + private final List<ODataAnnotation> annotations = new ArrayList<ODataAnnotation>(); + /** * Constructor. * @@ -113,7 +117,7 @@ public class ODataLink extends ODataItem { * @param type type. * @param title title. */ - protected ODataLink(final ODataServiceVersion version, final URI uri, final ODataLinkType type, final String title) { + public ODataLink(final ODataServiceVersion version, final URI uri, final ODataLinkType type, final String title) { super(title); link = uri; @@ -185,4 +189,8 @@ public class ODataLink extends ODataItem { public String getMediaETag() { return mediaETag; } + + public List<ODataAnnotation> getAnnotations() { + return annotations; + } } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/111239d7/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataLinkedComplexValue.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataLinkedComplexValue.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataLinkedComplexValue.java new file mode 100644 index 0000000..3009c78 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataLinkedComplexValue.java @@ -0,0 +1,25 @@ +/* + * 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.commons.api.domain; + + +public interface ODataLinkedComplexValue + extends ODataValue, ODataLinked, ODataComplexValue<ODataProperty>, ODataAnnotatable { + +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/111239d7/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataObjectFactory.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataObjectFactory.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataObjectFactory.java new file mode 100644 index 0000000..52b49e6 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataObjectFactory.java @@ -0,0 +1,79 @@ +/* + * 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.commons.api.domain; + +import org.apache.olingo.commons.api.edm.FullQualifiedName; + +import java.net.URI; + +public interface ODataObjectFactory extends CommonODataObjectFactory { + + @Override + ODataEntitySet newEntitySet(); + + @Override + ODataEntitySet newEntitySet(URI next); + + @Override + ODataEntity newEntity(FullQualifiedName typeName); + + @Override + ODataEntity newEntity(FullQualifiedName typeName, URI link); + + ODataSingleton newSingleton(FullQualifiedName typeName); + + @Override + ODataLink newEntitySetNavigationLink(String name, URI link); + + @Override + ODataLink newEntityNavigationLink(String name, URI link); + + @Override + ODataLink newAssociationLink(String name, URI link); + + @Override + ODataLink newMediaEditLink(String name, URI link); + + ODataEnumValue newEnumValue(String typeName, String value); + + @Override + ODataComplexValue<ODataProperty> newComplexValue(String typeName); + + ODataLinkedComplexValue newLinkedComplexValue(String typeName); + + @Override + ODataCollectionValue<ODataValue> newCollectionValue(String typeName); + + @Override + ODataProperty newPrimitiveProperty(String name, ODataPrimitiveValue value); + + ODataProperty newEnumProperty(String name, ODataEnumValue value); + + @Override + ODataProperty newComplexProperty(String name, ODataComplexValue<? extends CommonODataProperty> value); + + @Override + ODataProperty newCollectionProperty(String name, + ODataCollectionValue<? extends org.apache.olingo.commons.api.domain.ODataValue> value); + + ODataDelta newDelta(); + + ODataDelta newDelta(URI next); + +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/111239d7/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataProperty.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataProperty.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataProperty.java new file mode 100644 index 0000000..533d318 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataProperty.java @@ -0,0 +1,23 @@ +/* + * 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.commons.api.domain; + + +public interface ODataProperty extends CommonODataProperty, ODataAnnotatable, ODataValuable { +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/111239d7/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataSingleton.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataSingleton.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataSingleton.java new file mode 100644 index 0000000..6222d90 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataSingleton.java @@ -0,0 +1,21 @@ +/* + * 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.commons.api.domain; + +public interface ODataSingleton extends ODataEntity {} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/111239d7/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataValuable.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataValuable.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataValuable.java new file mode 100644 index 0000000..f8612e3 --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataValuable.java @@ -0,0 +1,101 @@ +/* + * 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.commons.api.domain; + + +public interface ODataValuable { + + /** + * Returns annotation value. + * + * @return annotation value. + */ + ODataValue getValue(); + + /** + * Checks if has null value. + * + * @return 'TRUE' if has null value; 'FALSE' otherwise. + */ + boolean hasNullValue(); + + /** + * Checks if has primitive value. + * + * @return 'TRUE' if has primitive value; 'FALSE' otherwise. + */ + boolean hasPrimitiveValue(); + + /** + * Gets primitive value. + * + * @return primitive value if exists; null otherwise. + */ + ODataPrimitiveValue getPrimitiveValue(); + + /** + * Checks if has collection value. + * + * @return 'TRUE' if has collection value; 'FALSE' otherwise. + */ + boolean hasCollectionValue(); + + /** + * Gets collection value. + * + * @return collection value if exists; null otherwise. + */ + ODataCollectionValue<ODataValue> getCollectionValue(); + + /** + * Checks if has complex value. + * + * @return 'TRUE' if has complex value; 'FALSE' otherwise. + */ + boolean hasComplexValue(); + + /** + * Gets complex value. + * + * @return complex value if exists; null otherwise. + */ + ODataComplexValue<ODataProperty> getComplexValue(); + + /** + * Gets complex value with link information (if available). + * + * @return complex value if exists; null otherwise. + */ + ODataLinkedComplexValue getLinkedComplexValue(); + + /** + * Checks if has enum value. + * + * @return 'TRUE' if has enum value; 'FALSE' otherwise. + */ + boolean hasEnumValue(); + + /** + * Gets enum value. + * + * @return enum value if exists; null otherwise. + */ + ODataEnumValue getEnumValue(); + +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/111239d7/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataValue.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataValue.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataValue.java index 7747d33..d0c69ad 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataValue.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataValue.java @@ -18,6 +18,7 @@ */ package org.apache.olingo.commons.api.domain; + /** * Abstract representation of an OData entity property value. */ @@ -74,4 +75,32 @@ public interface ODataValue { */ <OP extends CommonODataProperty> ODataComplexValue<OP> asComplex(); + /** + * Check is is a linked complex value. + * + * @return 'TRUE' if linked complex; 'FALSE' otherwise. + */ + boolean isLinkedComplex(); + + /** + * Casts to complex value with link information (if available). + * + * @return complex value with link information. + */ + ODataLinkedComplexValue asLinkedComplex(); + + /** + * Check is is an enum value. + * + * @return 'TRUE' if enum; 'FALSE' otherwise. + */ + boolean isEnum(); + + /** + * Casts to enum value. + * + * @return enum value. + */ + ODataEnumValue asEnum(); + } http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/111239d7/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataAnnotatable.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataAnnotatable.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataAnnotatable.java deleted file mode 100644 index 1426622..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataAnnotatable.java +++ /dev/null @@ -1,26 +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.commons.api.domain.v4; - -import java.util.List; - -public interface ODataAnnotatable { - - List<ODataAnnotation> getAnnotations(); -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/111239d7/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataAnnotation.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataAnnotation.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataAnnotation.java deleted file mode 100644 index 4e5eb65..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataAnnotation.java +++ /dev/null @@ -1,30 +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.commons.api.domain.v4; - -public interface ODataAnnotation extends ODataValuable { - - /** - * Returns annotation name. - * - * @return annotation name. - */ - String getTerm(); - -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/111239d7/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataDeletedEntity.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataDeletedEntity.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataDeletedEntity.java deleted file mode 100644 index 6162794..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataDeletedEntity.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.commons.api.domain.v4; - -import java.net.URI; - -public interface ODataDeletedEntity { - - enum Reason { - - deleted, - changed; - - } - - URI getId(); - - Reason getReason(); - -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/111239d7/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataDelta.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataDelta.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataDelta.java deleted file mode 100644 index a300eaf..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataDelta.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.commons.api.domain.v4; - -import java.util.List; - -public interface ODataDelta extends ODataEntitySet { - - List<ODataDeletedEntity> getDeletedEntities(); - - List<ODataDeltaLink> getAddedLinks(); - - List<ODataDeltaLink> getDeletedLinks(); - -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/111239d7/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataDeltaLink.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataDeltaLink.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataDeltaLink.java deleted file mode 100644 index dbce507..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataDeltaLink.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.commons.api.domain.v4; - -import java.net.URI; - -public interface ODataDeltaLink extends ODataAnnotatable { - - URI getSource(); - - void setSource(URI source); - - String getRelationship(); - - void setRelationship(String relationship); - - URI getTarget(); - - void setTarget(URI target); -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/111239d7/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataEntity.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataEntity.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataEntity.java deleted file mode 100644 index d3a625b..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataEntity.java +++ /dev/null @@ -1,54 +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.commons.api.domain.v4; - -import org.apache.olingo.commons.api.domain.CommonODataEntity; - -import java.net.URI; -import java.util.List; - -public interface ODataEntity extends CommonODataEntity, ODataAnnotatable { - - @Override - ODataProperty getProperty(String name); - - @Override - List<ODataProperty> getProperties(); - - /** - * To request entity references in place of the actual entities, the client issues a GET request with /$ref appended - * to the resource path. - * <br /> - * If the resource path does not identify an entity or a collection of entities, the service returns 404 Not Found. - * <br /> - * If the resource path terminates on a collection, the response MUST be the format-specific representation of a - * collection of entity references pointing to the related entities. If no entities are related, the response is the - * format-specific representation of an empty collection. - * <br /> - * If the resource path terminates on a single entity, the response MUST be the format-specific representation of an - * entity reference pointing to the related single entity. If the resource path terminates on a single entity and no - * such entity exists, the service returns 404 Not Found. - * - * @return entity reference. - */ - URI getId(); - - void setId(URI id); - -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/111239d7/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataEntitySet.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataEntitySet.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataEntitySet.java deleted file mode 100644 index 627067d..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataEntitySet.java +++ /dev/null @@ -1,44 +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.commons.api.domain.v4; - -import org.apache.olingo.commons.api.domain.CommonODataEntitySet; - -import java.net.URI; -import java.util.List; - -public interface ODataEntitySet extends CommonODataEntitySet, ODataAnnotatable { - - @Override - List<ODataEntity> getEntities(); - - /** - * Gets delta link if exists. - * - * @return delta link if exists; null otherwise. - */ - URI getDeltaLink(); - - /** - * Sets delta link. - * - * @param deltaLink delta link. - */ - void setDeltaLink(URI deltaLink); -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/111239d7/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataEnumValue.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataEnumValue.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataEnumValue.java deleted file mode 100644 index e7dec3b..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataEnumValue.java +++ /dev/null @@ -1,27 +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.commons.api.domain.v4; - -public interface ODataEnumValue extends ODataValue { - - String getValue(); - - @Override - String toString(); -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/111239d7/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataLink.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataLink.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataLink.java deleted file mode 100644 index 14906d4..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataLink.java +++ /dev/null @@ -1,73 +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.commons.api.domain.v4; - -import org.apache.olingo.commons.api.domain.ODataLinkType; -import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion; - -import java.net.URI; -import java.util.ArrayList; -import java.util.List; - -public class ODataLink extends org.apache.olingo.commons.api.domain.ODataLink implements ODataAnnotatable { - - public static class Builder extends org.apache.olingo.commons.api.domain.ODataLink.Builder { - - @Override - public Builder setVersion(final ODataServiceVersion version) { - super.setVersion(version); - return this; - } - - @Override - public Builder setURI(final URI uri) { - super.setURI(uri); - return this; - } - - @Override - public Builder setType(final ODataLinkType type) { - super.setType(type); - return this; - } - - @Override - public Builder setTitle(final String title) { - super.setTitle(title); - return this; - } - - @Override - public ODataLink build() { - return new ODataLink(version, uri, type, title); - } - } - - private final List<ODataAnnotation> annotations = new ArrayList<ODataAnnotation>(); - - public ODataLink(final ODataServiceVersion version, final URI uri, final ODataLinkType type, final String title) { - super(version, uri, type, title); - } - - @Override - public List<ODataAnnotation> getAnnotations() { - return annotations; - } - -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/111239d7/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataLinkedComplexValue.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataLinkedComplexValue.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataLinkedComplexValue.java deleted file mode 100644 index 01db3e6..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataLinkedComplexValue.java +++ /dev/null @@ -1,27 +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.commons.api.domain.v4; - -import org.apache.olingo.commons.api.domain.ODataComplexValue; -import org.apache.olingo.commons.api.domain.ODataLinked; - -public interface ODataLinkedComplexValue - extends ODataValue, ODataLinked, ODataComplexValue<ODataProperty>, ODataAnnotatable { - -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/111239d7/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataObjectFactory.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataObjectFactory.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataObjectFactory.java deleted file mode 100644 index 972bad8..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataObjectFactory.java +++ /dev/null @@ -1,84 +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.commons.api.domain.v4; - -import org.apache.olingo.commons.api.domain.CommonODataObjectFactory; -import org.apache.olingo.commons.api.domain.CommonODataProperty; -import org.apache.olingo.commons.api.domain.ODataCollectionValue; -import org.apache.olingo.commons.api.domain.ODataComplexValue; -import org.apache.olingo.commons.api.domain.ODataPrimitiveValue; -import org.apache.olingo.commons.api.edm.FullQualifiedName; - -import java.net.URI; - -public interface ODataObjectFactory extends CommonODataObjectFactory { - - @Override - ODataEntitySet newEntitySet(); - - @Override - ODataEntitySet newEntitySet(URI next); - - @Override - ODataEntity newEntity(FullQualifiedName typeName); - - @Override - ODataEntity newEntity(FullQualifiedName typeName, URI link); - - ODataSingleton newSingleton(FullQualifiedName typeName); - - @Override - ODataLink newEntitySetNavigationLink(String name, URI link); - - @Override - ODataLink newEntityNavigationLink(String name, URI link); - - @Override - ODataLink newAssociationLink(String name, URI link); - - @Override - ODataLink newMediaEditLink(String name, URI link); - - ODataEnumValue newEnumValue(String typeName, String value); - - @Override - ODataComplexValue<ODataProperty> newComplexValue(String typeName); - - ODataLinkedComplexValue newLinkedComplexValue(String typeName); - - @Override - ODataCollectionValue<ODataValue> newCollectionValue(String typeName); - - @Override - ODataProperty newPrimitiveProperty(String name, ODataPrimitiveValue value); - - ODataProperty newEnumProperty(String name, ODataEnumValue value); - - @Override - ODataProperty newComplexProperty(String name, ODataComplexValue<? extends CommonODataProperty> value); - - @Override - ODataProperty newCollectionProperty(String name, - ODataCollectionValue<? extends org.apache.olingo.commons.api.domain.ODataValue> value); - - ODataDelta newDelta(); - - ODataDelta newDelta(URI next); - -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/111239d7/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataProperty.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataProperty.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataProperty.java deleted file mode 100644 index f809681..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataProperty.java +++ /dev/null @@ -1,24 +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.commons.api.domain.v4; - -import org.apache.olingo.commons.api.domain.CommonODataProperty; - -public interface ODataProperty extends CommonODataProperty, ODataAnnotatable, ODataValuable { -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/111239d7/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataSingleton.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataSingleton.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataSingleton.java deleted file mode 100644 index f166c9f..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataSingleton.java +++ /dev/null @@ -1,21 +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.commons.api.domain.v4; - -public interface ODataSingleton extends ODataEntity {} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/111239d7/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataValuable.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataValuable.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataValuable.java deleted file mode 100644 index cf8911a..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataValuable.java +++ /dev/null @@ -1,104 +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.commons.api.domain.v4; - -import org.apache.olingo.commons.api.domain.ODataCollectionValue; -import org.apache.olingo.commons.api.domain.ODataComplexValue; -import org.apache.olingo.commons.api.domain.ODataPrimitiveValue; - -public interface ODataValuable { - - /** - * Returns annotation value. - * - * @return annotation value. - */ - ODataValue getValue(); - - /** - * Checks if has null value. - * - * @return 'TRUE' if has null value; 'FALSE' otherwise. - */ - boolean hasNullValue(); - - /** - * Checks if has primitive value. - * - * @return 'TRUE' if has primitive value; 'FALSE' otherwise. - */ - boolean hasPrimitiveValue(); - - /** - * Gets primitive value. - * - * @return primitive value if exists; null otherwise. - */ - ODataPrimitiveValue getPrimitiveValue(); - - /** - * Checks if has collection value. - * - * @return 'TRUE' if has collection value; 'FALSE' otherwise. - */ - boolean hasCollectionValue(); - - /** - * Gets collection value. - * - * @return collection value if exists; null otherwise. - */ - ODataCollectionValue<ODataValue> getCollectionValue(); - - /** - * Checks if has complex value. - * - * @return 'TRUE' if has complex value; 'FALSE' otherwise. - */ - boolean hasComplexValue(); - - /** - * Gets complex value. - * - * @return complex value if exists; null otherwise. - */ - ODataComplexValue<ODataProperty> getComplexValue(); - - /** - * Gets complex value with link information (if available). - * - * @return complex value if exists; null otherwise. - */ - ODataLinkedComplexValue getLinkedComplexValue(); - - /** - * Checks if has enum value. - * - * @return 'TRUE' if has enum value; 'FALSE' otherwise. - */ - boolean hasEnumValue(); - - /** - * Gets enum value. - * - * @return enum value if exists; null otherwise. - */ - ODataEnumValue getEnumValue(); - -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/111239d7/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataValue.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataValue.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataValue.java deleted file mode 100644 index 424be6d..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/v4/ODataValue.java +++ /dev/null @@ -1,50 +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.commons.api.domain.v4; - -public interface ODataValue extends org.apache.olingo.commons.api.domain.ODataValue { - - /** - * Check is is a linked complex value. - * - * @return 'TRUE' if linked complex; 'FALSE' otherwise. - */ - boolean isLinkedComplex(); - - /** - * Casts to complex value with link information (if available). - * - * @return complex value with link information. - */ - ODataLinkedComplexValue asLinkedComplex(); - - /** - * Check is is an enum value. - * - * @return 'TRUE' if enum; 'FALSE' otherwise. - */ - boolean isEnum(); - - /** - * Casts to enum value. - * - * @return enum value. - */ - ODataEnumValue asEnum(); -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/111239d7/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmConstantAnnotationExpression.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmConstantAnnotationExpression.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmConstantAnnotationExpression.java index 1d440de..21c1854 100644 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmConstantAnnotationExpression.java +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/edm/annotation/EdmConstantAnnotationExpression.java @@ -18,7 +18,7 @@ */ package org.apache.olingo.commons.api.edm.annotation; -import org.apache.olingo.commons.api.domain.v4.ODataValue; +import org.apache.olingo.commons.api.domain.ODataValue; public interface EdmConstantAnnotationExpression extends EdmAnnotationExpression { http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/111239d7/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/DeltaImpl.java ---------------------------------------------------------------------- diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/DeltaImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/DeltaImpl.java new file mode 100644 index 0000000..3165bd4 --- /dev/null +++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/DeltaImpl.java @@ -0,0 +1,48 @@ +/* + * 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.commons.core.data; + +import org.apache.olingo.commons.api.data.DeletedEntity; +import org.apache.olingo.commons.api.data.Delta; +import org.apache.olingo.commons.api.data.DeltaLink; + +import java.util.ArrayList; +import java.util.List; + +public class DeltaImpl extends EntitySetImpl implements Delta { + + private final List<DeletedEntity> deletedEntities = new ArrayList<DeletedEntity>(); + private final List<DeltaLink> addedLinks = new ArrayList<DeltaLink>(); + private final List<DeltaLink> deletedLinks = new ArrayList<DeltaLink>(); + + @Override + public List<DeletedEntity> getDeletedEntities() { + return deletedEntities; + } + + @Override + public List<DeltaLink> getAddedLinks() { + return addedLinks; + } + + @Override + public List<DeltaLink> getDeletedLinks() { + return deletedLinks; + } +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/111239d7/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/v4/DeltaImpl.java ---------------------------------------------------------------------- diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/v4/DeltaImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/v4/DeltaImpl.java deleted file mode 100755 index 6dd2a37..0000000 --- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/v4/DeltaImpl.java +++ /dev/null @@ -1,49 +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.commons.core.data.v4; - -import org.apache.olingo.commons.api.data.DeletedEntity; -import org.apache.olingo.commons.api.data.Delta; -import org.apache.olingo.commons.api.data.DeltaLink; -import org.apache.olingo.commons.core.data.EntitySetImpl; - -import java.util.ArrayList; -import java.util.List; - -public class DeltaImpl extends EntitySetImpl implements Delta { - - private final List<DeletedEntity> deletedEntities = new ArrayList<DeletedEntity>(); - private final List<DeltaLink> addedLinks = new ArrayList<DeltaLink>(); - private final List<DeltaLink> deletedLinks = new ArrayList<DeltaLink>(); - - @Override - public List<DeletedEntity> getDeletedEntities() { - return deletedEntities; - } - - @Override - public List<DeltaLink> getAddedLinks() { - return addedLinks; - } - - @Override - public List<DeltaLink> getDeletedLinks() { - return deletedLinks; - } -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/111239d7/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/ODataAnnotationImpl.java ---------------------------------------------------------------------- diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/ODataAnnotationImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/ODataAnnotationImpl.java new file mode 100644 index 0000000..140e8b8 --- /dev/null +++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/ODataAnnotationImpl.java @@ -0,0 +1,109 @@ +/* + * 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.commons.core.domain; + +import org.apache.olingo.commons.api.domain.ODataAnnotation; +import org.apache.olingo.commons.api.domain.ODataCollectionValue; +import org.apache.olingo.commons.api.domain.ODataComplexValue; +import org.apache.olingo.commons.api.domain.ODataEnumValue; +import org.apache.olingo.commons.api.domain.ODataLinkedComplexValue; +import org.apache.olingo.commons.api.domain.ODataPrimitiveValue; +import org.apache.olingo.commons.api.domain.ODataProperty; +import org.apache.olingo.commons.api.domain.ODataValuable; +import org.apache.olingo.commons.api.domain.ODataValue; + +public class ODataAnnotationImpl implements ODataAnnotation { + + private final String term; + + private final ODataValuable valuable; + + public ODataAnnotationImpl(final String term, final ODataValue value) { + this.term = term; + valuable = new ODataValuableImpl(value); + } + + @Override + public String getTerm() { + return term; + } + + @Override + public ODataValue getValue() { + return valuable.getValue(); + } + + @Override + public boolean hasNullValue() { + return valuable.hasNullValue(); + } + + @Override + public boolean hasPrimitiveValue() { + return valuable.hasPrimitiveValue(); + } + + @Override + public ODataPrimitiveValue getPrimitiveValue() { + return valuable.getPrimitiveValue(); + } + + @Override + public boolean hasCollectionValue() { + return valuable.hasCollectionValue(); + } + + @Override + public ODataCollectionValue<ODataValue> getCollectionValue() { + return valuable.getCollectionValue(); + } + + @Override + public boolean hasComplexValue() { + return valuable.hasComplexValue(); + } + + @Override + public ODataComplexValue<ODataProperty> getComplexValue() { + return valuable.getComplexValue(); + } + + @Override + public ODataLinkedComplexValue getLinkedComplexValue() { + return valuable.getLinkedComplexValue(); + } + + @Override + public boolean hasEnumValue() { + return valuable.hasEnumValue(); + } + + @Override + public ODataEnumValue getEnumValue() { + return valuable.getEnumValue(); + } + + @Override + public String toString() { + return "ODataPropertyImpl{" + + "term=" + term + + ",valuable=" + valuable + + '}'; + } +} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/111239d7/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/ODataCollectionValueImpl.java ---------------------------------------------------------------------- diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/ODataCollectionValueImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/ODataCollectionValueImpl.java new file mode 100644 index 0000000..6f519f8 --- /dev/null +++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/domain/ODataCollectionValueImpl.java @@ -0,0 +1,77 @@ +/* + * 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.commons.core.domain; + +import org.apache.olingo.commons.api.domain.ODataEnumValue; +import org.apache.olingo.commons.api.domain.ODataLinkedComplexValue; +import org.apache.olingo.commons.api.domain.ODataValue; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +public class ODataCollectionValueImpl extends AbstractODataCollectionValue<ODataValue> implements ODataValue { + + public ODataCollectionValueImpl(final String typeName) { + super(typeName); + } + + @Override + protected ODataCollectionValueImpl getThis() { + return this; + } + + @Override + public boolean isEnum() { + return false; + } + + @Override + public ODataEnumValue asEnum() { + return null; + } + + @Override + public boolean isLinkedComplex() { + return false; + } + + @Override + public ODataLinkedComplexValue asLinkedComplex() { + return null; + } + + @Override + public Collection<Object> asJavaCollection() { + final List<Object> result = new ArrayList<Object>(); + for (ODataValue value : values) { + if (value.isPrimitive()) { + result.add(value.asPrimitive().toValue()); + } else if (value.isComplex()) { + result.add(value.asComplex().asJavaMap()); + } else if (value.isCollection()) { + result.add(value.asCollection().asJavaCollection()); + } else if (value.isEnum()) { + result.add(value.asEnum().toString()); + } + } + + return result; + } +}
