Return-Path: X-Original-To: apmail-ignite-commits-archive@minotaur.apache.org Delivered-To: apmail-ignite-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 764AE17AE6 for ; Thu, 29 Oct 2015 11:12:17 +0000 (UTC) Received: (qmail 15660 invoked by uid 500); 29 Oct 2015 11:12:15 -0000 Delivered-To: apmail-ignite-commits-archive@ignite.apache.org Received: (qmail 15590 invoked by uid 500); 29 Oct 2015 11:12:15 -0000 Mailing-List: contact commits-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list commits@ignite.apache.org Received: (qmail 12399 invoked by uid 99); 29 Oct 2015 11:12:13 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Oct 2015 11:12:13 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 37FA8E391A; Thu, 29 Oct 2015 11:12:13 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: akuznetsov@apache.org To: commits@ignite.apache.org Date: Thu, 29 Oct 2015 11:12:58 -0000 Message-Id: <77db1cc6de4841b688331638a4eaaee4@git.apache.org> In-Reply-To: <90a49c9cf22b48f3833ca112d1a563da@git.apache.org> References: <90a49c9cf22b48f3833ca112d1a563da@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [47/50] [abbrv] ignite git commit: Ignite-1282 - Ignite object interface. Ignite-1282 - Ignite object interface. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/4134f64e Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/4134f64e Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/4134f64e Branch: refs/heads/ignite-1753-1282 Commit: 4134f64e7bc430606d4964cd929537160914ba1d Parents: 9d67c20 Author: Alexey Goncharuk Authored: Thu Oct 29 13:14:59 2015 +0300 Committer: Alexey Goncharuk Committed: Thu Oct 29 13:14:59 2015 +0300 ---------------------------------------------------------------------- .../org/apache/ignite/cache/IgniteObject.java | 60 ++++++++++++++++++++ .../apache/ignite/portable/PortableObject.java | 12 ++-- 2 files changed, 66 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/4134f64e/modules/core/src/main/java/org/apache/ignite/cache/IgniteObject.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/cache/IgniteObject.java b/modules/core/src/main/java/org/apache/ignite/cache/IgniteObject.java new file mode 100644 index 0000000..ab926ce --- /dev/null +++ b/modules/core/src/main/java/org/apache/ignite/cache/IgniteObject.java @@ -0,0 +1,60 @@ +/* + * 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.ignite.cache; + +import java.io.Serializable; +import org.apache.ignite.portable.PortableException; +import org.jetbrains.annotations.Nullable; + +/** + * Ignite object. Abstracted representation of a binary object form. + */ +public interface IgniteObject extends Serializable { + /** + * Gets object type ID. + * + * @return Type ID. + */ + public int typeId(); + + /** + * Gets field value. + * + * @param fieldName Field name. + * @return Field value. + * @throws PortableException In case of any other error. + */ + @Nullable public F field(String fieldName) throws PortableException; + + /** + * Checks whether field is set. + * + * @param fieldName Field name. + * @return {@code true} if field is set. + */ + public boolean hasField(String fieldName); + + /** + * Gets fully deserialized instance of portable object. + * + * @return Fully deserialized instance of portable object. + * @throws org.apache.ignite.portable.PortableInvalidClassException If class doesn't exist. + * @throws PortableException In case of any other error. + */ + @Nullable public T deserialize() throws PortableException; +} http://git-wip-us.apache.org/repos/asf/ignite/blob/4134f64e/modules/core/src/main/java/org/apache/ignite/portable/PortableObject.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/portable/PortableObject.java b/modules/core/src/main/java/org/apache/ignite/portable/PortableObject.java index 66b8f76..92b25aa 100644 --- a/modules/core/src/main/java/org/apache/ignite/portable/PortableObject.java +++ b/modules/core/src/main/java/org/apache/ignite/portable/PortableObject.java @@ -17,12 +17,12 @@ package org.apache.ignite.portable; -import java.io.Serializable; import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedList; import java.util.TreeMap; import org.apache.ignite.IgnitePortables; +import org.apache.ignite.cache.IgniteObject; import org.apache.ignite.marshaller.portable.PortableMarshaller; import org.jetbrains.annotations.Nullable; @@ -103,13 +103,13 @@ import org.jetbrains.annotations.Nullable; * methods. Having metadata also allows for proper formatting of {@code PortableObject.toString()} method, * even when portable objects are kept in binary format only, which may be necessary for audit reasons. */ -public interface PortableObject extends Serializable, Cloneable { +public interface PortableObject extends IgniteObject, Cloneable { /** * Gets portable object type ID. * * @return Type ID. */ - public int typeId(); + @Override public int typeId(); /** * Gets meta data for this portable object. @@ -126,7 +126,7 @@ public interface PortableObject extends Serializable, Cloneable { * @return Field value. * @throws PortableException In case of any other error. */ - @Nullable public F field(String fieldName) throws PortableException; + @Override @Nullable public F field(String fieldName) throws PortableException; /** * Checks whether field is set. @@ -134,7 +134,7 @@ public interface PortableObject extends Serializable, Cloneable { * @param fieldName Field name. * @return {@code true} if field is set. */ - public boolean hasField(String fieldName); + @Override public boolean hasField(String fieldName); /** * Gets fully deserialized instance of portable object. @@ -143,7 +143,7 @@ public interface PortableObject extends Serializable, Cloneable { * @throws PortableInvalidClassException If class doesn't exist. * @throws PortableException In case of any other error. */ - @Nullable public T deserialize() throws PortableException; + @Override @Nullable public T deserialize() throws PortableException; /** * Copies this portable object.