This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag org.apache.sling.models.api-1.3.4
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-models-api.git

commit f73a0011c3b4a84a35684d0f4197159ed507ab5a
Author: Justin Edelson <[email protected]>
AuthorDate: Wed Mar 29 22:43:15 2017 +0000

    SLING-6748 - move ValuePreparer to API
    
    git-svn-id: 
https://svn.apache.org/repos/asf/sling/trunk/bundles/extensions/models/api@1789419
 13f79535-47bb-0310-9956-ffa450edef68
---
 .../spi/{package-info.java => ValuePreparer.java}  | 22 ++++++++++++++++++++--
 .../org/apache/sling/models/spi/package-info.java  |  2 +-
 2 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/sling/models/spi/package-info.java 
b/src/main/java/org/apache/sling/models/spi/ValuePreparer.java
similarity index 56%
copy from src/main/java/org/apache/sling/models/spi/package-info.java
copy to src/main/java/org/apache/sling/models/spi/ValuePreparer.java
index 07a5625..842b7a8 100644
--- a/src/main/java/org/apache/sling/models/spi/package-info.java
+++ b/src/main/java/org/apache/sling/models/spi/ValuePreparer.java
@@ -14,7 +14,25 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-@Version("1.1.1")
 package org.apache.sling.models.spi;
 
-import aQute.bnd.annotation.Version;
\ No newline at end of file
+import aQute.bnd.annotation.ConsumerType;
+
+import javax.annotation.Nonnull;
+
+/**
+ * Optimization interface for Injectors which wish to avoid repeated accessing 
of some object
+ * based on the adaptable. If an Injector implements this interface, it must 
also be prepared
+ * to handle the case where ObjectUtils.NULL is passed as the adaptable.
+ */
+@ConsumerType
+public interface ValuePreparer {
+
+    /**
+     * Prepare a value from the adaptable.
+     *
+     * @param adaptable the adaptable
+     * @return a prepared value or ObjectUtils.NULL if a value is not 
preparable
+     */
+    @Nonnull Object prepareValue(@Nonnull Object adaptable);
+}
diff --git a/src/main/java/org/apache/sling/models/spi/package-info.java 
b/src/main/java/org/apache/sling/models/spi/package-info.java
index 07a5625..3c11005 100644
--- a/src/main/java/org/apache/sling/models/spi/package-info.java
+++ b/src/main/java/org/apache/sling/models/spi/package-info.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-@Version("1.1.1")
+@Version("1.2.0")
 package org.apache.sling.models.spi;
 
 import aQute.bnd.annotation.Version;
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
"[email protected]" <[email protected]>.

Reply via email to