http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/17152920/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Operation.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Operation.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Operation.java new file mode 100644 index 0000000..914c42c --- /dev/null +++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/data/Operation.java @@ -0,0 +1,85 @@ +/* + * 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.data; + +import java.net.URI; + +public class Operation { + + private String metadataAnchor; + + private String title; + + private URI target; + + /** + * Gets metadata anchor. + * + * @return metadata anchor. + */ + public String getMetadataAnchor() { + return metadataAnchor; + } + + /** + * Sets metadata anchor. + * + * @param metadataAnchor metadata anchor. + */ + public void setMetadataAnchor(final String metadataAnchor) { + this.metadataAnchor = metadataAnchor; + } + + /** + * Gets title. + * + * @return title. + */ + public String getTitle() { + return title; + } + + /** + * Sets title. + * + * @param title title. + */ + public void setTitle(final String title) { + this.title = title; + } + + /** + * Gets target. + * + * @return target. + */ + public URI getTarget() { + return target; + } + + /** + * Sets target. + * + * @param target target. + */ + public void setTarget(final URI target) { + this.target = target; + } + +}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/17152920/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/AbstractClientPayload.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/AbstractClientPayload.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/AbstractClientPayload.java deleted file mode 100644 index fc54860..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/AbstractClientPayload.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; - -import java.net.URI; - -/** - * OData entity. - */ -public abstract class AbstractClientPayload extends ClientItem { - - /** - * Context URL. - */ - private URI contextURL; - - public AbstractClientPayload(final String name) { - super(name); - } - - /** - * The context URL describes the content of the payload. It consists of the canonical metadata document URL and a - * fragment identifying the relevant portion of the metadata document. - * - * @return context URL. - */ - public URI getContextURL() { - return contextURL; - } - - public void setContextURL(final URI contextURL) { - this.contextURL = contextURL; - } -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/17152920/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/AbstractClientValue.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/AbstractClientValue.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/AbstractClientValue.java deleted file mode 100644 index af5b423..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/AbstractClientValue.java +++ /dev/null @@ -1,120 +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; - -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; -import org.apache.commons.lang3.builder.ReflectionToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; - -/** - * Abstract representation of an OData entity property value. - */ -public abstract class AbstractClientValue implements ClientValue { - - /** - * Type name; - */ - private final String typeName; - - public AbstractClientValue(final String typeName) { - this.typeName = typeName; - } - - @Override - public String getTypeName() { - return typeName; - } - - /** - * Check is is a primitive value. - * - * @return 'TRUE' if primitive; 'FALSE' otherwise. - */ - @Override - public boolean isPrimitive() { - return (this instanceof ClientPrimitiveValue); - } - - /** - * Casts to primitive value. - * - * @return primitive value. - */ - @Override - public ClientPrimitiveValue asPrimitive() { - return isPrimitive() ? (ClientPrimitiveValue) this : null; - } - - /** - * Check is is a complex value. - * - * @return 'TRUE' if complex; 'FALSE' otherwise. - */ - @Override - public boolean isComplex() { - return (this instanceof ClientComplexValue); - } - - /** - * Casts to complex value. - * - * @return complex value. - */ - @Override - public ClientComplexValue asComplex() { - return isComplex() ? (ClientComplexValue) this : null; - } - - /** - * Check is is a collection value. - * - * @return 'TRUE' if collection; 'FALSE' otherwise. - */ - @Override - public boolean isCollection() { - return (this instanceof ClientCollectionValue); - } - - /** - * Casts to collection value. - * - * @return collection value. - */ - @SuppressWarnings("unchecked") - @Override - public <OV extends ClientValue> ClientCollectionValue<OV> asCollection() { - return isCollection() ? (ClientCollectionValue<OV>) this : null; - } - - @Override - public boolean equals(final Object obj) { - return EqualsBuilder.reflectionEquals(this, obj); - } - - @Override - public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); - } - - @Override - public String toString() { - return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE); - } -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/17152920/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientAnnotatable.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientAnnotatable.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientAnnotatable.java deleted file mode 100644 index f9c5119..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientAnnotatable.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; - -import java.util.List; - -public interface ClientAnnotatable { - - List<ClientAnnotation> getAnnotations(); -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/17152920/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientAnnotation.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientAnnotation.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientAnnotation.java deleted file mode 100644 index 1749c63..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientAnnotation.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; - -public interface ClientAnnotation extends ClientValuable { - - /** - * Returns annotation name. - * - * @return annotation name. - */ - String getTerm(); - -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/17152920/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientCollectionValue.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientCollectionValue.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientCollectionValue.java deleted file mode 100644 index 0497dc6..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientCollectionValue.java +++ /dev/null @@ -1,57 +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; - -import java.util.Collection; - -/** - * OData collection property value. - * - * @param <OV> The actual ODataValue interface. - */ -public interface ClientCollectionValue<OV extends ClientValue> extends ClientValue, Iterable<OV> { - - /** - * Adds a value to the collection. - * - * @param value value to be added. - */ - ClientCollectionValue<OV> add(ClientValue value); - - /** - * Checks if collection is empty. - * - * @return 'TRUE' if empty; 'FALSE' otherwise. - */ - boolean isEmpty(); - - /** - * Gets collection size. - * - * @return collection size. - */ - int size(); - - /** - * Converts this instance as POJO collection. - * - * @return this instance as POJO collection - */ - Collection<Object> asJavaCollection(); -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/17152920/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientComplexValue.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientComplexValue.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientComplexValue.java deleted file mode 100644 index 3c2931a..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientComplexValue.java +++ /dev/null @@ -1,58 +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; - -import java.util.Map; - -/** - * OData complex property value. - * - */ -public interface ClientComplexValue extends ClientValue, ClientLinked, ClientAnnotatable, Iterable<ClientProperty> { - - /** - * Adds field to the complex type. - * - * @param field field to be added. - * @return this (for fluent-style calls) - */ - ClientComplexValue add(ClientProperty field); - - /** - * Gets field. - * - * @param name name of the field to be retrieved. - * @return requested field. - */ - ClientProperty get(String name); - - /** - * Gets number of fields. - * - * @return number of fields. - */ - int size(); - - /** - * Converts this instance as POJO collection. - * - * @return this instance as POJO collection - */ - Map<String, Object> asJavaMap(); -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/17152920/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientDeletedEntity.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientDeletedEntity.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientDeletedEntity.java deleted file mode 100644 index 3cdcb7b..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientDeletedEntity.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; - -import java.net.URI; - -public interface ClientDeletedEntity { - - enum Reason { - - deleted, - changed - - } - - URI getId(); - - Reason getReason(); - -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/17152920/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientDelta.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientDelta.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientDelta.java deleted file mode 100644 index 7092e6f..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientDelta.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; - -import java.util.List; - -public interface ClientDelta extends ClientEntitySet { - - List<ClientDeletedEntity> getDeletedEntities(); - - List<ClientDeltaLink> getAddedLinks(); - - List<ClientDeltaLink> getDeletedLinks(); - -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/17152920/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientDeltaLink.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientDeltaLink.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientDeltaLink.java deleted file mode 100644 index d12aedf..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientDeltaLink.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; - -import java.net.URI; - -public interface ClientDeltaLink extends ClientAnnotatable { - - 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/17152920/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientEntity.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientEntity.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientEntity.java deleted file mode 100644 index 39736cc..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientEntity.java +++ /dev/null @@ -1,202 +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; - -import org.apache.olingo.commons.api.edm.FullQualifiedName; - -import java.net.URI; -import java.util.List; - -/** - * OData entity. - */ -public interface ClientEntity extends ClientLinked, ClientAnnotatable, ClientInvokeResult { - - /** - * @return the type name of this entity. - */ - FullQualifiedName getTypeName(); - - /** - * @return self link. - */ - URI getLink(); - - /** - * Returns OData entity edit link. - * - * @return entity edit link. - */ - URI getEditLink(); - - /** - * Sets OData entity edit link. - * - * @param editLink edit link. - */ - void setEditLink(URI editLink); - - /** - * Gets ETag. - * - * @return ETag. - */ - String getETag(); - - /** - * Sets ETag. - * - * @param eTag ETag. - */ - void setETag(String eTag); - - /** - * Searches for operation with given title. - * - * @param title operation to look for - * @return operation if found with given title, <tt>null</tt> otherwise - */ - ClientOperation getOperation(String title); - - /** - * Gets operations. - * - * @return operations. - */ - List<ClientOperation> getOperations(); - - /** - * Searches for property with given name. - * - * @param name property to look for - * @return property if found with given name, <tt>null</tt> otherwise - */ - ClientProperty getProperty(String name); - - /** - * Returns OData entity properties. - * - * @return OData entity properties. - */ - List<ClientProperty> 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(); - - /** - * Set id for this OData entity. - * - * @param id the if for this entity - */ - void setId(URI id); - - /** - * Gets media-edit link with given name, if available, otherwise <tt>null</tt>. - * - * @param name candidate link name - * @return media-edit link with given name, if available, otherwise <tt>null</tt> - */ - ClientLink getMediaEditLink(final String name); - - /** - * Returns entity media edit links. - * - * @return OData entity links. - */ - List<ClientLink> getMediaEditLinks(); - - /** - * TRUE if read-only entity. - * - * @return TRUE if read-only; FALSE otherwise. - */ - boolean isReadOnly(); - - /** - * Checks if the current entity is a media entity. - * - * @return 'TRUE' if media entity; 'FALSE' otherwise. - */ - boolean isMediaEntity(); - - /** - * Sets media entity flag. - * - * @param isMediaEntity media entity flag value. - */ - void setMediaEntity(boolean isMediaEntity); - - /** - * Gets media content type. - * - * @return media content type. - */ - String getMediaContentType(); - - /** - * Sets media content type. - * - * @param mediaContentType media content type. - */ - void setMediaContentType(String mediaContentType); - - /** - * Gets media content source. - * - * @return media content source. - */ - URI getMediaContentSource(); - - /** - * Sets media content source. - * - * @param mediaContentSource media content source. - */ - void setMediaContentSource(URI mediaContentSource); - - /** - * ETag of the binary stream represented by this media entity or named stream property. - * - * @return media ETag value - */ - String getMediaETag(); - - /** - * Set media ETag. - * - * @param eTag media ETag value - */ - void setMediaETag(String eTag); - -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/17152920/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientEntitySet.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientEntitySet.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientEntitySet.java deleted file mode 100644 index 36a8161..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientEntitySet.java +++ /dev/null @@ -1,71 +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; - -import java.net.URI; -import java.util.List; - -/** - * OData entity collection. If pagination was used to get this instance, forward page navigation URI will be available. - */ -public interface ClientEntitySet extends ClientInvokeResult, ClientAnnotatable { - - /** - * Gets next page link. - * - * @return next page link; null value if single page or last page reached. - */ - URI getNext(); - - /** - * Gets contained entities. - * - * @return entity set's entities. - */ - List<ClientEntity> getEntities(); - - /** - * Gets in-line count. - * - * @return in-line count value. - */ - Integer getCount(); - - /** - * Sets in-line count. - * - * @param count in-line count value. - */ - void setCount(final int count); - - - /** - * 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/17152920/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientEnumValue.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientEnumValue.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientEnumValue.java deleted file mode 100644 index cc88a94..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientEnumValue.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; - -public interface ClientEnumValue extends ClientValue { - - String getValue(); - - @Override - String toString(); -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/17152920/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientError.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientError.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientError.java deleted file mode 100644 index 11b6ca8..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientError.java +++ /dev/null @@ -1,132 +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; - -import java.util.List; -import java.util.Map; - -/** - * OData error. - */ -public class ClientError { - - private String code; - private String message; - private String target; - private List<ClientErrorDetail> details; - private Map<String, String> innerError; - - /** - * The value for the code name/value pair is a language-independent string. Its value is a service-defined error code. - * This code serves as a sub-status for the HTTP error code specified in the response. MAY be null. - * @return the error code as a string - */ - public String getCode() { - return code; - } - - /** - * The value for the code name/value pair is a language-independent string. Its value is a service-defined error code. - * This code serves as a sub-status for the HTTP error code specified in the response. MAY be null. - * @param code - * @return this for method chaining - */ - public ClientError setCode(String code) { - this.code = code; - return this; - } - - /** - * The value for the message name/value pair MUST be a human-readable, language-dependent representation of the error. - * MUST not be null - * @return the message string - */ - public String getMessage() { - return message; - } - - /** - * The value for the message name/value pair MUST be a human-readable, language-dependent representation of the error. - * MUST not be null - * @param message - * @return this for method chaining - */ - public ClientError setMessage(String message) { - this.message = message; - return this; - } - - /** - * The value for the target name/value pair is the target of the particular error (for example, the name of the - * property in error). MAY be null. - * @return the target string - */ - public String getTarget() { - return target; - } - - /** - * The value for the target name/value pair is the target of the particular error (for example, the name of the - * property in error). MAY be null. - * @param target - * @return this for method chaining - */ - public ClientError setTarget(String target) { - this.target = target; - return this; - } - - /** - * Gets error details. - * - * @return ODataErrorDetail list. - */ - public List<ClientErrorDetail> getDetails() { - return details; - } - - /** - * Sets error details. - * - * @return this for method chaining. - */ - public ClientError setDetails(List<ClientErrorDetail> details) { - this.details = details; - return this; - } - - /** - * Gets server defined key-value pairs for debug environment only. - * - * @return a pair representing server defined object. MAY be null. - */ - public Map<String, String> getInnerError() { - return innerError; - } - - /** - * Sets server defined key-value pairs for debug environment only. - * - * @return this for method chaining. - */ - public ClientError setInnerError(Map<String, String> innerError) { - this.innerError = innerError; - return this; - } -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/17152920/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientErrorDetail.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientErrorDetail.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientErrorDetail.java deleted file mode 100644 index 77316ef..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientErrorDetail.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; - -/** - * OData detailsï¼ for example <tt>{ "error": {..., "details":[ - * {"code": "301","target": "$search" ,"message": "$search query option not supported"} - * ],...}}</tt>. - */ -public class ClientErrorDetail { - - private String code; - private String message; - private String target; - - /** - * Gets error code. - * - * @return error code. - */ - public String getCode() { - return code; - } - - public ClientErrorDetail setCode(final String code) { - this.code = code; - return this; - } - - /** - * Gets error message. - * - * @return error message. - */ - public String getMessage() { - return message; - } - - public ClientErrorDetail setMessage(final String message) { - this.message = message; - return this; - } - - /** - * Gets error target. - * - * @return error message. - */ - public String getTarget() { - return target; - } - - public ClientErrorDetail setTarget(final String target) { - this.target = target; - return this; - } -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/17152920/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientInlineEntity.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientInlineEntity.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientInlineEntity.java deleted file mode 100644 index e3fb699..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientInlineEntity.java +++ /dev/null @@ -1,68 +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; - -import java.net.URI; - -/** - * OData in-line entity. - */ -public class ClientInlineEntity extends ClientLink { - - private final ClientEntity entity; - - /** - * Constructor. - * - * @param uri edit link. - * @param type type. - * @param title title. - * @param entity entity. - */ - public ClientInlineEntity(final URI uri, final ClientLinkType type, final String title, final ClientEntity entity) { - - super(uri, type, title); - this.entity = entity; - } - - /** - * Constructor. - * - * @param baseURI base URI. - * @param href href. - * @param type type. - * @param title title. - * @param entity entity. - */ - public ClientInlineEntity(final URI baseURI, final String href, final ClientLinkType type, final String title, - final ClientEntity entity) { - - super(baseURI, href, type, title); - this.entity = entity; - } - - /** - * Gets wrapped entity. - * - * @return wrapped entity. - */ - public ClientEntity getEntity() { - return entity; - } -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/17152920/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientInlineEntitySet.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientInlineEntitySet.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientInlineEntitySet.java deleted file mode 100644 index a14933f..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientInlineEntitySet.java +++ /dev/null @@ -1,69 +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; - -import java.net.URI; - -/** - * OData in-line entity set. - */ -public class ClientInlineEntitySet extends ClientLink { - - private ClientEntitySet entitySet; - - /** - * Constructor. - * - * @param uri edit link. - * @param type type. - * @param title title. - * @param entitySet entity set. - */ - public ClientInlineEntitySet(final URI uri, final ClientLinkType type, - final String title, final ClientEntitySet entitySet) { - - super(uri, type, title); - this.entitySet = entitySet; - } - - /** - * Constructor. - * - * @param baseURI base URI. - * @param href href. - * @param type type. - * @param title title. - * @param entitySet entity set. - */ - public ClientInlineEntitySet(final URI baseURI, final String href, - final ClientLinkType type, final String title, final ClientEntitySet entitySet) { - - super(baseURI, href, type, title); - this.entitySet = entitySet; - } - - /** - * Gets wrapped entity set. - * - * @return wrapped entity set. - */ - public ClientEntitySet getEntitySet() { - return entitySet; - } -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/17152920/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientInvokeResult.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientInvokeResult.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientInvokeResult.java deleted file mode 100644 index a28c078..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientInvokeResult.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; - -/** - * Marker interface for any OData domain object that can be returned by an operation invocation. - * - * @see ClientEntitySet - * @see ClientEntity - * @see ClientProperty - */ -public interface ClientInvokeResult { -//No additional methods needed for now. -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/17152920/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientItem.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientItem.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientItem.java deleted file mode 100644 index 1279aea..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientItem.java +++ /dev/null @@ -1,96 +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; - -import java.net.URI; - -import org.apache.commons.lang3.builder.EqualsBuilder; -import org.apache.commons.lang3.builder.HashCodeBuilder; -import org.apache.commons.lang3.builder.ReflectionToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * Abstract representation of OData entities and links. - */ -public abstract class ClientItem { - - /** - * Logger. - */ - protected static final Logger LOG = LoggerFactory.getLogger(ClientItem.class); - - /** - * OData entity name/type. - */ - private final String name; - - /** - * OData item self link. - */ - protected URI link; - - /** - * Constructor. - * - * @param name ODataItem name (it's entity type for {@link ClientEntity}). - */ - public ClientItem(final String name) { - this.name = name; - } - - /** - * @return ODataItem name (it's entity type for {@link ClientEntity}). - */ - public String getName() { - return name; - } - - /** - * @return ODataItem link (it's edit link for {@link ClientEntity}). - */ - public URI getLink() { - return link; - } - - /** - * Sets ODataItem link (it's edit link for {@link ClientEntity}). - * - * @param link link. - */ - public void setLink(final URI link) { - this.link = link; - } - - @Override - public boolean equals(final Object obj) { - return EqualsBuilder.reflectionEquals(this, obj); - } - - @Override - public int hashCode() { - return HashCodeBuilder.reflectionHashCode(this); - } - - @Override - public String toString() { - return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE); - } -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/17152920/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientLink.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientLink.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientLink.java deleted file mode 100644 index d19c3c5..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientLink.java +++ /dev/null @@ -1,187 +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; - -import java.net.URI; -import java.util.ArrayList; -import java.util.List; - -import org.apache.olingo.commons.api.Constants; - -/** - * OData link. - */ -public class ClientLink extends ClientItem implements ClientAnnotatable { - - public static class Builder { - - protected URI uri; - - protected ClientLinkType type; - - protected String title; - - public Builder setURI(final URI uri) { - this.uri = uri; - return this; - } - - public Builder setURI(final URI baseURI, final String href) { - uri = getURI(baseURI, href); - return this; - } - - public Builder setType(final ClientLinkType type) { - this.type = type; - return this; - } - - public Builder setTitle(final String title) { - this.title = title; - return this; - } - - public ClientLink build() { - return new ClientLink(uri, type, title); - } - } - - /** - * Build URI starting from the given base and href. - * <br/> - * If href is absolute or base is null then base will be ignored. - * - * @param base URI prefix. - * @param href URI suffix. - * @return built URI. - */ - private static URI getURI(final URI base, final String href) { - if (href == null) { - throw new IllegalArgumentException("Null link provided"); - } - - URI uri = URI.create(href); - - if (!uri.isAbsolute() && base != null) { - uri = URI.create(base.toASCIIString() + "/" + href); - } - - return uri.normalize(); - } - - /** - * Link type. - */ - protected final ClientLinkType type; - - /** - * Link rel. - */ - protected final String rel; - - /** - * ETag for media edit links. - */ - protected String mediaETag; - - private final List<ClientAnnotation> annotations = new ArrayList<ClientAnnotation>(); - - /** - * Constructor. - * - * @param uri URI. - * @param type type. - * @param title title. - */ - public ClientLink(final URI uri, final ClientLinkType type, final String title) { - super(title); - - link = uri; - this.type = type; - - switch (this.type) { - case ASSOCIATION: - rel = Constants.NS_ASSOCIATION_LINK_REL + title; - break; - - case ENTITY_NAVIGATION: - case ENTITY_SET_NAVIGATION: - rel = Constants.NS_NAVIGATION_LINK_REL + title; - break; - - case MEDIA_EDIT: - default: - rel = Constants.NS_MEDIA_EDIT_LINK_REL + title; - break; - } - } - - /** - * Constructor. - * - * @param version OData service version. - * @param baseURI base URI. - * @param href href. - * @param type type. - * @param title title. - */ - protected ClientLink(final URI baseURI, final String href, final ClientLinkType type, final String title) { - - this(getURI(baseURI, href), type, title); - } - - /** - * Gets link type. - * - * @return link type; - */ - public ClientLinkType getType() { - return type; - } - - public ClientInlineEntity asInlineEntity() { - return (this instanceof ClientInlineEntity) ? (ClientInlineEntity) this : null; - } - - public ClientInlineEntitySet asInlineEntitySet() { - return (this instanceof ClientInlineEntitySet) ? (ClientInlineEntitySet) this : null; - } - - /** - * Gets link rel. - * - * @return link rel - */ - public String getRel() { - return rel; - } - - /** - * Gets Media ETag. - * - * @return media ETag - */ - public String getMediaETag() { - return mediaETag; - } - - public List<ClientAnnotation> getAnnotations() { - return annotations; - } -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/17152920/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientLinkType.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientLinkType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientLinkType.java deleted file mode 100644 index 8b13c33..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientLinkType.java +++ /dev/null @@ -1,105 +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; - -import org.apache.commons.lang3.StringUtils; -import org.apache.olingo.commons.api.Constants; -import org.apache.olingo.commons.api.format.ContentType; - -/** - * OData link types. - */ -public enum ClientLinkType { - - /** - * Entity navigation link. - */ - ENTITY_NAVIGATION(ContentType.APPLICATION_ATOM_XML_ENTRY), - /** - * Entity set navigation link. - */ - ENTITY_SET_NAVIGATION(ContentType.APPLICATION_ATOM_XML_FEED), - /** - * Association link. - */ - ASSOCIATION(ContentType.APPLICATION_XML), - /** - * Media-edit link. - */ - MEDIA_EDIT("*/*"), - - /** - * Entity binding link. - */ - ENTITY_BINDING(ContentType.APPLICATION_XML), - - /** - * Entity collection binding link. - */ - ENTITY_COLLECTION_BINDING(ContentType.APPLICATION_XML); - - private String type; - - private ClientLinkType(final String type) { - this.type = type; - } - - private ClientLinkType(final ContentType contentType) { - this(contentType.toContentTypeString()); - } - - private ClientLinkType setType(final String type) { - this.type = type; - return this; - } - - /** - * Gets - * <code>LinkType</code> instance from the given rel and type. - * - * @param rel rel. - * @param type type. - * @return <code>ODataLinkType</code> object. - */ - public static ClientLinkType fromString(final String rel, final String type) { - if (StringUtils.isNotBlank(rel) && rel.startsWith(Constants.NS_MEDIA_EDIT_LINK_REL)) { - - return MEDIA_EDIT.setType(StringUtils.isBlank(type) ? "*/*" : type); - } - - if (ClientLinkType.ENTITY_NAVIGATION.type.equals(type)) { - return ENTITY_NAVIGATION; - } - - if (ClientLinkType.ENTITY_SET_NAVIGATION.type.equals(type)) { - return ENTITY_SET_NAVIGATION; - } - - if (ClientLinkType.ASSOCIATION.type.equals(type)) { - return ASSOCIATION; - } - - throw new IllegalArgumentException("Invalid link type: " + type); - } - - @Override - public String toString() { - return type; - } -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/17152920/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientLinked.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientLinked.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientLinked.java deleted file mode 100644 index 92b3a42..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientLinked.java +++ /dev/null @@ -1,70 +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; - -import java.util.List; - -public interface ClientLinked { - - /** - * Puts the given link into one of available lists, based on its type. - * - * @param link to be added - * @return <tt>true</tt> if the given link was added in one of available lists - */ - boolean addLink(ClientLink link); - - /** - * Removes the given link from any list (association, navigation, edit-media). - * - * @param link to be removed - * @return <tt>true</tt> if the given link was contained in one of available lists - */ - boolean removeLink(ClientLink link); - - /** - * Gets association link with given name, if available, otherwise <tt>null</tt>. - * - * @param name candidate link name - * @return association link with given name, if available, otherwise <tt>null</tt> - */ - ClientLink getAssociationLink(String name); - - /** - * Returns all entity association links. - * - * @return OData entity links. - */ - List<ClientLink> getAssociationLinks(); - - /** - * Gets navigation link with given name, if available, otherwise <tt>null</tt>. - * - * @param name candidate link name - * @return navigation link with given name, if available, otherwise <tt>null</tt> - */ - ClientLink getNavigationLink(String name); - - /** - * Returns all entity navigation links (including inline entities / entity sets). - * - * @return OData entity links. - */ - List<ClientLink> getNavigationLinks(); -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/17152920/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientObjectFactory.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientObjectFactory.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientObjectFactory.java deleted file mode 100644 index d9a2e9f..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientObjectFactory.java +++ /dev/null @@ -1,168 +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; - -import org.apache.olingo.commons.api.edm.FullQualifiedName; - -import java.net.URI; - -/** - * Entry point for generating OData domain objects. - */ -public interface ClientObjectFactory { - - /** - * Instantiates a new entity set. - * - * @return entity set. - */ - ClientEntitySet newEntitySet(); - - /** - * Instantiates a new entity set. - * - * @param next next link. - * @return entity set. - */ - ClientEntitySet newEntitySet(URI next); - - /** - * Instantiates a new entity. - * - * @param typeName OData entity type name. - * @return entity. - */ - ClientEntity newEntity(FullQualifiedName typeName); - - /** - * Instantiates a new entity. - * - * @param typeName OData entity type name. - * @param link self link. - * @return entity. - */ - ClientEntity newEntity(FullQualifiedName typeName, URI link); - - /** - * Instantiates a new entity set (for deep insert). - * - * @param name name. - * @param entitySet entity set. - * @return in-line entity set. - */ - ClientInlineEntitySet newDeepInsertEntitySet(String name, ClientEntitySet entitySet); - - /** - * Instantiates a new entity (for deep insert). - * - * @param name name. - * @param entity entity. - * @return in-line entity. - */ - ClientInlineEntity newDeepInsertEntity(String name, ClientEntity entity); - - /** - * Instantiates a new entity set navigation link. - * - * @param name name. - * @param link link. - * @return entity set navigation link. - */ - ClientLink newEntitySetNavigationLink(String name, URI link); - - /** - * Instantiates a new singleton entity. - * - * @param typeName OData singleton entity type name. - * @return new singleton entity. - */ - ClientSingleton newSingleton(FullQualifiedName typeName); - - /** - * Instantiates a new entity navigation link. - * - * @param name name. - * @param link link. - * @return entity navigation link. - */ - ClientLink newEntityNavigationLink(String name, URI link); - - ClientLink newAssociationLink(String name, URI link); - - ClientLink newMediaEditLink(String name, URI link); - - ClientPrimitiveValue.Builder newPrimitiveValueBuilder(); - - ClientEnumValue newEnumValue(String typeName, String value); - - ClientComplexValue newComplexValue(String typeName); - - ClientCollectionValue<ClientValue> newCollectionValue(String typeName); - - /** - * Instantiates a new primitive property. - * - * @param name name. - * @param value primitive value. - * @return primitive property. - */ - ClientProperty newPrimitiveProperty(String name, ClientPrimitiveValue value); - - /** - * Instantiates a new complex property. - * - * @param name name. - * @param value value. - * @return complex property. - */ - ClientProperty newComplexProperty(String name, ClientComplexValue value); - - /** - * Instantiates a new collection property. - * - * @param name name. - * @param value value. - * @return collection property. - */ - ClientProperty newCollectionProperty(String name, ClientCollectionValue<? extends ClientValue> value); - - /** - * Instantiates a new enum property. - * - * @param name name. - * @param value value. - * @return new enum property. - */ - ClientProperty newEnumProperty(String name, ClientEnumValue value); - - /** - * Instantiates a new delta property. - * - * @return new delta property. - */ - ClientDelta newDelta(); - - /** - * Instantiates a new delta property. - * - * @param next next link for delta property - * @return new delta property. - */ - ClientDelta newDelta(URI next); -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/17152920/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientOperation.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientOperation.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientOperation.java deleted file mode 100644 index e5c5845..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientOperation.java +++ /dev/null @@ -1,85 +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; - -import java.net.URI; - -public class ClientOperation { - - private String metadataAnchor; - - private String title; - - private URI target; - - /** - * Gets metadata anchor. - * - * @return metadata anchor. - */ - public String getMetadataAnchor() { - return metadataAnchor; - } - - /** - * Sets metadata anchor. - * - * @param metadataAnchor metadata anchor. - */ - public void setMetadataAnchor(final String metadataAnchor) { - this.metadataAnchor = metadataAnchor; - } - - /** - * Gets title. - * - * @return title. - */ - public String getTitle() { - return title; - } - - /** - * Sets title. - * - * @param title title. - */ - public void setTitle(final String title) { - this.title = title; - } - - /** - * Gets target. - * - * @return target. - */ - public URI getTarget() { - return target; - } - - /** - * Sets target. - * - * @param target target. - */ - public void setTarget(final URI target) { - this.target = target; - } - -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/17152920/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientPrimitiveValue.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientPrimitiveValue.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientPrimitiveValue.java deleted file mode 100644 index a3da64a..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientPrimitiveValue.java +++ /dev/null @@ -1,88 +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; - -import org.apache.olingo.commons.api.edm.EdmPrimitiveType; -import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException; -import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind; -import org.apache.olingo.commons.api.edm.EdmType; - -import java.util.UUID; - -public interface ClientPrimitiveValue extends ClientValue { - - interface Builder { - - Builder setType(EdmType type); - - Builder setType(EdmPrimitiveTypeKind type); - - Builder setValue(Object value); - - ClientPrimitiveValue build(); - - ClientPrimitiveValue buildBoolean(Boolean value); - - ClientPrimitiveValue buildInt16(Short value); - - ClientPrimitiveValue buildInt32(Integer value); - - ClientPrimitiveValue buildInt64(Long value); - - ClientPrimitiveValue buildSingle(Float value); - - ClientPrimitiveValue buildDouble(Double value); - - ClientPrimitiveValue buildString(String value); - - ClientPrimitiveValue buildGuid(UUID value); - - ClientPrimitiveValue buildBinary(byte[] value); - } - - EdmPrimitiveTypeKind getTypeKind(); - - EdmPrimitiveType getType(); - - /** - * Returns the current value as generic Object. - * - * @return an uncasted instance of this value - */ - Object toValue(); - - /** - * Returns the current value casted to the given type. - * - * @param <T> cast type - * @param reference class reference - * @return the current value as typed java instance - * @throws EdmPrimitiveTypeException if the object is not assignable to the type T. - */ - <T> T toCastValue(Class<T> reference) throws EdmPrimitiveTypeException; - - /** - * Serialize the current value as String. - * - * @return a String representation of this value - */ - @Override - String toString(); - -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/17152920/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientProperty.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientProperty.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientProperty.java deleted file mode 100644 index 8d7a490..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientProperty.java +++ /dev/null @@ -1,32 +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; - -/** - * OData entity property. - */ -public interface ClientProperty extends ClientInvokeResult, ClientAnnotatable, ClientValuable { - - /** - * Returns property name. - * - * @return property name. - */ - String getName(); -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/17152920/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientPropertyType.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientPropertyType.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientPropertyType.java deleted file mode 100644 index 96ab250..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientPropertyType.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; - -public enum ClientPropertyType { - - /** - * Primitive (including geospatial). - */ - PRIMITIVE, - /** - * Enum. - */ - ENUM, - /** - * Collection. - */ - COLLECTION, - /** - * Complex. - */ - COMPLEX, - /** - * Empty type (possibly, no type information could be retrieved). - */ - EMPTY - -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/17152920/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientServiceDocument.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientServiceDocument.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientServiceDocument.java deleted file mode 100644 index a2af9ab..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientServiceDocument.java +++ /dev/null @@ -1,163 +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; - -import java.net.URI; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - -public class ClientServiceDocument { - - private final Map<String, URI> entitySets = new HashMap<String, URI>(); - - private final Map<String, URI> functionImports = new HashMap<String, URI>(); - - private final Map<String, URI> singletons = new HashMap<String, URI>(); - - private final Map<String, URI> relatedServiceDocuments = new HashMap<String, URI>(); - - public Map<String, URI> getEntitySets() { - return entitySets; - } - - /** - * Gets entity set names. - * - * @return entity set names. - */ - public Collection<String> getEntitySetNames() { - return entitySets.keySet(); - } - - /** - * Gets entity set URIs. - * - * @return entity set URIs. - */ - public Collection<URI> getEntitySetURIs() { - return entitySets.values(); - } - - /** - * Gets URI about the given entity set. - * - * @param name name. - * @return URI. - */ - public URI getEntitySetURI(final String name) { - return entitySets.get(name); - } - - public Map<String, URI> getFunctionImports() { - return functionImports; - } - - /** - * Gets function import names. - * - * @return function import names. - */ - public Collection<String> getFunctionImportNames() { - return functionImports.keySet(); - } - - /** - * Gets function import URIs. - * - * @return function import URIs. - */ - public Collection<URI> getFunctionImportURIs() { - return functionImports.values(); - } - - /** - * Gets URI of the given function import. - * - * @param name name. - * @return URI. - */ - public URI getFunctionImportURI(final String name) { - return functionImports.get(name); - } - - public Map<String, URI> getSingletons() { - return singletons; - } - - /** - * Gets singleton names. - * - * @return singleton names. - */ - public Collection<String> getSingletonNames() { - return singletons.keySet(); - } - - /** - * Gets singleton URIs. - * - * @return singleton URIs. - */ - public Collection<URI> getSingletonURIs() { - return singletons.values(); - } - - /** - * Gets URI of the given singleton. - * - * @param name name. - * @return URI. - */ - public URI getSingletonURI(final String name) { - return singletons.get(name); - } - - public Map<String, URI> getRelatedServiceDocuments() { - return relatedServiceDocuments; - } - - /** - * Gets related service documents names. - * - * @return related service documents names. - */ - public Collection<String> getRelatedServiceDocumentsNames() { - return relatedServiceDocuments.keySet(); - } - - /** - * Gets related service documents URIs. - * - * @return related service documents URIs. - */ - public Collection<URI> getRelatedServiceDocumentsURIs() { - return relatedServiceDocuments.values(); - } - - /** - * Gets URI of the given related service documents. - * - * @param name name. - * @return URI. - */ - public URI getRelatedServiceDocumentURI(final String name) { - return relatedServiceDocuments.get(name); - } -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/17152920/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientSingleton.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientSingleton.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientSingleton.java deleted file mode 100644 index aa474b7..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientSingleton.java +++ /dev/null @@ -1,23 +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; - -public interface ClientSingleton extends ClientEntity { -//No additional methods needed for now. -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/17152920/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientValuable.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientValuable.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientValuable.java deleted file mode 100644 index 636972a..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientValuable.java +++ /dev/null @@ -1,94 +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; - - -public interface ClientValuable { - - /** - * Returns annotation value. - * - * @return annotation value. - */ - ClientValue 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. - */ - ClientPrimitiveValue 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. - */ - ClientCollectionValue<ClientValue> 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. - */ - ClientComplexValue getComplexValue(); - - /** - * 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. - */ - ClientEnumValue getEnumValue(); - -} http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/17152920/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientValue.java ---------------------------------------------------------------------- diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientValue.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientValue.java deleted file mode 100644 index ba41bc0..0000000 --- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ClientValue.java +++ /dev/null @@ -1,91 +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; - - -/** - * Abstract representation of an OData entity property value. - */ -public interface ClientValue { - - /** - * Gets value type name. - * - * @return value type name. - */ - String getTypeName(); - - /** - * Check is is a primitive value. - * - * @return 'TRUE' if primitive; 'FALSE' otherwise. - */ - boolean isPrimitive(); - - /** - * Casts to primitive value. - * - * @return primitive value. - */ - ClientPrimitiveValue asPrimitive(); - - /** - * Check is is a collection value. - * - * @return 'TRUE' if collection; 'FALSE' otherwise. - */ - boolean isCollection(); - - /** - * Casts to collection value. - * - * @param <OV> The actual ODataValue interface. - * @return collection value. - */ - <OV extends ClientValue> ClientCollectionValue<OV> asCollection(); - - /** - * Casts to complex value. - * - * @return complex value. - */ - ClientComplexValue asComplex(); - - /** - * Check is is a linked complex value. - * - * @return 'TRUE' if linked complex; 'FALSE' otherwise. - */ - boolean isComplex(); - - /** - * Check is is an enum value. - * - * @return 'TRUE' if enum; 'FALSE' otherwise. - */ - boolean isEnum(); - - /** - * Casts to enum value. - * - * @return enum value. - */ - ClientEnumValue asEnum(); - -}
